diff --git a/Makefile b/Makefile index 87a10f59..e4d813b0 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ APP=wtfutil ## build: builds a local version build: - go build -o bin/${APP} -mod=vendor + go build -o bin/${APP} @echo "Done building" ## clean: removes old build cruft diff --git a/vendor/cloud.google.com/go/LICENSE b/vendor/cloud.google.com/go/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/cloud.google.com/go/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go deleted file mode 100644 index 125b7033..00000000 --- a/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ /dev/null @@ -1,513 +0,0 @@ -// Copyright 2014 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package metadata provides access to Google Compute Engine (GCE) -// metadata and API service accounts. -// -// This package is a wrapper around the GCE metadata service, -// as documented at https://developers.google.com/compute/docs/metadata. -package metadata // import "cloud.google.com/go/compute/metadata" - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "runtime" - "strings" - "sync" - "time" -) - -const ( - // metadataIP is the documented metadata server IP address. - metadataIP = "169.254.169.254" - - // metadataHostEnv is the environment variable specifying the - // GCE metadata hostname. If empty, the default value of - // metadataIP ("169.254.169.254") is used instead. - // This is variable name is not defined by any spec, as far as - // I know; it was made up for the Go package. - metadataHostEnv = "GCE_METADATA_HOST" - - userAgent = "gcloud-golang/0.1" -) - -type cachedValue struct { - k string - trim bool - mu sync.Mutex - v string -} - -var ( - projID = &cachedValue{k: "project/project-id", trim: true} - projNum = &cachedValue{k: "project/numeric-project-id", trim: true} - instID = &cachedValue{k: "instance/id", trim: true} -) - -var ( - defaultClient = &Client{hc: &http.Client{ - Transport: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - ResponseHeaderTimeout: 2 * time.Second, - }, - }} - subscribeClient = &Client{hc: &http.Client{ - Transport: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - }, - }} -) - -// NotDefinedError is returned when requested metadata is not defined. -// -// The underlying string is the suffix after "/computeMetadata/v1/". -// -// This error is not returned if the value is defined to be the empty -// string. -type NotDefinedError string - -func (suffix NotDefinedError) Error() string { - return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) -} - -func (c *cachedValue) get(cl *Client) (v string, err error) { - defer c.mu.Unlock() - c.mu.Lock() - if c.v != "" { - return c.v, nil - } - if c.trim { - v, err = cl.getTrimmed(c.k) - } else { - v, err = cl.Get(c.k) - } - if err == nil { - c.v = v - } - return -} - -var ( - onGCEOnce sync.Once - onGCE bool -) - -// OnGCE reports whether this process is running on Google Compute Engine. -func OnGCE() bool { - onGCEOnce.Do(initOnGCE) - return onGCE -} - -func initOnGCE() { - onGCE = testOnGCE() -} - -func testOnGCE() bool { - // The user explicitly said they're on GCE, so trust them. - if os.Getenv(metadataHostEnv) != "" { - return true - } - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - resc := make(chan bool, 2) - - // Try two strategies in parallel. - // See https://github.com/googleapis/google-cloud-go/issues/194 - go func() { - req, _ := http.NewRequest("GET", "http://"+metadataIP, nil) - req.Header.Set("User-Agent", userAgent) - res, err := defaultClient.hc.Do(req.WithContext(ctx)) - if err != nil { - resc <- false - return - } - defer res.Body.Close() - resc <- res.Header.Get("Metadata-Flavor") == "Google" - }() - - go func() { - addrs, err := net.LookupHost("metadata.google.internal") - if err != nil || len(addrs) == 0 { - resc <- false - return - } - resc <- strsContains(addrs, metadataIP) - }() - - tryHarder := systemInfoSuggestsGCE() - if tryHarder { - res := <-resc - if res { - // The first strategy succeeded, so let's use it. - return true - } - // Wait for either the DNS or metadata server probe to - // contradict the other one and say we are running on - // GCE. Give it a lot of time to do so, since the system - // info already suggests we're running on a GCE BIOS. - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case res = <-resc: - return res - case <-timer.C: - // Too slow. Who knows what this system is. - return false - } - } - - // There's no hint from the system info that we're running on - // GCE, so use the first probe's result as truth, whether it's - // true or false. The goal here is to optimize for speed for - // users who are NOT running on GCE. We can't assume that - // either a DNS lookup or an HTTP request to a blackholed IP - // address is fast. Worst case this should return when the - // metaClient's Transport.ResponseHeaderTimeout or - // Transport.Dial.Timeout fires (in two seconds). - return <-resc -} - -// systemInfoSuggestsGCE reports whether the local system (without -// doing network requests) suggests that we're running on GCE. If this -// returns true, testOnGCE tries a bit harder to reach its metadata -// server. -func systemInfoSuggestsGCE() bool { - if runtime.GOOS != "linux" { - // We don't have any non-Linux clues available, at least yet. - return false - } - slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") - name := strings.TrimSpace(string(slurp)) - return name == "Google" || name == "Google Compute Engine" -} - -// Subscribe calls Client.Subscribe on a client designed for subscribing (one with no -// ResponseHeaderTimeout). -func Subscribe(suffix string, fn func(v string, ok bool) error) error { - return subscribeClient.Subscribe(suffix, fn) -} - -// Get calls Client.Get on the default client. -func Get(suffix string) (string, error) { return defaultClient.Get(suffix) } - -// ProjectID returns the current instance's project ID string. -func ProjectID() (string, error) { return defaultClient.ProjectID() } - -// NumericProjectID returns the current instance's numeric project ID. -func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() } - -// InternalIP returns the instance's primary internal IP address. -func InternalIP() (string, error) { return defaultClient.InternalIP() } - -// ExternalIP returns the instance's primary external (public) IP address. -func ExternalIP() (string, error) { return defaultClient.ExternalIP() } - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func Hostname() (string, error) { return defaultClient.Hostname() } - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() } - -// InstanceID returns the current VM's numeric instance ID. -func InstanceID() (string, error) { return defaultClient.InstanceID() } - -// InstanceName returns the current VM's instance ID string. -func InstanceName() (string, error) { return defaultClient.InstanceName() } - -// Zone returns the current VM's zone, such as "us-central1-b". -func Zone() (string, error) { return defaultClient.Zone() } - -// InstanceAttributes calls Client.InstanceAttributes on the default client. -func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() } - -// ProjectAttributes calls Client.ProjectAttributes on the default client. -func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() } - -// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client. -func InstanceAttributeValue(attr string) (string, error) { - return defaultClient.InstanceAttributeValue(attr) -} - -// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client. -func ProjectAttributeValue(attr string) (string, error) { - return defaultClient.ProjectAttributeValue(attr) -} - -// Scopes calls Client.Scopes on the default client. -func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) } - -func strsContains(ss []string, s string) bool { - for _, v := range ss { - if v == s { - return true - } - } - return false -} - -// A Client provides metadata. -type Client struct { - hc *http.Client -} - -// NewClient returns a Client that can be used to fetch metadata. All HTTP requests -// will use the given http.Client instead of the default client. -func NewClient(c *http.Client) *Client { - return &Client{hc: c} -} - -// getETag returns a value from the metadata service as well as the associated ETag. -// This func is otherwise equivalent to Get. -func (c *Client) getETag(suffix string) (value, etag string, err error) { - // Using a fixed IP makes it very difficult to spoof the metadata service in - // a container, which is an important use-case for local testing of cloud - // deployments. To enable spoofing of the metadata service, the environment - // variable GCE_METADATA_HOST is first inspected to decide where metadata - // requests shall go. - host := os.Getenv(metadataHostEnv) - if host == "" { - // Using 169.254.169.254 instead of "metadata" here because Go - // binaries built with the "netgo" tag and without cgo won't - // know the search suffix for "metadata" is - // ".google.internal", and this IP address is documented as - // being stable anyway. - host = metadataIP - } - u := "http://" + host + "/computeMetadata/v1/" + suffix - req, _ := http.NewRequest("GET", u, nil) - req.Header.Set("Metadata-Flavor", "Google") - req.Header.Set("User-Agent", userAgent) - res, err := c.hc.Do(req) - if err != nil { - return "", "", err - } - defer res.Body.Close() - if res.StatusCode == http.StatusNotFound { - return "", "", NotDefinedError(suffix) - } - all, err := ioutil.ReadAll(res.Body) - if err != nil { - return "", "", err - } - if res.StatusCode != 200 { - return "", "", &Error{Code: res.StatusCode, Message: string(all)} - } - return string(all), res.Header.Get("Etag"), nil -} - -// Get returns a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// -// If the GCE_METADATA_HOST environment variable is not defined, a default of -// 169.254.169.254 will be used instead. -// -// If the requested metadata is not defined, the returned error will -// be of type NotDefinedError. -func (c *Client) Get(suffix string) (string, error) { - val, _, err := c.getETag(suffix) - return val, err -} - -func (c *Client) getTrimmed(suffix string) (s string, err error) { - s, err = c.Get(suffix) - s = strings.TrimSpace(s) - return -} - -func (c *Client) lines(suffix string) ([]string, error) { - j, err := c.Get(suffix) - if err != nil { - return nil, err - } - s := strings.Split(strings.TrimSpace(j), "\n") - for i := range s { - s[i] = strings.TrimSpace(s[i]) - } - return s, nil -} - -// ProjectID returns the current instance's project ID string. -func (c *Client) ProjectID() (string, error) { return projID.get(c) } - -// NumericProjectID returns the current instance's numeric project ID. -func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) } - -// InstanceID returns the current VM's numeric instance ID. -func (c *Client) InstanceID() (string, error) { return instID.get(c) } - -// InternalIP returns the instance's primary internal IP address. -func (c *Client) InternalIP() (string, error) { - return c.getTrimmed("instance/network-interfaces/0/ip") -} - -// ExternalIP returns the instance's primary external (public) IP address. -func (c *Client) ExternalIP() (string, error) { - return c.getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") -} - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func (c *Client) Hostname() (string, error) { - return c.getTrimmed("instance/hostname") -} - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func (c *Client) InstanceTags() ([]string, error) { - var s []string - j, err := c.Get("instance/tags") - if err != nil { - return nil, err - } - if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil { - return nil, err - } - return s, nil -} - -// InstanceName returns the current VM's instance ID string. -func (c *Client) InstanceName() (string, error) { - host, err := c.Hostname() - if err != nil { - return "", err - } - return strings.Split(host, ".")[0], nil -} - -// Zone returns the current VM's zone, such as "us-central1-b". -func (c *Client) Zone() (string, error) { - zone, err := c.getTrimmed("instance/zone") - // zone is of the form "projects//zones/". - if err != nil { - return "", err - } - return zone[strings.LastIndex(zone, "/")+1:], nil -} - -// InstanceAttributes returns the list of user-defined attributes, -// assigned when initially creating a GCE VM instance. The value of an -// attribute can be obtained with InstanceAttributeValue. -func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") } - -// ProjectAttributes returns the list of user-defined attributes -// applying to the project as a whole, not just this VM. The value of -// an attribute can be obtained with ProjectAttributeValue. -func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") } - -// InstanceAttributeValue returns the value of the provided VM -// instance attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// InstanceAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) InstanceAttributeValue(attr string) (string, error) { - return c.Get("instance/attributes/" + attr) -} - -// ProjectAttributeValue returns the value of the provided -// project attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// ProjectAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func (c *Client) ProjectAttributeValue(attr string) (string, error) { - return c.Get("project/attributes/" + attr) -} - -// Scopes returns the service account scopes for the given account. -// The account may be empty or the string "default" to use the instance's -// main account. -func (c *Client) Scopes(serviceAccount string) ([]string, error) { - if serviceAccount == "" { - serviceAccount = "default" - } - return c.lines("instance/service-accounts/" + serviceAccount + "/scopes") -} - -// Subscribe subscribes to a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// The suffix may contain query parameters. -// -// Subscribe calls fn with the latest metadata value indicated by the provided -// suffix. If the metadata value is deleted, fn is called with the empty string -// and ok false. Subscribe blocks until fn returns a non-nil error or the value -// is deleted. Subscribe returns the error value returned from the last call to -// fn, which may be nil when ok == false. -func (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error { - const failedSubscribeSleep = time.Second * 5 - - // First check to see if the metadata value exists at all. - val, lastETag, err := c.getETag(suffix) - if err != nil { - return err - } - - if err := fn(val, true); err != nil { - return err - } - - ok := true - if strings.ContainsRune(suffix, '?') { - suffix += "&wait_for_change=true&last_etag=" - } else { - suffix += "?wait_for_change=true&last_etag=" - } - for { - val, etag, err := c.getETag(suffix + url.QueryEscape(lastETag)) - if err != nil { - if _, deleted := err.(NotDefinedError); !deleted { - time.Sleep(failedSubscribeSleep) - continue // Retry on other errors. - } - ok = false - } - lastETag = etag - - if err := fn(val, ok); err != nil || !ok { - return err - } - } -} - -// Error contains an error response from the server. -type Error struct { - // Code is the HTTP response status code. - Code int - // Message is the server response message. - Message string -} - -func (e *Error) Error() string { - return fmt.Sprintf("compute: Received %d `%s`", e.Code, e.Message) -} diff --git a/vendor/code.cloudfoundry.org/bytefmt/LICENSE b/vendor/code.cloudfoundry.org/bytefmt/LICENSE deleted file mode 100644 index f49a4e16..00000000 --- a/vendor/code.cloudfoundry.org/bytefmt/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/code.cloudfoundry.org/bytefmt/NOTICE b/vendor/code.cloudfoundry.org/bytefmt/NOTICE deleted file mode 100644 index 8625a7f4..00000000 --- a/vendor/code.cloudfoundry.org/bytefmt/NOTICE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. - -This project contains software that is Copyright (c) 2013-2015 Pivotal Software, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -This project may include a number of subcomponents with separate -copyright notices and license terms. Your use of these subcomponents -is subject to the terms and conditions of each subcomponent's license, -as noted in the LICENSE file. diff --git a/vendor/code.cloudfoundry.org/bytefmt/README.md b/vendor/code.cloudfoundry.org/bytefmt/README.md deleted file mode 100644 index 44d287d1..00000000 --- a/vendor/code.cloudfoundry.org/bytefmt/README.md +++ /dev/null @@ -1,15 +0,0 @@ -bytefmt -======= - -**Note**: This repository should be imported as `code.cloudfoundry.org/bytefmt`. - -Human-readable byte formatter. - -Example: - -```go -bytefmt.ByteSize(100.5*bytefmt.MEGABYTE) // returns "100.5M" -bytefmt.ByteSize(uint64(1024)) // returns "1K" -``` - -For documentation, please see http://godoc.org/code.cloudfoundry.org/bytefmt diff --git a/vendor/code.cloudfoundry.org/bytefmt/bytes.go b/vendor/code.cloudfoundry.org/bytefmt/bytes.go deleted file mode 100644 index 73956047..00000000 --- a/vendor/code.cloudfoundry.org/bytefmt/bytes.go +++ /dev/null @@ -1,121 +0,0 @@ -// Package bytefmt contains helper methods and constants for converting to and from a human-readable byte format. -// -// bytefmt.ByteSize(100.5*bytefmt.MEGABYTE) // "100.5M" -// bytefmt.ByteSize(uint64(1024)) // "1K" -// -package bytefmt - -import ( - "errors" - "strconv" - "strings" - "unicode" -) - -const ( - BYTE = 1 << (10 * iota) - KILOBYTE - MEGABYTE - GIGABYTE - TERABYTE - PETABYTE - EXABYTE -) - -var invalidByteQuantityError = errors.New("byte quantity must be a positive integer with a unit of measurement like M, MB, MiB, G, GiB, or GB") - -// ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available: -// E: Exabyte -// P: Petabyte -// T: Terabyte -// G: Gigabyte -// M: Megabyte -// K: Kilobyte -// B: Byte -// The unit that results in the smallest number greater than or equal to 1 is always chosen. -func ByteSize(bytes uint64) string { - unit := "" - value := float64(bytes) - - switch { - case bytes >= EXABYTE: - unit = "E" - value = value / EXABYTE - case bytes >= PETABYTE: - unit = "P" - value = value / PETABYTE - case bytes >= TERABYTE: - unit = "T" - value = value / TERABYTE - case bytes >= GIGABYTE: - unit = "G" - value = value / GIGABYTE - case bytes >= MEGABYTE: - unit = "M" - value = value / MEGABYTE - case bytes >= KILOBYTE: - unit = "K" - value = value / KILOBYTE - case bytes >= BYTE: - unit = "B" - case bytes == 0: - return "0B" - } - - result := strconv.FormatFloat(value, 'f', 1, 64) - result = strings.TrimSuffix(result, ".0") - return result + unit -} - -// ToMegabytes parses a string formatted by ByteSize as megabytes. -func ToMegabytes(s string) (uint64, error) { - bytes, err := ToBytes(s) - if err != nil { - return 0, err - } - - return bytes / MEGABYTE, nil -} - -// ToBytes parses a string formatted by ByteSize as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units -// KB = K = KiB = 1024 -// MB = M = MiB = 1024 * K -// GB = G = GiB = 1024 * M -// TB = T = TiB = 1024 * G -// PB = P = PiB = 1024 * T -// EB = E = EiB = 1024 * P -func ToBytes(s string) (uint64, error) { - s = strings.TrimSpace(s) - s = strings.ToUpper(s) - - i := strings.IndexFunc(s, unicode.IsLetter) - - if i == -1 { - return 0, invalidByteQuantityError - } - - bytesString, multiple := s[:i], s[i:] - bytes, err := strconv.ParseFloat(bytesString, 64) - if err != nil || bytes < 0 { - return 0, invalidByteQuantityError - } - - switch multiple { - case "E", "EB", "EIB": - return uint64(bytes * EXABYTE), nil - case "P", "PB", "PIB": - return uint64(bytes * PETABYTE), nil - case "T", "TB", "TIB": - return uint64(bytes * TERABYTE), nil - case "G", "GB", "GIB": - return uint64(bytes * GIGABYTE), nil - case "M", "MB", "MIB": - return uint64(bytes * MEGABYTE), nil - case "K", "KB", "KIB": - return uint64(bytes * KILOBYTE), nil - case "B": - return uint64(bytes), nil - default: - return 0, invalidByteQuantityError - } -} diff --git a/vendor/code.cloudfoundry.org/bytefmt/package.go b/vendor/code.cloudfoundry.org/bytefmt/package.go deleted file mode 100644 index 03429300..00000000 --- a/vendor/code.cloudfoundry.org/bytefmt/package.go +++ /dev/null @@ -1 +0,0 @@ -package bytefmt // import "code.cloudfoundry.org/bytefmt" diff --git a/vendor/github.com/Azure/go-autorest/LICENSE b/vendor/github.com/Azure/go-autorest/LICENSE deleted file mode 100644 index b9d6a27e..00000000 --- a/vendor/github.com/Azure/go-autorest/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md deleted file mode 100644 index 7b0c4bc4..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ /dev/null @@ -1,292 +0,0 @@ -# Azure Active Directory authentication for Go - -This is a standalone package for authenticating with Azure Active -Directory from other Go libraries and applications, in particular the [Azure SDK -for Go](https://github.com/Azure/azure-sdk-for-go). - -Note: Despite the package's name it is not related to other "ADAL" libraries -maintained in the [github.com/AzureAD](https://github.com/AzureAD) org. Issues -should be opened in [this repo's](https://github.com/Azure/go-autorest/issues) -or [the SDK's](https://github.com/Azure/azure-sdk-for-go/issues) issue -trackers. - -## Install - -```bash -go get -u github.com/Azure/go-autorest/autorest/adal -``` - -## Usage - -An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). - -### Register an Azure AD Application with secret - - -1. Register a new application with a `secret` credential - - ``` - az ad app create \ - --display-name example-app \ - --homepage https://example-app/home \ - --identifier-uris https://example-app/app \ - --password secret - ``` - -2. Create a service principal using the `Application ID` from previous step - - ``` - az ad sp create --id "Application ID" - ``` - - * Replace `Application ID` with `appId` from step 1. - -### Register an Azure AD Application with certificate - -1. Create a private key - - ``` - openssl genrsa -out "example-app.key" 2048 - ``` - -2. Create the certificate - - ``` - openssl req -new -key "example-app.key" -subj "/CN=example-app" -out "example-app.csr" - openssl x509 -req -in "example-app.csr" -signkey "example-app.key" -out "example-app.crt" -days 10000 - ``` - -3. Create the PKCS12 version of the certificate containing also the private key - - ``` - openssl pkcs12 -export -out "example-app.pfx" -inkey "example-app.key" -in "example-app.crt" -passout pass: - - ``` - -4. Register a new application with the certificate content form `example-app.crt` - - ``` - certificateContents="$(tail -n+2 "example-app.crt" | head -n-1)" - - az ad app create \ - --display-name example-app \ - --homepage https://example-app/home \ - --identifier-uris https://example-app/app \ - --key-usage Verify --end-date 2018-01-01 \ - --key-value "${certificateContents}" - ``` - -5. Create a service principal using the `Application ID` from previous step - - ``` - az ad sp create --id "APPLICATION_ID" - ``` - - * Replace `APPLICATION_ID` with `appId` from step 4. - - -### Grant the necessary permissions - -Azure relies on a Role-Based Access Control (RBAC) model to manage the access to resources at a fine-grained -level. There is a set of [pre-defined roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-built-in-roles) -which can be assigned to a service principal of an Azure AD application depending of your needs. - -``` -az role assignment create --assigner "SERVICE_PRINCIPAL_ID" --role "ROLE_NAME" -``` - -* Replace the `SERVICE_PRINCIPAL_ID` with the `appId` from previous step. -* Replace the `ROLE_NAME` with a role name of your choice. - -It is also possible to define custom role definitions. - -``` -az role definition create --role-definition role-definition.json -``` - -* Check [custom roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. - - -### Acquire Access Token - -The common configuration used by all flows: - -```Go -const activeDirectoryEndpoint = "https://login.microsoftonline.com/" -tenantID := "TENANT_ID" -oauthConfig, err := adal.NewOAuthConfig(activeDirectoryEndpoint, tenantID) - -applicationID := "APPLICATION_ID" - -callback := func(token adal.Token) error { - // This is called after the token is acquired -} - -// The resource for which the token is acquired -resource := "https://management.core.windows.net/" -``` - -* Replace the `TENANT_ID` with your tenant ID. -* Replace the `APPLICATION_ID` with the value from previous section. - -#### Client Credentials - -```Go -applicationSecret := "APPLICATION_SECRET" - -spt, err := adal.NewServicePrincipalToken( - oauthConfig, - appliationID, - applicationSecret, - resource, - callbacks...) -if err != nil { - return nil, err -} - -// Acquire a new access token -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -* Replace the `APPLICATION_SECRET` with the `password` value from previous section. - -#### Client Certificate - -```Go -certificatePath := "./example-app.pfx" - -certData, err := ioutil.ReadFile(certificatePath) -if err != nil { - return nil, fmt.Errorf("failed to read the certificate file (%s): %v", certificatePath, err) -} - -// Get the certificate and private key from pfx file -certificate, rsaPrivateKey, err := decodePkcs12(certData, "") -if err != nil { - return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err) -} - -spt, err := adal.NewServicePrincipalTokenFromCertificate( - oauthConfig, - applicationID, - certificate, - rsaPrivateKey, - resource, - callbacks...) - -// Acquire a new access token -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -* Update the certificate path to point to the example-app.pfx file which was created in previous section. - - -#### Device Code - -```Go -oauthClient := &http.Client{} - -// Acquire the device code -deviceCode, err := adal.InitiateDeviceAuth( - oauthClient, - oauthConfig, - applicationID, - resource) -if err != nil { - return nil, fmt.Errorf("Failed to start device auth flow: %s", err) -} - -// Display the authentication message -fmt.Println(*deviceCode.Message) - -// Wait here until the user is authenticated -token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) -if err != nil { - return nil, fmt.Errorf("Failed to finish device auth flow: %s", err) -} - -spt, err := adal.NewServicePrincipalTokenFromManualToken( - oauthConfig, - applicationID, - resource, - *token, - callbacks...) - -if (err == nil) { - token := spt.Token -} -``` - -#### Username password authenticate - -```Go -spt, err := adal.NewServicePrincipalTokenFromUsernamePassword( - oauthConfig, - applicationID, - username, - password, - resource, - callbacks...) - -if (err == nil) { - token := spt.Token -} -``` - -#### Authorization code authenticate - -``` Go -spt, err := adal.NewServicePrincipalTokenFromAuthorizationCode( - oauthConfig, - applicationID, - clientSecret, - authorizationCode, - redirectURI, - resource, - callbacks...) - -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -### Command Line Tool - -A command line tool is available in `cmd/adal.go` that can acquire a token for a given resource. It supports all flows mentioned above. - -``` -adal -h - -Usage of ./adal: - -applicationId string - application id - -certificatePath string - path to pk12/PFC application certificate - -mode string - authentication mode (device, secret, cert, refresh) (default "device") - -resource string - resource for which the token is requested - -secret string - application secret - -tenantId string - tenant id - -tokenCachePath string - location of oath token cache (default "/home/cgc/.adal/accessToken.json") -``` - -Example acquire a token for `https://management.core.windows.net/` using device code flow: - -``` -adal -mode device \ - -applicationId "APPLICATION_ID" \ - -tenantId "TENANT_ID" \ - -resource https://management.core.windows.net/ - -``` diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go deleted file mode 100644 index 8c83a917..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go +++ /dev/null @@ -1,91 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "net/url" -) - -// OAuthConfig represents the endpoints needed -// in OAuth operations -type OAuthConfig struct { - AuthorityEndpoint url.URL `json:"authorityEndpoint"` - AuthorizeEndpoint url.URL `json:"authorizeEndpoint"` - TokenEndpoint url.URL `json:"tokenEndpoint"` - DeviceCodeEndpoint url.URL `json:"deviceCodeEndpoint"` -} - -// IsZero returns true if the OAuthConfig object is zero-initialized. -func (oac OAuthConfig) IsZero() bool { - return oac == OAuthConfig{} -} - -func validateStringParam(param, name string) error { - if len(param) == 0 { - return fmt.Errorf("parameter '" + name + "' cannot be empty") - } - return nil -} - -// NewOAuthConfig returns an OAuthConfig with tenant specific urls -func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) { - apiVer := "1.0" - return NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID, &apiVer) -} - -// NewOAuthConfigWithAPIVersion returns an OAuthConfig with tenant specific urls. -// If apiVersion is not nil the "api-version" query parameter will be appended to the endpoint URLs with the specified value. -func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiVersion *string) (*OAuthConfig, error) { - if err := validateStringParam(activeDirectoryEndpoint, "activeDirectoryEndpoint"); err != nil { - return nil, err - } - api := "" - // it's legal for tenantID to be empty so don't validate it - if apiVersion != nil { - if err := validateStringParam(*apiVersion, "apiVersion"); err != nil { - return nil, err - } - api = fmt.Sprintf("?api-version=%s", *apiVersion) - } - const activeDirectoryEndpointTemplate = "%s/oauth2/%s%s" - u, err := url.Parse(activeDirectoryEndpoint) - if err != nil { - return nil, err - } - authorityURL, err := u.Parse(tenantID) - if err != nil { - return nil, err - } - authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", api)) - if err != nil { - return nil, err - } - tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", api)) - if err != nil { - return nil, err - } - deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", api)) - if err != nil { - return nil, err - } - - return &OAuthConfig{ - AuthorityEndpoint: *authorityURL, - AuthorizeEndpoint: *authorizeURL, - TokenEndpoint: *tokenURL, - DeviceCodeEndpoint: *deviceCodeURL, - }, nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go b/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go deleted file mode 100644 index b38f4c24..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go +++ /dev/null @@ -1,242 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - This file is largely based on rjw57/oauth2device's code, with the follow differences: - * scope -> resource, and only allow a single one - * receive "Message" in the DeviceCode struct and show it to users as the prompt - * azure-xplat-cli has the following behavior that this emulates: - - does not send client_secret during the token exchange - - sends resource again in the token exchange request -*/ - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" -) - -const ( - logPrefix = "autorest/adal/devicetoken:" -) - -var ( - // ErrDeviceGeneric represents an unknown error from the token endpoint when using device flow - ErrDeviceGeneric = fmt.Errorf("%s Error while retrieving OAuth token: Unknown Error", logPrefix) - - // ErrDeviceAccessDenied represents an access denied error from the token endpoint when using device flow - ErrDeviceAccessDenied = fmt.Errorf("%s Error while retrieving OAuth token: Access Denied", logPrefix) - - // ErrDeviceAuthorizationPending represents the server waiting on the user to complete the device flow - ErrDeviceAuthorizationPending = fmt.Errorf("%s Error while retrieving OAuth token: Authorization Pending", logPrefix) - - // ErrDeviceCodeExpired represents the server timing out and expiring the code during device flow - ErrDeviceCodeExpired = fmt.Errorf("%s Error while retrieving OAuth token: Code Expired", logPrefix) - - // ErrDeviceSlowDown represents the service telling us we're polling too often during device flow - ErrDeviceSlowDown = fmt.Errorf("%s Error while retrieving OAuth token: Slow Down", logPrefix) - - // ErrDeviceCodeEmpty represents an empty device code from the device endpoint while using device flow - ErrDeviceCodeEmpty = fmt.Errorf("%s Error while retrieving device code: Device Code Empty", logPrefix) - - // ErrOAuthTokenEmpty represents an empty OAuth token from the token endpoint when using device flow - ErrOAuthTokenEmpty = fmt.Errorf("%s Error while retrieving OAuth token: Token Empty", logPrefix) - - errCodeSendingFails = "Error occurred while sending request for Device Authorization Code" - errCodeHandlingFails = "Error occurred while handling response from the Device Endpoint" - errTokenSendingFails = "Error occurred while sending request with device code for a token" - errTokenHandlingFails = "Error occurred while handling response from the Token Endpoint (during device flow)" - errStatusNotOK = "Error HTTP status != 200" -) - -// DeviceCode is the object returned by the device auth endpoint -// It contains information to instruct the user to complete the auth flow -type DeviceCode struct { - DeviceCode *string `json:"device_code,omitempty"` - UserCode *string `json:"user_code,omitempty"` - VerificationURL *string `json:"verification_url,omitempty"` - ExpiresIn *int64 `json:"expires_in,string,omitempty"` - Interval *int64 `json:"interval,string,omitempty"` - - Message *string `json:"message"` // Azure specific - Resource string // store the following, stored when initiating, used when exchanging - OAuthConfig OAuthConfig - ClientID string -} - -// TokenError is the object returned by the token exchange endpoint -// when something is amiss -type TokenError struct { - Error *string `json:"error,omitempty"` - ErrorCodes []int `json:"error_codes,omitempty"` - ErrorDescription *string `json:"error_description,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - TraceID *string `json:"trace_id,omitempty"` -} - -// DeviceToken is the object return by the token exchange endpoint -// It can either look like a Token or an ErrorToken, so put both here -// and check for presence of "Error" to know if we are in error state -type deviceToken struct { - Token - TokenError -} - -// InitiateDeviceAuth initiates a device auth flow. It returns a DeviceCode -// that can be used with CheckForUserCompletion or WaitForUserCompletion. -func InitiateDeviceAuth(sender Sender, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) { - v := url.Values{ - "client_id": []string{clientID}, - "resource": []string{resource}, - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - - req, err := http.NewRequest(http.MethodPost, oauthConfig.DeviceCodeEndpoint.String(), body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error()) - } - - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - resp, err := sender.Do(req) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error()) - } - defer resp.Body.Close() - - rb, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error()) - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, errStatusNotOK) - } - - if len(strings.Trim(string(rb), " ")) == 0 { - return nil, ErrDeviceCodeEmpty - } - - var code DeviceCode - err = json.Unmarshal(rb, &code) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error()) - } - - code.ClientID = clientID - code.Resource = resource - code.OAuthConfig = oauthConfig - - return &code, nil -} - -// CheckForUserCompletion takes a DeviceCode and checks with the Azure AD OAuth endpoint -// to see if the device flow has: been completed, timed out, or otherwise failed -func CheckForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) { - v := url.Values{ - "client_id": []string{code.ClientID}, - "code": []string{*code.DeviceCode}, - "grant_type": []string{OAuthGrantTypeDeviceCode}, - "resource": []string{code.Resource}, - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - - req, err := http.NewRequest(http.MethodPost, code.OAuthConfig.TokenEndpoint.String(), body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error()) - } - - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - resp, err := sender.Do(req) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error()) - } - defer resp.Body.Close() - - rb, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error()) - } - - if resp.StatusCode != http.StatusOK && len(strings.Trim(string(rb), " ")) == 0 { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, errStatusNotOK) - } - if len(strings.Trim(string(rb), " ")) == 0 { - return nil, ErrOAuthTokenEmpty - } - - var token deviceToken - err = json.Unmarshal(rb, &token) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error()) - } - - if token.Error == nil { - return &token.Token, nil - } - - switch *token.Error { - case "authorization_pending": - return nil, ErrDeviceAuthorizationPending - case "slow_down": - return nil, ErrDeviceSlowDown - case "access_denied": - return nil, ErrDeviceAccessDenied - case "code_expired": - return nil, ErrDeviceCodeExpired - default: - return nil, ErrDeviceGeneric - } -} - -// WaitForUserCompletion calls CheckForUserCompletion repeatedly until a token is granted or an error state occurs. -// This prevents the user from looping and checking against 'ErrDeviceAuthorizationPending'. -func WaitForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) { - intervalDuration := time.Duration(*code.Interval) * time.Second - waitDuration := intervalDuration - - for { - token, err := CheckForUserCompletion(sender, code) - - if err == nil { - return token, nil - } - - switch err { - case ErrDeviceSlowDown: - waitDuration += waitDuration - case ErrDeviceAuthorizationPending: - // noop - default: // everything else is "fatal" to us - return nil, err - } - - if waitDuration > (intervalDuration * 3) { - return nil, fmt.Errorf("%s Error waiting for user to complete device flow. Server told us to slow_down too much", logPrefix) - } - - time.Sleep(waitDuration) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go b/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go deleted file mode 100644 index 9e15f275..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go +++ /dev/null @@ -1,73 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" -) - -// LoadToken restores a Token object from a file located at 'path'. -func LoadToken(path string) (*Token, error) { - file, err := os.Open(path) - if err != nil { - return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err) - } - defer file.Close() - - var token Token - - dec := json.NewDecoder(file) - if err = dec.Decode(&token); err != nil { - return nil, fmt.Errorf("failed to decode contents of file (%s) into Token representation: %v", path, err) - } - return &token, nil -} - -// SaveToken persists an oauth token at the given location on disk. -// It moves the new file into place so it can safely be used to replace an existing file -// that maybe accessed by multiple processes. -func SaveToken(path string, mode os.FileMode, token Token) error { - dir := filepath.Dir(path) - err := os.MkdirAll(dir, os.ModePerm) - if err != nil { - return fmt.Errorf("failed to create directory (%s) to store token in: %v", dir, err) - } - - newFile, err := ioutil.TempFile(dir, "token") - if err != nil { - return fmt.Errorf("failed to create the temp file to write the token: %v", err) - } - tempPath := newFile.Name() - - if err := json.NewEncoder(newFile).Encode(token); err != nil { - return fmt.Errorf("failed to encode token to file (%s) while saving token: %v", tempPath, err) - } - if err := newFile.Close(); err != nil { - return fmt.Errorf("failed to close temp file %s: %v", tempPath, err) - } - - // Atomic replace to avoid multi-writer file corruptions - if err := os.Rename(tempPath, path); err != nil { - return fmt.Errorf("failed to move temporary token to desired output location. src=%s dst=%s: %v", tempPath, path, err) - } - if err := os.Chmod(path, mode); err != nil { - return fmt.Errorf("failed to chmod the token file %s: %v", path, err) - } - return nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go deleted file mode 100644 index 834401e0..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go +++ /dev/null @@ -1,60 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "net/http" -) - -const ( - contentType = "Content-Type" - mimeTypeFormPost = "application/x-www-form-urlencoded" -) - -// Sender is the interface that wraps the Do method to send HTTP requests. -// -// The standard http.Client conforms to this interface. -type Sender interface { - Do(*http.Request) (*http.Response, error) -} - -// SenderFunc is a method that implements the Sender interface. -type SenderFunc func(*http.Request) (*http.Response, error) - -// Do implements the Sender interface on SenderFunc. -func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) { - return sf(r) -} - -// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then react to the -// http.Response result. -type SendDecorator func(Sender) Sender - -// CreateSender creates, decorates, and returns, as a Sender, the default http.Client. -func CreateSender(decorators ...SendDecorator) Sender { - return DecorateSender(&http.Client{}, decorators...) -} - -// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to -// the Sender. Decorators are applied in the order received, but their affect upon the request -// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a -// post-decorator (pass the http.Request along and react to the results in http.Response). -func DecorateSender(s Sender, decorators ...SendDecorator) Sender { - for _, decorate := range decorators { - s = decorate(s) - } - return s -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go deleted file mode 100644 index 2fd340d6..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ /dev/null @@ -1,980 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/x509" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "math" - "net" - "net/http" - "net/url" - "strings" - "sync" - "time" - - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/version" - "github.com/dgrijalva/jwt-go" -) - -const ( - defaultRefresh = 5 * time.Minute - - // OAuthGrantTypeDeviceCode is the "grant_type" identifier used in device flow - OAuthGrantTypeDeviceCode = "device_code" - - // OAuthGrantTypeClientCredentials is the "grant_type" identifier used in credential flows - OAuthGrantTypeClientCredentials = "client_credentials" - - // OAuthGrantTypeUserPass is the "grant_type" identifier used in username and password auth flows - OAuthGrantTypeUserPass = "password" - - // OAuthGrantTypeRefreshToken is the "grant_type" identifier used in refresh token flows - OAuthGrantTypeRefreshToken = "refresh_token" - - // OAuthGrantTypeAuthorizationCode is the "grant_type" identifier used in authorization code flows - OAuthGrantTypeAuthorizationCode = "authorization_code" - - // metadataHeader is the header required by MSI extension - metadataHeader = "Metadata" - - // msiEndpoint is the well known endpoint for getting MSI authentications tokens - msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" - - // the default number of attempts to refresh an MSI authentication token - defaultMaxMSIRefreshAttempts = 5 -) - -// OAuthTokenProvider is an interface which should be implemented by an access token retriever -type OAuthTokenProvider interface { - OAuthToken() string -} - -// TokenRefreshError is an interface used by errors returned during token refresh. -type TokenRefreshError interface { - error - Response() *http.Response -} - -// Refresher is an interface for token refresh functionality -type Refresher interface { - Refresh() error - RefreshExchange(resource string) error - EnsureFresh() error -} - -// RefresherWithContext is an interface for token refresh functionality -type RefresherWithContext interface { - RefreshWithContext(ctx context.Context) error - RefreshExchangeWithContext(ctx context.Context, resource string) error - EnsureFreshWithContext(ctx context.Context) error -} - -// TokenRefreshCallback is the type representing callbacks that will be called after -// a successful token refresh -type TokenRefreshCallback func(Token) error - -// Token encapsulates the access token used to authorize Azure requests. -// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response -type Token struct { - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - - ExpiresIn json.Number `json:"expires_in"` - ExpiresOn json.Number `json:"expires_on"` - NotBefore json.Number `json:"not_before"` - - Resource string `json:"resource"` - Type string `json:"token_type"` -} - -func newToken() Token { - return Token{ - ExpiresIn: "0", - ExpiresOn: "0", - NotBefore: "0", - } -} - -// IsZero returns true if the token object is zero-initialized. -func (t Token) IsZero() bool { - return t == Token{} -} - -// Expires returns the time.Time when the Token expires. -func (t Token) Expires() time.Time { - s, err := t.ExpiresOn.Float64() - if err != nil { - s = -3600 - } - - expiration := date.NewUnixTimeFromSeconds(s) - - return time.Time(expiration).UTC() -} - -// IsExpired returns true if the Token is expired, false otherwise. -func (t Token) IsExpired() bool { - return t.WillExpireIn(0) -} - -// WillExpireIn returns true if the Token will expire after the passed time.Duration interval -// from now, false otherwise. -func (t Token) WillExpireIn(d time.Duration) bool { - return !t.Expires().After(time.Now().Add(d)) -} - -//OAuthToken return the current access token -func (t *Token) OAuthToken() string { - return t.AccessToken -} - -// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form -// that is submitted when acquiring an oAuth token. -type ServicePrincipalSecret interface { - SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error -} - -// ServicePrincipalNoSecret represents a secret type that contains no secret -// meaning it is not valid for fetching a fresh token. This is used by Manual -type ServicePrincipalNoSecret struct { -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret -// It only returns an error for the ServicePrincipalNoSecret type -func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token") -} - -// MarshalJSON implements the json.Marshaler interface. -func (noSecret ServicePrincipalNoSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalNoSecret", - }) -} - -// ServicePrincipalTokenSecret implements ServicePrincipalSecret for client_secret type authorization. -type ServicePrincipalTokenSecret struct { - ClientSecret string `json:"value"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -// It will populate the form submitted during oAuth Token Acquisition using the client_secret. -func (tokenSecret *ServicePrincipalTokenSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("client_secret", tokenSecret.ClientSecret) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (tokenSecret ServicePrincipalTokenSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Value string `json:"value"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalTokenSecret", - Value: tokenSecret.ClientSecret, - }) -} - -// ServicePrincipalCertificateSecret implements ServicePrincipalSecret for generic RSA cert auth with signed JWTs. -type ServicePrincipalCertificateSecret struct { - Certificate *x509.Certificate - PrivateKey *rsa.PrivateKey -} - -// SignJwt returns the JWT signed with the certificate's private key. -func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalToken) (string, error) { - hasher := sha1.New() - _, err := hasher.Write(secret.Certificate.Raw) - if err != nil { - return "", err - } - - thumbprint := base64.URLEncoding.EncodeToString(hasher.Sum(nil)) - - // The jti (JWT ID) claim provides a unique identifier for the JWT. - jti := make([]byte, 20) - _, err = rand.Read(jti) - if err != nil { - return "", err - } - - token := jwt.New(jwt.SigningMethodRS256) - token.Header["x5t"] = thumbprint - x5c := []string{base64.StdEncoding.EncodeToString(secret.Certificate.Raw)} - token.Header["x5c"] = x5c - token.Claims = jwt.MapClaims{ - "aud": spt.inner.OauthConfig.TokenEndpoint.String(), - "iss": spt.inner.ClientID, - "sub": spt.inner.ClientID, - "jti": base64.URLEncoding.EncodeToString(jti), - "nbf": time.Now().Unix(), - "exp": time.Now().Add(time.Hour * 24).Unix(), - } - - signedString, err := token.SignedString(secret.PrivateKey) - return signedString, err -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -// It will populate the form submitted during oAuth Token Acquisition using a JWT signed with a certificate. -func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - jwt, err := secret.SignJwt(spt) - if err != nil { - return err - } - - v.Set("client_assertion", jwt) - v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) { - return nil, errors.New("marshalling ServicePrincipalCertificateSecret is not supported") -} - -// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension. -type ServicePrincipalMSISecret struct { -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (msiSecret ServicePrincipalMSISecret) MarshalJSON() ([]byte, error) { - return nil, errors.New("marshalling ServicePrincipalMSISecret is not supported") -} - -// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth. -type ServicePrincipalUsernamePasswordSecret struct { - Username string `json:"username"` - Password string `json:"password"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("username", secret.Username) - v.Set("password", secret.Password) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalUsernamePasswordSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Username string `json:"username"` - Password string `json:"password"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalUsernamePasswordSecret", - Username: secret.Username, - Password: secret.Password, - }) -} - -// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth. -type ServicePrincipalAuthorizationCodeSecret struct { - ClientSecret string `json:"value"` - AuthorizationCode string `json:"authCode"` - RedirectURI string `json:"redirect"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("code", secret.AuthorizationCode) - v.Set("client_secret", secret.ClientSecret) - v.Set("redirect_uri", secret.RedirectURI) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Value string `json:"value"` - AuthCode string `json:"authCode"` - Redirect string `json:"redirect"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalAuthorizationCodeSecret", - Value: secret.ClientSecret, - AuthCode: secret.AuthorizationCode, - Redirect: secret.RedirectURI, - }) -} - -// ServicePrincipalToken encapsulates a Token created for a Service Principal. -type ServicePrincipalToken struct { - inner servicePrincipalToken - refreshLock *sync.RWMutex - sender Sender - refreshCallbacks []TokenRefreshCallback - // MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token. - MaxMSIRefreshAttempts int -} - -// MarshalTokenJSON returns the marshalled inner token. -func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) { - return json.Marshal(spt.inner.Token) -} - -// SetRefreshCallbacks replaces any existing refresh callbacks with the specified callbacks. -func (spt *ServicePrincipalToken) SetRefreshCallbacks(callbacks []TokenRefreshCallback) { - spt.refreshCallbacks = callbacks -} - -// MarshalJSON implements the json.Marshaler interface. -func (spt ServicePrincipalToken) MarshalJSON() ([]byte, error) { - return json.Marshal(spt.inner) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error { - // need to determine the token type - raw := map[string]interface{}{} - err := json.Unmarshal(data, &raw) - if err != nil { - return err - } - secret := raw["secret"].(map[string]interface{}) - switch secret["type"] { - case "ServicePrincipalNoSecret": - spt.inner.Secret = &ServicePrincipalNoSecret{} - case "ServicePrincipalTokenSecret": - spt.inner.Secret = &ServicePrincipalTokenSecret{} - case "ServicePrincipalCertificateSecret": - return errors.New("unmarshalling ServicePrincipalCertificateSecret is not supported") - case "ServicePrincipalMSISecret": - return errors.New("unmarshalling ServicePrincipalMSISecret is not supported") - case "ServicePrincipalUsernamePasswordSecret": - spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{} - case "ServicePrincipalAuthorizationCodeSecret": - spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{} - default: - return fmt.Errorf("unrecognized token type '%s'", secret["type"]) - } - err = json.Unmarshal(data, &spt.inner) - if err != nil { - return err - } - spt.refreshLock = &sync.RWMutex{} - spt.sender = &http.Client{} - return nil -} - -// internal type used for marshalling/unmarshalling -type servicePrincipalToken struct { - Token Token `json:"token"` - Secret ServicePrincipalSecret `json:"secret"` - OauthConfig OAuthConfig `json:"oauth"` - ClientID string `json:"clientID"` - Resource string `json:"resource"` - AutoRefresh bool `json:"autoRefresh"` - RefreshWithin time.Duration `json:"refreshWithin"` -} - -func validateOAuthConfig(oac OAuthConfig) error { - if oac.IsZero() { - return fmt.Errorf("parameter 'oauthConfig' cannot be zero-initialized") - } - return nil -} - -// NewServicePrincipalTokenWithSecret create a ServicePrincipalToken using the supplied ServicePrincipalSecret implementation. -func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, resource string, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(id, "id"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if secret == nil { - return nil, fmt.Errorf("parameter 'secret' cannot be nil") - } - spt := &ServicePrincipalToken{ - inner: servicePrincipalToken{ - Token: newToken(), - OauthConfig: oauthConfig, - Secret: secret, - ClientID: id, - Resource: resource, - AutoRefresh: true, - RefreshWithin: defaultRefresh, - }, - refreshLock: &sync.RWMutex{}, - sender: &http.Client{}, - refreshCallbacks: callbacks, - } - return spt, nil -} - -// NewServicePrincipalTokenFromManualToken creates a ServicePrincipalToken using the supplied token -func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID string, resource string, token Token, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if token.IsZero() { - return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized") - } - spt, err := NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalNoSecret{}, - callbacks...) - if err != nil { - return nil, err - } - - spt.inner.Token = token - - return spt, nil -} - -// NewServicePrincipalTokenFromManualTokenSecret creates a ServicePrincipalToken using the supplied token and secret -func NewServicePrincipalTokenFromManualTokenSecret(oauthConfig OAuthConfig, clientID string, resource string, token Token, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if secret == nil { - return nil, fmt.Errorf("parameter 'secret' cannot be nil") - } - if token.IsZero() { - return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized") - } - spt, err := NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - secret, - callbacks...) - if err != nil { - return nil, err - } - - spt.inner.Token = token - - return spt, nil -} - -// NewServicePrincipalToken creates a ServicePrincipalToken from the supplied Service Principal -// credentials scoped to the named resource. -func NewServicePrincipalToken(oauthConfig OAuthConfig, clientID string, secret string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(secret, "secret"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalTokenSecret{ - ClientSecret: secret, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromCertificate creates a ServicePrincipalToken from the supplied pkcs12 bytes. -func NewServicePrincipalTokenFromCertificate(oauthConfig OAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if certificate == nil { - return nil, fmt.Errorf("parameter 'certificate' cannot be nil") - } - if privateKey == nil { - return nil, fmt.Errorf("parameter 'privateKey' cannot be nil") - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalCertificateSecret{ - PrivateKey: privateKey, - Certificate: certificate, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromUsernamePassword creates a ServicePrincipalToken from the username and password. -func NewServicePrincipalTokenFromUsernamePassword(oauthConfig OAuthConfig, clientID string, username string, password string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(username, "username"); err != nil { - return nil, err - } - if err := validateStringParam(password, "password"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalUsernamePasswordSecret{ - Username: username, - Password: password, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromAuthorizationCode creates a ServicePrincipalToken from the -func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clientID string, clientSecret string, authorizationCode string, redirectURI string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(clientSecret, "clientSecret"); err != nil { - return nil, err - } - if err := validateStringParam(authorizationCode, "authorizationCode"); err != nil { - return nil, err - } - if err := validateStringParam(redirectURI, "redirectURI"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalAuthorizationCodeSecret{ - ClientSecret: clientSecret, - AuthorizationCode: authorizationCode, - RedirectURI: redirectURI, - }, - callbacks..., - ) -} - -// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines. -func GetMSIVMEndpoint() (string, error) { - return msiEndpoint, nil -} - -// NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension. -// It will use the system assigned identity when creating the token. -func NewServicePrincipalTokenFromMSI(msiEndpoint, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, nil, callbacks...) -} - -// NewServicePrincipalTokenFromMSIWithUserAssignedID creates a ServicePrincipalToken via the MSI VM Extension. -// It will use the specified user assigned identity when creating the token. -func NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource string, userAssignedID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, &userAssignedID, callbacks...) -} - -func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedID *string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateStringParam(msiEndpoint, "msiEndpoint"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if userAssignedID != nil { - if err := validateStringParam(*userAssignedID, "userAssignedID"); err != nil { - return nil, err - } - } - // We set the oauth config token endpoint to be MSI's endpoint - msiEndpointURL, err := url.Parse(msiEndpoint) - if err != nil { - return nil, err - } - - v := url.Values{} - v.Set("resource", resource) - v.Set("api-version", "2018-02-01") - if userAssignedID != nil { - v.Set("client_id", *userAssignedID) - } - msiEndpointURL.RawQuery = v.Encode() - - spt := &ServicePrincipalToken{ - inner: servicePrincipalToken{ - Token: newToken(), - OauthConfig: OAuthConfig{ - TokenEndpoint: *msiEndpointURL, - }, - Secret: &ServicePrincipalMSISecret{}, - Resource: resource, - AutoRefresh: true, - RefreshWithin: defaultRefresh, - }, - refreshLock: &sync.RWMutex{}, - sender: &http.Client{}, - refreshCallbacks: callbacks, - MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts, - } - - if userAssignedID != nil { - spt.inner.ClientID = *userAssignedID - } - - return spt, nil -} - -// internal type that implements TokenRefreshError -type tokenRefreshError struct { - message string - resp *http.Response -} - -// Error implements the error interface which is part of the TokenRefreshError interface. -func (tre tokenRefreshError) Error() string { - return tre.message -} - -// Response implements the TokenRefreshError interface, it returns the raw HTTP response from the refresh operation. -func (tre tokenRefreshError) Response() *http.Response { - return tre.resp -} - -func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError { - return tokenRefreshError{message: message, resp: resp} -} - -// EnsureFresh will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (spt *ServicePrincipalToken) EnsureFresh() error { - return spt.EnsureFreshWithContext(context.Background()) -} - -// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (spt *ServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { - if spt.inner.AutoRefresh && spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) { - // take the write lock then check to see if the token was already refreshed - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - if spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) { - return spt.refreshInternal(ctx, spt.inner.Resource) - } - } - return nil -} - -// InvokeRefreshCallbacks calls any TokenRefreshCallbacks that were added to the SPT during initialization -func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error { - if spt.refreshCallbacks != nil { - for _, callback := range spt.refreshCallbacks { - err := callback(spt.inner.Token) - if err != nil { - return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err) - } - } - } - return nil -} - -// Refresh obtains a fresh token for the Service Principal. -// This method is not safe for concurrent use and should be syncrhonized. -func (spt *ServicePrincipalToken) Refresh() error { - return spt.RefreshWithContext(context.Background()) -} - -// RefreshWithContext obtains a fresh token for the Service Principal. -// This method is not safe for concurrent use and should be syncrhonized. -func (spt *ServicePrincipalToken) RefreshWithContext(ctx context.Context) error { - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - return spt.refreshInternal(ctx, spt.inner.Resource) -} - -// RefreshExchange refreshes the token, but for a different resource. -// This method is not safe for concurrent use and should be syncrhonized. -func (spt *ServicePrincipalToken) RefreshExchange(resource string) error { - return spt.RefreshExchangeWithContext(context.Background(), resource) -} - -// RefreshExchangeWithContext refreshes the token, but for a different resource. -// This method is not safe for concurrent use and should be syncrhonized. -func (spt *ServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - return spt.refreshInternal(ctx, resource) -} - -func (spt *ServicePrincipalToken) getGrantType() string { - switch spt.inner.Secret.(type) { - case *ServicePrincipalUsernamePasswordSecret: - return OAuthGrantTypeUserPass - case *ServicePrincipalAuthorizationCodeSecret: - return OAuthGrantTypeAuthorizationCode - default: - return OAuthGrantTypeClientCredentials - } -} - -func isIMDS(u url.URL) bool { - imds, err := url.Parse(msiEndpoint) - if err != nil { - return false - } - return u.Host == imds.Host && u.Path == imds.Path -} - -func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error { - req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil) - if err != nil { - return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err) - } - req.Header.Add("User-Agent", version.UserAgent()) - req = req.WithContext(ctx) - if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) { - v := url.Values{} - v.Set("client_id", spt.inner.ClientID) - v.Set("resource", resource) - - if spt.inner.Token.RefreshToken != "" { - v.Set("grant_type", OAuthGrantTypeRefreshToken) - v.Set("refresh_token", spt.inner.Token.RefreshToken) - // web apps must specify client_secret when refreshing tokens - // see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#refreshing-the-access-tokens - if spt.getGrantType() == OAuthGrantTypeAuthorizationCode { - err := spt.inner.Secret.SetAuthenticationValues(spt, &v) - if err != nil { - return err - } - } - } else { - v.Set("grant_type", spt.getGrantType()) - err := spt.inner.Secret.SetAuthenticationValues(spt, &v) - if err != nil { - return err - } - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - req.Body = body - } - - if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok { - req.Method = http.MethodGet - req.Header.Set(metadataHeader, "true") - } - - var resp *http.Response - if isIMDS(spt.inner.OauthConfig.TokenEndpoint) { - resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts) - } else { - resp, err = spt.sender.Do(req) - } - if err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: Failed to execute the refresh request. Error = '%v'", err), nil) - } - - defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) - - if resp.StatusCode != http.StatusOK { - if err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v", resp.StatusCode, err), resp) - } - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s", resp.StatusCode, string(rb)), resp) - } - - // for the following error cases don't return a TokenRefreshError. the operation succeeded - // but some transient failure happened during deserialization. by returning a generic error - // the retry logic will kick in (we don't retry on TokenRefreshError). - - if err != nil { - return fmt.Errorf("adal: Failed to read a new service principal token during refresh. Error = '%v'", err) - } - if len(strings.Trim(string(rb), " ")) == 0 { - return fmt.Errorf("adal: Empty service principal token received during refresh") - } - var token Token - err = json.Unmarshal(rb, &token) - if err != nil { - return fmt.Errorf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)) - } - - spt.inner.Token = token - - return spt.InvokeRefreshCallbacks(token) -} - -// retry logic specific to retrieving a token from the IMDS endpoint -func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) { - // copied from client.go due to circular dependency - retries := []int{ - http.StatusRequestTimeout, // 408 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - } - // extra retry status codes specific to IMDS - retries = append(retries, - http.StatusNotFound, - http.StatusGone, - // all remaining 5xx - http.StatusNotImplemented, - http.StatusHTTPVersionNotSupported, - http.StatusVariantAlsoNegotiates, - http.StatusInsufficientStorage, - http.StatusLoopDetected, - http.StatusNotExtended, - http.StatusNetworkAuthenticationRequired) - - // see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance - - const maxDelay time.Duration = 60 * time.Second - - attempt := 0 - delay := time.Duration(0) - - for attempt < maxAttempts { - resp, err = sender.Do(req) - // retry on temporary network errors, e.g. transient network failures. - // if we don't receive a response then assume we can't connect to the - // endpoint so we're likely not running on an Azure VM so don't retry. - if (err != nil && !isTemporaryNetworkError(err)) || resp == nil || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) { - return - } - - // perform exponential backoff with a cap. - // must increment attempt before calculating delay. - attempt++ - // the base value of 2 is the "delta backoff" as specified in the guidance doc - delay += (time.Duration(math.Pow(2, float64(attempt))) * time.Second) - if delay > maxDelay { - delay = maxDelay - } - - select { - case <-time.After(delay): - // intentionally left blank - case <-req.Context().Done(): - err = req.Context().Err() - return - } - } - return -} - -// returns true if the specified error is a temporary network error or false if it's not. -// if the error doesn't implement the net.Error interface the return value is true. -func isTemporaryNetworkError(err error) bool { - if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) { - return true - } - return false -} - -// returns true if slice ints contains the value n -func containsInt(ints []int, n int) bool { - for _, i := range ints { - if i == n { - return true - } - } - return false -} - -// SetAutoRefresh enables or disables automatic refreshing of stale tokens. -func (spt *ServicePrincipalToken) SetAutoRefresh(autoRefresh bool) { - spt.inner.AutoRefresh = autoRefresh -} - -// SetRefreshWithin sets the interval within which if the token will expire, EnsureFresh will -// refresh the token. -func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) { - spt.inner.RefreshWithin = d - return -} - -// SetSender sets the http.Client used when obtaining the Service Principal token. An -// undecorated http.Client is used by default. -func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s } - -// OAuthToken implements the OAuthTokenProvider interface. It returns the current access token. -func (spt *ServicePrincipalToken) OAuthToken() string { - spt.refreshLock.RLock() - defer spt.refreshLock.RUnlock() - return spt.inner.Token.OAuthToken() -} - -// Token returns a copy of the current token. -func (spt *ServicePrincipalToken) Token() Token { - spt.refreshLock.RLock() - defer spt.refreshLock.RUnlock() - return spt.inner.Token -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go deleted file mode 100644 index 77eff45b..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ /dev/null @@ -1,259 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "net/http" - "net/url" - "strings" - - "github.com/Azure/go-autorest/autorest/adal" -) - -const ( - bearerChallengeHeader = "Www-Authenticate" - bearer = "Bearer" - tenantID = "tenantID" - apiKeyAuthorizerHeader = "Ocp-Apim-Subscription-Key" - bingAPISdkHeader = "X-BingApis-SDK-Client" - golangBingAPISdkHeaderValue = "Go-SDK" -) - -// Authorizer is the interface that provides a PrepareDecorator used to supply request -// authorization. Most often, the Authorizer decorator runs last so it has access to the full -// state of the formed HTTP request. -type Authorizer interface { - WithAuthorization() PrepareDecorator -} - -// NullAuthorizer implements a default, "do nothing" Authorizer. -type NullAuthorizer struct{} - -// WithAuthorization returns a PrepareDecorator that does nothing. -func (na NullAuthorizer) WithAuthorization() PrepareDecorator { - return WithNothing() -} - -// APIKeyAuthorizer implements API Key authorization. -type APIKeyAuthorizer struct { - headers map[string]interface{} - queryParameters map[string]interface{} -} - -// NewAPIKeyAuthorizerWithHeaders creates an ApiKeyAuthorizer with headers. -func NewAPIKeyAuthorizerWithHeaders(headers map[string]interface{}) *APIKeyAuthorizer { - return NewAPIKeyAuthorizer(headers, nil) -} - -// NewAPIKeyAuthorizerWithQueryParameters creates an ApiKeyAuthorizer with query parameters. -func NewAPIKeyAuthorizerWithQueryParameters(queryParameters map[string]interface{}) *APIKeyAuthorizer { - return NewAPIKeyAuthorizer(nil, queryParameters) -} - -// NewAPIKeyAuthorizer creates an ApiKeyAuthorizer with headers. -func NewAPIKeyAuthorizer(headers map[string]interface{}, queryParameters map[string]interface{}) *APIKeyAuthorizer { - return &APIKeyAuthorizer{headers: headers, queryParameters: queryParameters} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Paramaters -func (aka *APIKeyAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return DecoratePreparer(p, WithHeaders(aka.headers), WithQueryParameters(aka.queryParameters)) - } -} - -// CognitiveServicesAuthorizer implements authorization for Cognitive Services. -type CognitiveServicesAuthorizer struct { - subscriptionKey string -} - -// NewCognitiveServicesAuthorizer is -func NewCognitiveServicesAuthorizer(subscriptionKey string) *CognitiveServicesAuthorizer { - return &CognitiveServicesAuthorizer{subscriptionKey: subscriptionKey} -} - -// WithAuthorization is -func (csa *CognitiveServicesAuthorizer) WithAuthorization() PrepareDecorator { - headers := make(map[string]interface{}) - headers[apiKeyAuthorizerHeader] = csa.subscriptionKey - headers[bingAPISdkHeader] = golangBingAPISdkHeaderValue - - return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() -} - -// BearerAuthorizer implements the bearer authorization -type BearerAuthorizer struct { - tokenProvider adal.OAuthTokenProvider -} - -// NewBearerAuthorizer crates a BearerAuthorizer using the given token provider -func NewBearerAuthorizer(tp adal.OAuthTokenProvider) *BearerAuthorizer { - return &BearerAuthorizer{tokenProvider: tp} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is "Bearer " followed by the token. -// -// By default, the token will be automatically refreshed through the Refresher interface. -func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - // the ordering is important here, prefer RefresherWithContext if available - if refresher, ok := ba.tokenProvider.(adal.RefresherWithContext); ok { - err = refresher.EnsureFreshWithContext(r.Context()) - } else if refresher, ok := ba.tokenProvider.(adal.Refresher); ok { - err = refresher.EnsureFresh() - } - if err != nil { - var resp *http.Response - if tokError, ok := err.(adal.TokenRefreshError); ok { - resp = tokError.Response() - } - return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp, - "Failed to refresh the Token for request to %s", r.URL) - } - return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken()))) - } - return r, err - }) - } -} - -// BearerAuthorizerCallbackFunc is the authentication callback signature. -type BearerAuthorizerCallbackFunc func(tenantID, resource string) (*BearerAuthorizer, error) - -// BearerAuthorizerCallback implements bearer authorization via a callback. -type BearerAuthorizerCallback struct { - sender Sender - callback BearerAuthorizerCallbackFunc -} - -// NewBearerAuthorizerCallback creates a bearer authorization callback. The callback -// is invoked when the HTTP request is submitted. -func NewBearerAuthorizerCallback(sender Sender, callback BearerAuthorizerCallbackFunc) *BearerAuthorizerCallback { - if sender == nil { - sender = &http.Client{} - } - return &BearerAuthorizerCallback{sender: sender, callback: callback} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose value -// is "Bearer " followed by the token. The BearerAuthorizer is obtained via a user-supplied callback. -// -// By default, the token will be automatically refreshed through the Refresher interface. -func (bacb *BearerAuthorizerCallback) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - // make a copy of the request and remove the body as it's not - // required and avoids us having to create a copy of it. - rCopy := *r - removeRequestBody(&rCopy) - - resp, err := bacb.sender.Do(&rCopy) - if err == nil && resp.StatusCode == 401 { - defer resp.Body.Close() - if hasBearerChallenge(resp) { - bc, err := newBearerChallenge(resp) - if err != nil { - return r, err - } - if bacb.callback != nil { - ba, err := bacb.callback(bc.values[tenantID], bc.values["resource"]) - if err != nil { - return r, err - } - return Prepare(r, ba.WithAuthorization()) - } - } - } - } - return r, err - }) - } -} - -// returns true if the HTTP response contains a bearer challenge -func hasBearerChallenge(resp *http.Response) bool { - authHeader := resp.Header.Get(bearerChallengeHeader) - if len(authHeader) == 0 || strings.Index(authHeader, bearer) < 0 { - return false - } - return true -} - -type bearerChallenge struct { - values map[string]string -} - -func newBearerChallenge(resp *http.Response) (bc bearerChallenge, err error) { - challenge := strings.TrimSpace(resp.Header.Get(bearerChallengeHeader)) - trimmedChallenge := challenge[len(bearer)+1:] - - // challenge is a set of key=value pairs that are comma delimited - pairs := strings.Split(trimmedChallenge, ",") - if len(pairs) < 1 { - err = fmt.Errorf("challenge '%s' contains no pairs", challenge) - return bc, err - } - - bc.values = make(map[string]string) - for i := range pairs { - trimmedPair := strings.TrimSpace(pairs[i]) - pair := strings.Split(trimmedPair, "=") - if len(pair) == 2 { - // remove the enclosing quotes - key := strings.Trim(pair[0], "\"") - value := strings.Trim(pair[1], "\"") - - switch key { - case "authorization", "authorization_uri": - // strip the tenant ID from the authorization URL - asURL, err := url.Parse(value) - if err != nil { - return bc, err - } - bc.values[tenantID] = asURL.Path[1:] - default: - bc.values[key] = value - } - } - } - - return bc, err -} - -// EventGridKeyAuthorizer implements authorization for event grid using key authentication. -type EventGridKeyAuthorizer struct { - topicKey string -} - -// NewEventGridKeyAuthorizer creates a new EventGridKeyAuthorizer -// with the specified topic key. -func NewEventGridKeyAuthorizer(topicKey string) EventGridKeyAuthorizer { - return EventGridKeyAuthorizer{topicKey: topicKey} -} - -// WithAuthorization returns a PrepareDecorator that adds the aeg-sas-key authentication header. -func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator { - headers := map[string]interface{}{ - "aeg-sas-key": egta.topicKey, - } - return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/autorest.go b/vendor/github.com/Azure/go-autorest/autorest/autorest.go deleted file mode 100644 index aafdf021..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/autorest.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Package autorest implements an HTTP request pipeline suitable for use across multiple go-routines -and provides the shared routines relied on by AutoRest (see https://github.com/Azure/autorest/) -generated Go code. - -The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending, -and Responding. A typical pattern is: - - req, err := Prepare(&http.Request{}, - token.WithAuthorization()) - - resp, err := Send(req, - WithLogging(logger), - DoErrorIfStatusCode(http.StatusInternalServerError), - DoCloseIfError(), - DoRetryForAttempts(5, time.Second)) - - err = Respond(resp, - ByDiscardingBody(), - ByClosing()) - -Each phase relies on decorators to modify and / or manage processing. Decorators may first modify -and then pass the data along, pass the data first and then modify the result, or wrap themselves -around passing the data (such as a logger might do). Decorators run in the order provided. For -example, the following: - - req, err := Prepare(&http.Request{}, - WithBaseURL("https://microsoft.com/"), - WithPath("a"), - WithPath("b"), - WithPath("c")) - -will set the URL to: - - https://microsoft.com/a/b/c - -Preparers and Responders may be shared and re-used (assuming the underlying decorators support -sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders -shared among multiple go-routines, and a single Sender shared among multiple sending go-routines, -all bound together by means of input / output channels. - -Decorators hold their passed state within a closure (such as the path components in the example -above). Be careful to share Preparers and Responders only in a context where such held state -applies. For example, it may not make sense to share a Preparer that applies a query string from a -fixed set of values. Similarly, sharing a Responder that reads the response body into a passed -struct (e.g., ByUnmarshallingJson) is likely incorrect. - -Lastly, the Swagger specification (https://swagger.io) that drives AutoRest -(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The -github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure -correct parsing and formatting. - -Errors raised by autorest objects and methods will conform to the autorest.Error interface. - -See the included examples for more detail. For details on the suggested use of this package by -generated clients, see the Client described below. -*/ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "net/http" - "time" -) - -const ( - // HeaderLocation specifies the HTTP Location header. - HeaderLocation = "Location" - - // HeaderRetryAfter specifies the HTTP Retry-After header. - HeaderRetryAfter = "Retry-After" -) - -// ResponseHasStatusCode returns true if the status code in the HTTP Response is in the passed set -// and false otherwise. -func ResponseHasStatusCode(resp *http.Response, codes ...int) bool { - if resp == nil { - return false - } - return containsInt(codes, resp.StatusCode) -} - -// GetLocation retrieves the URL from the Location header of the passed response. -func GetLocation(resp *http.Response) string { - return resp.Header.Get(HeaderLocation) -} - -// GetRetryAfter extracts the retry delay from the Retry-After header of the passed response. If -// the header is absent or is malformed, it will return the supplied default delay time.Duration. -func GetRetryAfter(resp *http.Response, defaultDelay time.Duration) time.Duration { - retry := resp.Header.Get(HeaderRetryAfter) - if retry == "" { - return defaultDelay - } - - d, err := time.ParseDuration(retry + "s") - if err != nil { - return defaultDelay - } - - return d -} - -// NewPollingRequest allocates and returns a new http.Request to poll for the passed response. -func NewPollingRequest(resp *http.Response, cancel <-chan struct{}) (*http.Request, error) { - location := GetLocation(resp) - if location == "" { - return nil, NewErrorWithResponse("autorest", "NewPollingRequest", resp, "Location header missing from response that requires polling") - } - - req, err := Prepare(&http.Request{Cancel: cancel}, - AsGet(), - WithBaseURL(location)) - if err != nil { - return nil, NewErrorWithError(err, "autorest", "NewPollingRequest", nil, "Failure creating poll request to %s", location) - } - - return req, nil -} - -// NewPollingRequestWithContext allocates and returns a new http.Request with the specified context to poll for the passed response. -func NewPollingRequestWithContext(ctx context.Context, resp *http.Response) (*http.Request, error) { - location := GetLocation(resp) - if location == "" { - return nil, NewErrorWithResponse("autorest", "NewPollingRequestWithContext", resp, "Location header missing from response that requires polling") - } - - req, err := Prepare((&http.Request{}).WithContext(ctx), - AsGet(), - WithBaseURL(location)) - if err != nil { - return nil, NewErrorWithError(err, "autorest", "NewPollingRequestWithContext", nil, "Failure creating poll request to %s", location) - } - - return req, nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go deleted file mode 100644 index 60679c1a..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ /dev/null @@ -1,972 +0,0 @@ -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" - - "github.com/Azure/go-autorest/autorest" -) - -const ( - headerAsyncOperation = "Azure-AsyncOperation" -) - -const ( - operationInProgress string = "InProgress" - operationCanceled string = "Canceled" - operationFailed string = "Failed" - operationSucceeded string = "Succeeded" -) - -var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.StatusCreated, http.StatusOK} - -// Future provides a mechanism to access the status and results of an asynchronous request. -// Since futures are stateful they should be passed by value to avoid race conditions. -type Future struct { - req *http.Request // legacy - pt pollingTracker -} - -// NewFuture returns a new Future object initialized with the specified request. -// Deprecated: Please use NewFutureFromResponse instead. -func NewFuture(req *http.Request) Future { - return Future{req: req} -} - -// NewFutureFromResponse returns a new Future object initialized -// with the initial response from an asynchronous operation. -func NewFutureFromResponse(resp *http.Response) (Future, error) { - pt, err := createPollingTracker(resp) - return Future{pt: pt}, err -} - -// Response returns the last HTTP response. -func (f Future) Response() *http.Response { - if f.pt == nil { - return nil - } - return f.pt.latestResponse() -} - -// Status returns the last status message of the operation. -func (f Future) Status() string { - if f.pt == nil { - return "" - } - return f.pt.pollingStatus() -} - -// PollingMethod returns the method used to monitor the status of the asynchronous operation. -func (f Future) PollingMethod() PollingMethodType { - if f.pt == nil { - return PollingUnknown - } - return f.pt.pollingMethod() -} - -// Done queries the service to see if the operation has completed. -// Deprecated: Use DoneWithContext() -func (f *Future) Done(sender autorest.Sender) (bool, error) { - return f.DoneWithContext(context.Background(), sender) -} - -// DoneWithContext queries the service to see if the operation has completed. -func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) { - // support for legacy Future implementation - if f.req != nil { - resp, err := sender.Do(f.req) - if err != nil { - return false, err - } - pt, err := createPollingTracker(resp) - if err != nil { - return false, err - } - f.pt = pt - f.req = nil - } - // end legacy - if f.pt == nil { - return false, autorest.NewError("Future", "Done", "future is not initialized") - } - if f.pt.hasTerminated() { - return true, f.pt.pollingError() - } - if err := f.pt.pollForStatus(ctx, sender); err != nil { - return false, err - } - if err := f.pt.checkForErrors(); err != nil { - return f.pt.hasTerminated(), err - } - if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil { - return false, err - } - if err := f.pt.initPollingMethod(); err != nil { - return false, err - } - if err := f.pt.updatePollingMethod(); err != nil { - return false, err - } - return f.pt.hasTerminated(), f.pt.pollingError() -} - -// GetPollingDelay returns a duration the application should wait before checking -// the status of the asynchronous request and true; this value is returned from -// the service via the Retry-After response header. If the header wasn't returned -// then the function returns the zero-value time.Duration and false. -func (f Future) GetPollingDelay() (time.Duration, bool) { - if f.pt == nil { - return 0, false - } - resp := f.pt.latestResponse() - if resp == nil { - return 0, false - } - - retry := resp.Header.Get(autorest.HeaderRetryAfter) - if retry == "" { - return 0, false - } - - d, err := time.ParseDuration(retry + "s") - if err != nil { - panic(err) - } - - return d, true -} - -// WaitForCompletion will return when one of the following conditions is met: the long -// running operation has completed, the provided context is cancelled, or the client's -// polling duration has been exceeded. It will retry failed polling attempts based on -// the retry value defined in the client up to the maximum retry attempts. -// Deprecated: Please use WaitForCompletionRef() instead. -func (f Future) WaitForCompletion(ctx context.Context, client autorest.Client) error { - return f.WaitForCompletionRef(ctx, client) -} - -// WaitForCompletionRef will return when one of the following conditions is met: the long -// running operation has completed, the provided context is cancelled, or the client's -// polling duration has been exceeded. It will retry failed polling attempts based on -// the retry value defined in the client up to the maximum retry attempts. -// If no deadline is specified in the context then the client.PollingDuration will be -// used to determine if a default deadline should be used. -// If PollingDuration is greater than zero the value will be used as the context's timeout. -// If PollingDuration is zero then no default deadline will be used. -func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) (err error) { - cancelCtx := ctx - // if the provided context already has a deadline don't override it - _, hasDeadline := ctx.Deadline() - if d := client.PollingDuration; !hasDeadline && d != 0 { - var cancel context.CancelFunc - cancelCtx, cancel = context.WithTimeout(ctx, d) - defer cancel() - } - - done, err := f.DoneWithContext(ctx, client) - for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) { - if attempts >= client.RetryAttempts { - return autorest.NewErrorWithError(err, "Future", "WaitForCompletion", f.pt.latestResponse(), "the number of retries has been exceeded") - } - // we want delayAttempt to be zero in the non-error case so - // that DelayForBackoff doesn't perform exponential back-off - var delayAttempt int - var delay time.Duration - if err == nil { - // check for Retry-After delay, if not present use the client's polling delay - var ok bool - delay, ok = f.GetPollingDelay() - if !ok { - delay = client.PollingDelay - } - } else { - // there was an error polling for status so perform exponential - // back-off based on the number of attempts using the client's retry - // duration. update attempts after delayAttempt to avoid off-by-one. - delayAttempt = attempts - delay = client.RetryDuration - attempts++ - } - // wait until the delay elapses or the context is cancelled - delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, cancelCtx.Done()) - if !delayElapsed { - return autorest.NewErrorWithError(cancelCtx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled") - } - } - return -} - -// MarshalJSON implements the json.Marshaler interface. -func (f Future) MarshalJSON() ([]byte, error) { - return json.Marshal(f.pt) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (f *Future) UnmarshalJSON(data []byte) error { - // unmarshal into JSON object to determine the tracker type - obj := map[string]interface{}{} - err := json.Unmarshal(data, &obj) - if err != nil { - return err - } - if obj["method"] == nil { - return autorest.NewError("Future", "UnmarshalJSON", "missing 'method' property") - } - method := obj["method"].(string) - switch strings.ToUpper(method) { - case http.MethodDelete: - f.pt = &pollingTrackerDelete{} - case http.MethodPatch: - f.pt = &pollingTrackerPatch{} - case http.MethodPost: - f.pt = &pollingTrackerPost{} - case http.MethodPut: - f.pt = &pollingTrackerPut{} - default: - return autorest.NewError("Future", "UnmarshalJSON", "unsupoorted method '%s'", method) - } - // now unmarshal into the tracker - return json.Unmarshal(data, &f.pt) -} - -// PollingURL returns the URL used for retrieving the status of the long-running operation. -func (f Future) PollingURL() string { - if f.pt == nil { - return "" - } - return f.pt.pollingURL() -} - -// GetResult should be called once polling has completed successfully. -// It makes the final GET call to retrieve the resultant payload. -func (f Future) GetResult(sender autorest.Sender) (*http.Response, error) { - if f.pt.finalGetURL() == "" { - // we can end up in this situation if the async operation returns a 200 - // with no polling URLs. in that case return the response which should - // contain the JSON payload (only do this for successful terminal cases). - if lr := f.pt.latestResponse(); lr != nil && f.pt.hasSucceeded() { - return lr, nil - } - return nil, autorest.NewError("Future", "GetResult", "missing URL for retrieving result") - } - req, err := http.NewRequest(http.MethodGet, f.pt.finalGetURL(), nil) - if err != nil { - return nil, err - } - return sender.Do(req) -} - -type pollingTracker interface { - // these methods can differ per tracker - - // checks the response headers and status code to determine the polling mechanism - updatePollingMethod() error - - // checks the response for tracker-specific error conditions - checkForErrors() error - - // returns true if provisioning state should be checked - provisioningStateApplicable() bool - - // methods common to all trackers - - // initializes a tracker's polling URL and method, called for each iteration. - // these values can be overridden by each polling tracker as required. - initPollingMethod() error - - // initializes the tracker's internal state, call this when the tracker is created - initializeState() error - - // makes an HTTP request to check the status of the LRO - pollForStatus(ctx context.Context, sender autorest.Sender) error - - // updates internal tracker state, call this after each call to pollForStatus - updatePollingState(provStateApl bool) error - - // returns the error response from the service, can be nil - pollingError() error - - // returns the polling method being used - pollingMethod() PollingMethodType - - // returns the state of the LRO as returned from the service - pollingStatus() string - - // returns the URL used for polling status - pollingURL() string - - // returns the URL used for the final GET to retrieve the resource - finalGetURL() string - - // returns true if the LRO is in a terminal state - hasTerminated() bool - - // returns true if the LRO is in a failed terminal state - hasFailed() bool - - // returns true if the LRO is in a successful terminal state - hasSucceeded() bool - - // returns the cached HTTP response after a call to pollForStatus(), can be nil - latestResponse() *http.Response -} - -type pollingTrackerBase struct { - // resp is the last response, either from the submission of the LRO or from polling - resp *http.Response - - // method is the HTTP verb, this is needed for deserialization - Method string `json:"method"` - - // rawBody is the raw JSON response body - rawBody map[string]interface{} - - // denotes if polling is using async-operation or location header - Pm PollingMethodType `json:"pollingMethod"` - - // the URL to poll for status - URI string `json:"pollingURI"` - - // the state of the LRO as returned from the service - State string `json:"lroState"` - - // the URL to GET for the final result - FinalGetURI string `json:"resultURI"` - - // used to hold an error object returned from the service - Err *ServiceError `json:"error,omitempty"` -} - -func (pt *pollingTrackerBase) initializeState() error { - // determine the initial polling state based on response body and/or HTTP status - // code. this is applicable to the initial LRO response, not polling responses! - pt.Method = pt.resp.Request.Method - if err := pt.updateRawBody(); err != nil { - return err - } - switch pt.resp.StatusCode { - case http.StatusOK: - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - if pt.hasFailed() { - pt.updateErrorFromResponse() - return pt.pollingError() - } - } else { - pt.State = operationSucceeded - } - case http.StatusCreated: - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - } else { - pt.State = operationInProgress - } - case http.StatusAccepted: - pt.State = operationInProgress - case http.StatusNoContent: - pt.State = operationSucceeded - default: - pt.State = operationFailed - pt.updateErrorFromResponse() - return pt.pollingError() - } - return pt.initPollingMethod() -} - -func (pt pollingTrackerBase) getProvisioningState() *string { - if pt.rawBody != nil && pt.rawBody["properties"] != nil { - p := pt.rawBody["properties"].(map[string]interface{}) - if ps := p["provisioningState"]; ps != nil { - s := ps.(string) - return &s - } - } - return nil -} - -func (pt *pollingTrackerBase) updateRawBody() error { - pt.rawBody = map[string]interface{}{} - if pt.resp.ContentLength != 0 { - defer pt.resp.Body.Close() - b, err := ioutil.ReadAll(pt.resp.Body) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to read response body") - } - // observed in 204 responses over HTTP/2.0; the content length is -1 but body is empty - if len(b) == 0 { - return nil - } - // put the body back so it's available to other callers - pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - if err = json.Unmarshal(b, &pt.rawBody); err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to unmarshal response body") - } - } - return nil -} - -func (pt *pollingTrackerBase) pollForStatus(ctx context.Context, sender autorest.Sender) error { - req, err := http.NewRequest(http.MethodGet, pt.URI, nil) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to create HTTP request") - } - - req = req.WithContext(ctx) - pt.resp, err = sender.Do(req) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to send HTTP request") - } - if autorest.ResponseHasStatusCode(pt.resp, pollingCodes[:]...) { - // reset the service error on success case - pt.Err = nil - err = pt.updateRawBody() - } else { - // check response body for error content - pt.updateErrorFromResponse() - err = pt.pollingError() - } - return err -} - -// attempts to unmarshal a ServiceError type from the response body. -// if that fails then make a best attempt at creating something meaningful. -// NOTE: this assumes that the async operation has failed. -func (pt *pollingTrackerBase) updateErrorFromResponse() { - var err error - if pt.resp.ContentLength != 0 { - type respErr struct { - ServiceError *ServiceError `json:"error"` - } - re := respErr{} - defer pt.resp.Body.Close() - var b []byte - if b, err = ioutil.ReadAll(pt.resp.Body); err != nil || len(b) == 0 { - goto Default - } - if err = json.Unmarshal(b, &re); err != nil { - goto Default - } - // unmarshalling the error didn't yield anything, try unwrapped error - if re.ServiceError == nil { - err = json.Unmarshal(b, &re.ServiceError) - if err != nil { - goto Default - } - } - // the unmarshaller will ensure re.ServiceError is non-nil - // even if there was no content unmarshalled so check the code. - if re.ServiceError.Code != "" { - pt.Err = re.ServiceError - return - } - } -Default: - se := &ServiceError{ - Code: pt.pollingStatus(), - Message: "The async operation failed.", - } - if err != nil { - se.InnerError = make(map[string]interface{}) - se.InnerError["unmarshalError"] = err.Error() - } - // stick the response body into the error object in hopes - // it contains something useful to help diagnose the failure. - if len(pt.rawBody) > 0 { - se.AdditionalInfo = []map[string]interface{}{ - pt.rawBody, - } - } - pt.Err = se -} - -func (pt *pollingTrackerBase) updatePollingState(provStateApl bool) error { - if pt.Pm == PollingAsyncOperation && pt.rawBody["status"] != nil { - pt.State = pt.rawBody["status"].(string) - } else { - if pt.resp.StatusCode == http.StatusAccepted { - pt.State = operationInProgress - } else if provStateApl { - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - } else { - pt.State = operationSucceeded - } - } else { - return autorest.NewError("pollingTrackerBase", "updatePollingState", "the response from the async operation has an invalid status code") - } - } - // if the operation has failed update the error state - if pt.hasFailed() { - pt.updateErrorFromResponse() - } - return nil -} - -func (pt pollingTrackerBase) pollingError() error { - if pt.Err == nil { - return nil - } - return pt.Err -} - -func (pt pollingTrackerBase) pollingMethod() PollingMethodType { - return pt.Pm -} - -func (pt pollingTrackerBase) pollingStatus() string { - return pt.State -} - -func (pt pollingTrackerBase) pollingURL() string { - return pt.URI -} - -func (pt pollingTrackerBase) finalGetURL() string { - return pt.FinalGetURI -} - -func (pt pollingTrackerBase) hasTerminated() bool { - return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) || strings.EqualFold(pt.State, operationSucceeded) -} - -func (pt pollingTrackerBase) hasFailed() bool { - return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) -} - -func (pt pollingTrackerBase) hasSucceeded() bool { - return strings.EqualFold(pt.State, operationSucceeded) -} - -func (pt pollingTrackerBase) latestResponse() *http.Response { - return pt.resp -} - -// error checking common to all trackers -func (pt pollingTrackerBase) baseCheckForErrors() error { - // for Azure-AsyncOperations the response body cannot be nil or empty - if pt.Pm == PollingAsyncOperation { - if pt.resp.Body == nil || pt.resp.ContentLength == 0 { - return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "for Azure-AsyncOperation response body cannot be nil") - } - if pt.rawBody["status"] == nil { - return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "missing status property in Azure-AsyncOperation response body") - } - } - return nil -} - -// default initialization of polling URL/method. each verb tracker will update this as required. -func (pt *pollingTrackerBase) initPollingMethod() error { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - return nil - } - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh != "" { - pt.URI = lh - pt.Pm = PollingLocation - return nil - } - // it's ok if we didn't find a polling header, this will be handled elsewhere - return nil -} - -// DELETE - -type pollingTrackerDelete struct { - pollingTrackerBase -} - -func (pt *pollingTrackerDelete) updatePollingMethod() error { - // for 201 the Location header is required - if pt.resp.StatusCode == http.StatusCreated { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerDelete", "updateHeaders", "missing Location header in 201 response") - } else { - pt.URI = lh - } - pt.Pm = PollingLocation - pt.FinalGetURI = pt.URI - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - // when both headers are returned we use the value in the Location header for the final GET - pt.FinalGetURI = lh - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerDelete) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerDelete) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent -} - -// PATCH - -type pollingTrackerPatch struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPatch) updatePollingMethod() error { - // by default we can use the original URL for polling and final GET - if pt.URI == "" { - pt.URI = pt.resp.Request.URL.String() - } - if pt.FinalGetURI == "" { - pt.FinalGetURI = pt.resp.Request.URL.String() - } - if pt.Pm == PollingUnknown { - pt.Pm = PollingRequestURI - } - // for 201 it's permissible for no headers to be returned - if pt.resp.StatusCode == http.StatusCreated { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - // note the absence of the "final GET" mechanism for PATCH - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - if ao == "" { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerPatch", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } else { - pt.URI = lh - pt.Pm = PollingLocation - } - } - } - return nil -} - -func (pt pollingTrackerPatch) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerPatch) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated -} - -// POST - -type pollingTrackerPost struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPost) updatePollingMethod() error { - // 201 requires Location header - if pt.resp.StatusCode == http.StatusCreated { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "missing Location header in 201 response") - } else { - pt.URI = lh - pt.FinalGetURI = lh - pt.Pm = PollingLocation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - // when both headers are returned we use the value in the Location header for the final GET - pt.FinalGetURI = lh - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerPost) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerPost) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent -} - -// PUT - -type pollingTrackerPut struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPut) updatePollingMethod() error { - // by default we can use the original URL for polling and final GET - if pt.URI == "" { - pt.URI = pt.resp.Request.URL.String() - } - if pt.FinalGetURI == "" { - pt.FinalGetURI = pt.resp.Request.URL.String() - } - if pt.Pm == PollingUnknown { - pt.Pm = PollingRequestURI - } - // for 201 it's permissible for no headers to be returned - if pt.resp.StatusCode == http.StatusCreated { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPut", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerPut) checkForErrors() error { - err := pt.baseCheckForErrors() - if err != nil { - return err - } - // if there are no LRO headers then the body cannot be empty - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } - lh, err := getURLFromLocationHeader(pt.resp) - if err != nil { - return err - } - if ao == "" && lh == "" && len(pt.rawBody) == 0 { - return autorest.NewError("pollingTrackerPut", "checkForErrors", "the response did not contain a body") - } - return nil -} - -func (pt pollingTrackerPut) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated -} - -// creates a polling tracker based on the verb of the original request -func createPollingTracker(resp *http.Response) (pollingTracker, error) { - var pt pollingTracker - switch strings.ToUpper(resp.Request.Method) { - case http.MethodDelete: - pt = &pollingTrackerDelete{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPatch: - pt = &pollingTrackerPatch{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPost: - pt = &pollingTrackerPost{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPut: - pt = &pollingTrackerPut{pollingTrackerBase: pollingTrackerBase{resp: resp}} - default: - return nil, autorest.NewError("azure", "createPollingTracker", "unsupported HTTP method %s", resp.Request.Method) - } - if err := pt.initializeState(); err != nil { - return pt, err - } - // this initializes the polling header values, we do this during creation in case the - // initial response send us invalid values; this way the API call will return a non-nil - // error (not doing this means the error shows up in Future.Done) - return pt, pt.updatePollingMethod() -} - -// gets the polling URL from the Azure-AsyncOperation header. -// ensures the URL is well-formed and absolute. -func getURLFromAsyncOpHeader(resp *http.Response) (string, error) { - s := resp.Header.Get(http.CanonicalHeaderKey(headerAsyncOperation)) - if s == "" { - return "", nil - } - if !isValidURL(s) { - return "", autorest.NewError("azure", "getURLFromAsyncOpHeader", "invalid polling URL '%s'", s) - } - return s, nil -} - -// gets the polling URL from the Location header. -// ensures the URL is well-formed and absolute. -func getURLFromLocationHeader(resp *http.Response) (string, error) { - s := resp.Header.Get(http.CanonicalHeaderKey(autorest.HeaderLocation)) - if s == "" { - return "", nil - } - if !isValidURL(s) { - return "", autorest.NewError("azure", "getURLFromLocationHeader", "invalid polling URL '%s'", s) - } - return s, nil -} - -// verify that the URL is valid and absolute -func isValidURL(s string) bool { - u, err := url.Parse(s) - return err == nil && u.IsAbs() -} - -// DoPollForAsynchronous returns a SendDecorator that polls if the http.Response is for an Azure -// long-running operation. It will delay between requests for the duration specified in the -// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled via -// the context associated with the http.Request. -// Deprecated: Prefer using Futures to allow for non-blocking async operations. -func DoPollForAsynchronous(delay time.Duration) autorest.SendDecorator { - return func(s autorest.Sender) autorest.Sender { - return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err != nil { - return resp, err - } - if !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) { - return resp, nil - } - future, err := NewFutureFromResponse(resp) - if err != nil { - return resp, err - } - // retry until either the LRO completes or we receive an error - var done bool - for done, err = future.Done(s); !done && err == nil; done, err = future.Done(s) { - // check for Retry-After delay, if not present use the specified polling delay - if pd, ok := future.GetPollingDelay(); ok { - delay = pd - } - // wait until the delay elapses or the context is cancelled - if delayElapsed := autorest.DelayForBackoff(delay, 0, r.Context().Done()); !delayElapsed { - return future.Response(), - autorest.NewErrorWithError(r.Context().Err(), "azure", "DoPollForAsynchronous", future.Response(), "context has been cancelled") - } - } - return future.Response(), err - }) - } -} - -// PollingMethodType defines a type used for enumerating polling mechanisms. -type PollingMethodType string - -const ( - // PollingAsyncOperation indicates the polling method uses the Azure-AsyncOperation header. - PollingAsyncOperation PollingMethodType = "AsyncOperation" - - // PollingLocation indicates the polling method uses the Location header. - PollingLocation PollingMethodType = "Location" - - // PollingRequestURI indicates the polling method uses the original request URI. - PollingRequestURI PollingMethodType = "RequestURI" - - // PollingUnknown indicates an unknown polling method and is the default value. - PollingUnknown PollingMethodType = "" -) - -// AsyncOpIncompleteError is the type that's returned from a future that has not completed. -type AsyncOpIncompleteError struct { - // FutureType is the name of the type composed of a azure.Future. - FutureType string -} - -// Error returns an error message including the originating type name of the error. -func (e AsyncOpIncompleteError) Error() string { - return fmt.Sprintf("%s: asynchronous operation has not completed", e.FutureType) -} - -// NewAsyncOpIncompleteError creates a new AsyncOpIncompleteError with the specified parameters. -func NewAsyncOpIncompleteError(futureType string) AsyncOpIncompleteError { - return AsyncOpIncompleteError{ - FutureType: futureType, - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go deleted file mode 100644 index 3a0a439f..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ /dev/null @@ -1,326 +0,0 @@ -// Package azure provides Azure-specific implementations used with AutoRest. -// See the included examples for more detail. -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "regexp" - "strconv" - "strings" - - "github.com/Azure/go-autorest/autorest" -) - -const ( - // HeaderClientID is the Azure extension header to set a user-specified request ID. - HeaderClientID = "x-ms-client-request-id" - - // HeaderReturnClientID is the Azure extension header to set if the user-specified request ID - // should be included in the response. - HeaderReturnClientID = "x-ms-return-client-request-id" - - // HeaderRequestID is the Azure extension header of the service generated request ID returned - // in the response. - HeaderRequestID = "x-ms-request-id" -) - -// ServiceError encapsulates the error response from an Azure service. -// It adhears to the OData v4 specification for error responses. -type ServiceError struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target"` - Details []map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` -} - -func (se ServiceError) Error() string { - result := fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message) - - if se.Target != nil { - result += fmt.Sprintf(" Target=%q", *se.Target) - } - - if se.Details != nil { - d, err := json.Marshal(se.Details) - if err != nil { - result += fmt.Sprintf(" Details=%v", se.Details) - } - result += fmt.Sprintf(" Details=%v", string(d)) - } - - if se.InnerError != nil { - d, err := json.Marshal(se.InnerError) - if err != nil { - result += fmt.Sprintf(" InnerError=%v", se.InnerError) - } - result += fmt.Sprintf(" InnerError=%v", string(d)) - } - - if se.AdditionalInfo != nil { - d, err := json.Marshal(se.AdditionalInfo) - if err != nil { - result += fmt.Sprintf(" AdditionalInfo=%v", se.AdditionalInfo) - } - result += fmt.Sprintf(" AdditionalInfo=%v", string(d)) - } - - return result -} - -// UnmarshalJSON implements the json.Unmarshaler interface for the ServiceError type. -func (se *ServiceError) UnmarshalJSON(b []byte) error { - // per the OData v4 spec the details field must be an array of JSON objects. - // unfortunately not all services adhear to the spec and just return a single - // object instead of an array with one object. so we have to perform some - // shenanigans to accommodate both cases. - // http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091 - - type serviceError1 struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target"` - Details []map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` - } - - type serviceError2 struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target"` - Details map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` - } - - se1 := serviceError1{} - err := json.Unmarshal(b, &se1) - if err == nil { - se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError, se1.AdditionalInfo) - return nil - } - - se2 := serviceError2{} - err = json.Unmarshal(b, &se2) - if err == nil { - se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError, se2.AdditionalInfo) - se.Details = append(se.Details, se2.Details) - return nil - } - return err -} - -func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}, additional []map[string]interface{}) { - se.Code = code - se.Message = message - se.Target = target - se.Details = details - se.InnerError = inner - se.AdditionalInfo = additional -} - -// RequestError describes an error response returned by Azure service. -type RequestError struct { - autorest.DetailedError - - // The error returned by the Azure service. - ServiceError *ServiceError `json:"error"` - - // The request id (from the x-ms-request-id-header) of the request. - RequestID string -} - -// Error returns a human-friendly error message from service error. -func (e RequestError) Error() string { - return fmt.Sprintf("autorest/azure: Service returned an error. Status=%v %v", - e.StatusCode, e.ServiceError) -} - -// IsAzureError returns true if the passed error is an Azure Service error; false otherwise. -func IsAzureError(e error) bool { - _, ok := e.(*RequestError) - return ok -} - -// Resource contains details about an Azure resource. -type Resource struct { - SubscriptionID string - ResourceGroup string - Provider string - ResourceType string - ResourceName string -} - -// ParseResourceID parses a resource ID into a ResourceDetails struct. -// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#return-value-4. -func ParseResourceID(resourceID string) (Resource, error) { - - const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` - resourceIDPattern := regexp.MustCompile(resourceIDPatternText) - match := resourceIDPattern.FindStringSubmatch(resourceID) - - if len(match) == 0 { - return Resource{}, fmt.Errorf("parsing failed for %s. Invalid resource Id format", resourceID) - } - - v := strings.Split(match[5], "/") - resourceName := v[len(v)-1] - - result := Resource{ - SubscriptionID: match[1], - ResourceGroup: match[2], - Provider: match[3], - ResourceType: match[4], - ResourceName: resourceName, - } - - return result, nil -} - -// NewErrorWithError creates a new Error conforming object from the -// passed packageType, method, statusCode of the given resp (UndefinedStatusCode -// if resp is nil), message, and original error. message is treated as a format -// string to which the optional args apply. -func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) RequestError { - if v, ok := original.(*RequestError); ok { - return *v - } - - statusCode := autorest.UndefinedStatusCode - if resp != nil { - statusCode = resp.StatusCode - } - return RequestError{ - DetailedError: autorest.DetailedError{ - Original: original, - PackageType: packageType, - Method: method, - StatusCode: statusCode, - Message: fmt.Sprintf(message, args...), - }, - } -} - -// WithReturningClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-client-request-id whose value is the passed, undecorated UUID (e.g., -// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA"). It also sets the x-ms-return-client-request-id -// header to true such that UUID accompanies the http.Response. -func WithReturningClientID(uuid string) autorest.PrepareDecorator { - preparer := autorest.CreatePreparer( - WithClientID(uuid), - WithReturnClientID(true)) - - return func(p autorest.Preparer) autorest.Preparer { - return autorest.PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err != nil { - return r, err - } - return preparer.Prepare(r) - }) - } -} - -// WithClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-client-request-id whose value is passed, undecorated UUID (e.g., -// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA"). -func WithClientID(uuid string) autorest.PrepareDecorator { - return autorest.WithHeader(HeaderClientID, uuid) -} - -// WithReturnClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-return-client-request-id whose boolean value indicates if the value of the -// x-ms-client-request-id header should be included in the http.Response. -func WithReturnClientID(b bool) autorest.PrepareDecorator { - return autorest.WithHeader(HeaderReturnClientID, strconv.FormatBool(b)) -} - -// ExtractClientID extracts the client identifier from the x-ms-client-request-id header set on the -// http.Request sent to the service (and returned in the http.Response) -func ExtractClientID(resp *http.Response) string { - return autorest.ExtractHeaderValue(HeaderClientID, resp) -} - -// ExtractRequestID extracts the Azure server generated request identifier from the -// x-ms-request-id header. -func ExtractRequestID(resp *http.Response) string { - return autorest.ExtractHeaderValue(HeaderRequestID, resp) -} - -// WithErrorUnlessStatusCode returns a RespondDecorator that emits an -// azure.RequestError by reading the response body unless the response HTTP status code -// is among the set passed. -// -// If there is a chance service may return responses other than the Azure error -// format and the response cannot be parsed into an error, a decoding error will -// be returned containing the response body. In any case, the Responder will -// return an error if the status code is not satisfied. -// -// If this Responder returns an error, the response body will be replaced with -// an in-memory reader, which needs no further closing. -func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator { - return func(r autorest.Responder) autorest.Responder { - return autorest.ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && !autorest.ResponseHasStatusCode(resp, codes...) { - var e RequestError - defer resp.Body.Close() - - // Copy and replace the Body in case it does not contain an error object. - // This will leave the Body available to the caller. - b, decodeErr := autorest.CopyAndDecode(autorest.EncodedAsJSON, resp.Body, &e) - resp.Body = ioutil.NopCloser(&b) - if decodeErr != nil { - return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), decodeErr) - } - if e.ServiceError == nil { - // Check if error is unwrapped ServiceError - if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil { - return err - } - } - if e.ServiceError.Message == "" { - // if we're here it means the returned error wasn't OData v4 compliant. - // try to unmarshal the body as raw JSON in hopes of getting something. - rawBody := map[string]interface{}{} - if err := json.Unmarshal(b.Bytes(), &rawBody); err != nil { - return err - } - e.ServiceError = &ServiceError{ - Code: "Unknown", - Message: "Unknown service error", - } - if len(rawBody) > 0 { - e.ServiceError.Details = []map[string]interface{}{rawBody} - } - } - e.Response = resp - e.RequestID = ExtractRequestID(resp) - if e.StatusCode == nil { - e.StatusCode = resp.StatusCode - } - err = &e - } - return err - }) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go deleted file mode 100644 index 7e41f7fd..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ /dev/null @@ -1,191 +0,0 @@ -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "strings" -) - -// EnvironmentFilepathName captures the name of the environment variable containing the path to the file -// to be used while populating the Azure Environment. -const EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH" - -var environments = map[string]Environment{ - "AZURECHINACLOUD": ChinaCloud, - "AZUREGERMANCLOUD": GermanCloud, - "AZUREPUBLICCLOUD": PublicCloud, - "AZUREUSGOVERNMENTCLOUD": USGovernmentCloud, -} - -// Environment represents a set of endpoints for each of Azure's Clouds. -type Environment struct { - Name string `json:"name"` - ManagementPortalURL string `json:"managementPortalURL"` - PublishSettingsURL string `json:"publishSettingsURL"` - ServiceManagementEndpoint string `json:"serviceManagementEndpoint"` - ResourceManagerEndpoint string `json:"resourceManagerEndpoint"` - ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"` - GalleryEndpoint string `json:"galleryEndpoint"` - KeyVaultEndpoint string `json:"keyVaultEndpoint"` - GraphEndpoint string `json:"graphEndpoint"` - ServiceBusEndpoint string `json:"serviceBusEndpoint"` - BatchManagementEndpoint string `json:"batchManagementEndpoint"` - StorageEndpointSuffix string `json:"storageEndpointSuffix"` - SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"` - TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"` - KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"` - ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"` - ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"` - ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"` - ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"` - TokenAudience string `json:"tokenAudience"` -} - -var ( - // PublicCloud is the default public Azure cloud environment - PublicCloud = Environment{ - Name: "AzurePublicCloud", - ManagementPortalURL: "https://manage.windowsazure.com/", - PublishSettingsURL: "https://manage.windowsazure.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.windows.net/", - ResourceManagerEndpoint: "https://management.azure.com/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", - GalleryEndpoint: "https://gallery.azure.com/", - KeyVaultEndpoint: "https://vault.azure.net/", - GraphEndpoint: "https://graph.windows.net/", - ServiceBusEndpoint: "https://servicebus.windows.net/", - BatchManagementEndpoint: "https://batch.core.windows.net/", - StorageEndpointSuffix: "core.windows.net", - SQLDatabaseDNSSuffix: "database.windows.net", - TrafficManagerDNSSuffix: "trafficmanager.net", - KeyVaultDNSSuffix: "vault.azure.net", - ServiceBusEndpointSuffix: "servicebus.windows.net", - ServiceManagementVMDNSSuffix: "cloudapp.net", - ResourceManagerVMDNSSuffix: "cloudapp.azure.com", - ContainerRegistryDNSSuffix: "azurecr.io", - TokenAudience: "https://management.azure.com/", - } - - // USGovernmentCloud is the cloud environment for the US Government - USGovernmentCloud = Environment{ - Name: "AzureUSGovernmentCloud", - ManagementPortalURL: "https://manage.windowsazure.us/", - PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/", - ResourceManagerEndpoint: "https://management.usgovcloudapi.net/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.us/", - GalleryEndpoint: "https://gallery.usgovcloudapi.net/", - KeyVaultEndpoint: "https://vault.usgovcloudapi.net/", - GraphEndpoint: "https://graph.windows.net/", - ServiceBusEndpoint: "https://servicebus.usgovcloudapi.net/", - BatchManagementEndpoint: "https://batch.core.usgovcloudapi.net/", - StorageEndpointSuffix: "core.usgovcloudapi.net", - SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", - TrafficManagerDNSSuffix: "usgovtrafficmanager.net", - KeyVaultDNSSuffix: "vault.usgovcloudapi.net", - ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net", - ServiceManagementVMDNSSuffix: "usgovcloudapp.net", - ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us", - ContainerRegistryDNSSuffix: "azurecr.io", - TokenAudience: "https://management.usgovcloudapi.net/", - } - - // ChinaCloud is the cloud environment operated in China - ChinaCloud = Environment{ - Name: "AzureChinaCloud", - ManagementPortalURL: "https://manage.chinacloudapi.com/", - PublishSettingsURL: "https://manage.chinacloudapi.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.chinacloudapi.cn/", - ResourceManagerEndpoint: "https://management.chinacloudapi.cn/", - ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/", - GalleryEndpoint: "https://gallery.chinacloudapi.cn/", - KeyVaultEndpoint: "https://vault.azure.cn/", - GraphEndpoint: "https://graph.chinacloudapi.cn/", - ServiceBusEndpoint: "https://servicebus.chinacloudapi.cn/", - BatchManagementEndpoint: "https://batch.chinacloudapi.cn/", - StorageEndpointSuffix: "core.chinacloudapi.cn", - SQLDatabaseDNSSuffix: "database.chinacloudapi.cn", - TrafficManagerDNSSuffix: "trafficmanager.cn", - KeyVaultDNSSuffix: "vault.azure.cn", - ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn", - ServiceManagementVMDNSSuffix: "chinacloudapp.cn", - ResourceManagerVMDNSSuffix: "cloudapp.azure.cn", - ContainerRegistryDNSSuffix: "azurecr.io", - TokenAudience: "https://management.chinacloudapi.cn/", - } - - // GermanCloud is the cloud environment operated in Germany - GermanCloud = Environment{ - Name: "AzureGermanCloud", - ManagementPortalURL: "http://portal.microsoftazure.de/", - PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.cloudapi.de/", - ResourceManagerEndpoint: "https://management.microsoftazure.de/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.de/", - GalleryEndpoint: "https://gallery.cloudapi.de/", - KeyVaultEndpoint: "https://vault.microsoftazure.de/", - GraphEndpoint: "https://graph.cloudapi.de/", - ServiceBusEndpoint: "https://servicebus.cloudapi.de/", - BatchManagementEndpoint: "https://batch.cloudapi.de/", - StorageEndpointSuffix: "core.cloudapi.de", - SQLDatabaseDNSSuffix: "database.cloudapi.de", - TrafficManagerDNSSuffix: "azuretrafficmanager.de", - KeyVaultDNSSuffix: "vault.microsoftazure.de", - ServiceBusEndpointSuffix: "servicebus.cloudapi.de", - ServiceManagementVMDNSSuffix: "azurecloudapp.de", - ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de", - ContainerRegistryDNSSuffix: "azurecr.io", - TokenAudience: "https://management.microsoftazure.de/", - } -) - -// EnvironmentFromName returns an Environment based on the common name specified. -func EnvironmentFromName(name string) (Environment, error) { - // IMPORTANT - // As per @radhikagupta5: - // This is technical debt, fundamentally here because Kubernetes is not currently accepting - // contributions to the providers. Once that is an option, the provider should be updated to - // directly call `EnvironmentFromFile`. Until then, we rely on dispatching Azure Stack environment creation - // from this method based on the name that is provided to us. - if strings.EqualFold(name, "AZURESTACKCLOUD") { - return EnvironmentFromFile(os.Getenv(EnvironmentFilepathName)) - } - - name = strings.ToUpper(name) - env, ok := environments[name] - if !ok { - return env, fmt.Errorf("autorest/azure: There is no cloud environment matching the name %q", name) - } - - return env, nil -} - -// EnvironmentFromFile loads an Environment from a configuration file available on disk. -// This function is particularly useful in the Hybrid Cloud model, where one must define their own -// endpoints. -func EnvironmentFromFile(location string) (unmarshaled Environment, err error) { - fileContents, err := ioutil.ReadFile(location) - if err != nil { - return - } - - err = json.Unmarshal(fileContents, &unmarshaled) - - return -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go b/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go deleted file mode 100644 index 507f9e95..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go +++ /dev/null @@ -1,245 +0,0 @@ -package azure - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - - "github.com/Azure/go-autorest/autorest" -) - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -type audience []string - -type authentication struct { - LoginEndpoint string `json:"loginEndpoint"` - Audiences audience `json:"audiences"` -} - -type environmentMetadataInfo struct { - GalleryEndpoint string `json:"galleryEndpoint"` - GraphEndpoint string `json:"graphEndpoint"` - PortalEndpoint string `json:"portalEndpoint"` - Authentication authentication `json:"authentication"` -} - -// EnvironmentProperty represent property names that clients can override -type EnvironmentProperty string - -const ( - // EnvironmentName ... - EnvironmentName EnvironmentProperty = "name" - // EnvironmentManagementPortalURL .. - EnvironmentManagementPortalURL EnvironmentProperty = "managementPortalURL" - // EnvironmentPublishSettingsURL ... - EnvironmentPublishSettingsURL EnvironmentProperty = "publishSettingsURL" - // EnvironmentServiceManagementEndpoint ... - EnvironmentServiceManagementEndpoint EnvironmentProperty = "serviceManagementEndpoint" - // EnvironmentResourceManagerEndpoint ... - EnvironmentResourceManagerEndpoint EnvironmentProperty = "resourceManagerEndpoint" - // EnvironmentActiveDirectoryEndpoint ... - EnvironmentActiveDirectoryEndpoint EnvironmentProperty = "activeDirectoryEndpoint" - // EnvironmentGalleryEndpoint ... - EnvironmentGalleryEndpoint EnvironmentProperty = "galleryEndpoint" - // EnvironmentKeyVaultEndpoint ... - EnvironmentKeyVaultEndpoint EnvironmentProperty = "keyVaultEndpoint" - // EnvironmentGraphEndpoint ... - EnvironmentGraphEndpoint EnvironmentProperty = "graphEndpoint" - // EnvironmentServiceBusEndpoint ... - EnvironmentServiceBusEndpoint EnvironmentProperty = "serviceBusEndpoint" - // EnvironmentBatchManagementEndpoint ... - EnvironmentBatchManagementEndpoint EnvironmentProperty = "batchManagementEndpoint" - // EnvironmentStorageEndpointSuffix ... - EnvironmentStorageEndpointSuffix EnvironmentProperty = "storageEndpointSuffix" - // EnvironmentSQLDatabaseDNSSuffix ... - EnvironmentSQLDatabaseDNSSuffix EnvironmentProperty = "sqlDatabaseDNSSuffix" - // EnvironmentTrafficManagerDNSSuffix ... - EnvironmentTrafficManagerDNSSuffix EnvironmentProperty = "trafficManagerDNSSuffix" - // EnvironmentKeyVaultDNSSuffix ... - EnvironmentKeyVaultDNSSuffix EnvironmentProperty = "keyVaultDNSSuffix" - // EnvironmentServiceBusEndpointSuffix ... - EnvironmentServiceBusEndpointSuffix EnvironmentProperty = "serviceBusEndpointSuffix" - // EnvironmentServiceManagementVMDNSSuffix ... - EnvironmentServiceManagementVMDNSSuffix EnvironmentProperty = "serviceManagementVMDNSSuffix" - // EnvironmentResourceManagerVMDNSSuffix ... - EnvironmentResourceManagerVMDNSSuffix EnvironmentProperty = "resourceManagerVMDNSSuffix" - // EnvironmentContainerRegistryDNSSuffix ... - EnvironmentContainerRegistryDNSSuffix EnvironmentProperty = "containerRegistryDNSSuffix" - // EnvironmentTokenAudience ... - EnvironmentTokenAudience EnvironmentProperty = "tokenAudience" -) - -// OverrideProperty represents property name and value that clients can override -type OverrideProperty struct { - Key EnvironmentProperty - Value string -} - -// EnvironmentFromURL loads an Environment from a URL -// This function is particularly useful in the Hybrid Cloud model, where one may define their own -// endpoints. -func EnvironmentFromURL(resourceManagerEndpoint string, properties ...OverrideProperty) (environment Environment, err error) { - var metadataEnvProperties environmentMetadataInfo - - if resourceManagerEndpoint == "" { - return environment, fmt.Errorf("Metadata resource manager endpoint is empty") - } - - if metadataEnvProperties, err = retrieveMetadataEnvironment(resourceManagerEndpoint); err != nil { - return environment, err - } - - // Give priority to user's override values - overrideProperties(&environment, properties) - - if environment.Name == "" { - environment.Name = "HybridEnvironment" - } - stampDNSSuffix := environment.StorageEndpointSuffix - if stampDNSSuffix == "" { - stampDNSSuffix = strings.TrimSuffix(strings.TrimPrefix(strings.Replace(resourceManagerEndpoint, strings.Split(resourceManagerEndpoint, ".")[0], "", 1), "."), "/") - environment.StorageEndpointSuffix = stampDNSSuffix - } - if environment.KeyVaultDNSSuffix == "" { - environment.KeyVaultDNSSuffix = fmt.Sprintf("%s.%s", "vault", stampDNSSuffix) - } - if environment.KeyVaultEndpoint == "" { - environment.KeyVaultEndpoint = fmt.Sprintf("%s%s", "https://", environment.KeyVaultDNSSuffix) - } - if environment.TokenAudience == "" { - environment.TokenAudience = metadataEnvProperties.Authentication.Audiences[0] - } - if environment.ActiveDirectoryEndpoint == "" { - environment.ActiveDirectoryEndpoint = metadataEnvProperties.Authentication.LoginEndpoint - } - if environment.ResourceManagerEndpoint == "" { - environment.ResourceManagerEndpoint = resourceManagerEndpoint - } - if environment.GalleryEndpoint == "" { - environment.GalleryEndpoint = metadataEnvProperties.GalleryEndpoint - } - if environment.GraphEndpoint == "" { - environment.GraphEndpoint = metadataEnvProperties.GraphEndpoint - } - - return environment, nil -} - -func overrideProperties(environment *Environment, properties []OverrideProperty) { - for _, property := range properties { - switch property.Key { - case EnvironmentName: - { - environment.Name = property.Value - } - case EnvironmentManagementPortalURL: - { - environment.ManagementPortalURL = property.Value - } - case EnvironmentPublishSettingsURL: - { - environment.PublishSettingsURL = property.Value - } - case EnvironmentServiceManagementEndpoint: - { - environment.ServiceManagementEndpoint = property.Value - } - case EnvironmentResourceManagerEndpoint: - { - environment.ResourceManagerEndpoint = property.Value - } - case EnvironmentActiveDirectoryEndpoint: - { - environment.ActiveDirectoryEndpoint = property.Value - } - case EnvironmentGalleryEndpoint: - { - environment.GalleryEndpoint = property.Value - } - case EnvironmentKeyVaultEndpoint: - { - environment.KeyVaultEndpoint = property.Value - } - case EnvironmentGraphEndpoint: - { - environment.GraphEndpoint = property.Value - } - case EnvironmentServiceBusEndpoint: - { - environment.ServiceBusEndpoint = property.Value - } - case EnvironmentBatchManagementEndpoint: - { - environment.BatchManagementEndpoint = property.Value - } - case EnvironmentStorageEndpointSuffix: - { - environment.StorageEndpointSuffix = property.Value - } - case EnvironmentSQLDatabaseDNSSuffix: - { - environment.SQLDatabaseDNSSuffix = property.Value - } - case EnvironmentTrafficManagerDNSSuffix: - { - environment.TrafficManagerDNSSuffix = property.Value - } - case EnvironmentKeyVaultDNSSuffix: - { - environment.KeyVaultDNSSuffix = property.Value - } - case EnvironmentServiceBusEndpointSuffix: - { - environment.ServiceBusEndpointSuffix = property.Value - } - case EnvironmentServiceManagementVMDNSSuffix: - { - environment.ServiceManagementVMDNSSuffix = property.Value - } - case EnvironmentResourceManagerVMDNSSuffix: - { - environment.ResourceManagerVMDNSSuffix = property.Value - } - case EnvironmentContainerRegistryDNSSuffix: - { - environment.ContainerRegistryDNSSuffix = property.Value - } - case EnvironmentTokenAudience: - { - environment.TokenAudience = property.Value - } - } - } -} - -func retrieveMetadataEnvironment(endpoint string) (environment environmentMetadataInfo, err error) { - client := autorest.NewClientWithUserAgent("") - managementEndpoint := fmt.Sprintf("%s%s", strings.TrimSuffix(endpoint, "/"), "/metadata/endpoints?api-version=1.0") - req, _ := http.NewRequest("GET", managementEndpoint, nil) - response, err := client.Do(req) - if err != nil { - return environment, err - } - defer response.Body.Close() - jsonResponse, err := ioutil.ReadAll(response.Body) - if err != nil { - return environment, err - } - err = json.Unmarshal(jsonResponse, &environment) - return environment, err -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go deleted file mode 100644 index 86ce9f2b..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package azure - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "strings" - "time" - - "github.com/Azure/go-autorest/autorest" -) - -// DoRetryWithRegistration tries to register the resource provider in case it is unregistered. -// It also handles request retries -func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator { - return func(s autorest.Sender) autorest.Sender { - return autorest.SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := autorest.NewRetriableRequest(r) - for currentAttempt := 0; currentAttempt < client.RetryAttempts; currentAttempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - - resp, err = autorest.SendWithSender(s, rr.Request(), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return resp, err - } - - if resp.StatusCode != http.StatusConflict || client.SkipResourceProviderRegistration { - return resp, err - } - var re RequestError - err = autorest.Respond( - resp, - autorest.ByUnmarshallingJSON(&re), - ) - if err != nil { - return resp, err - } - err = re - - if re.ServiceError != nil && re.ServiceError.Code == "MissingSubscriptionRegistration" { - regErr := register(client, r, re) - if regErr != nil { - return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %s", regErr, err) - } - } - } - return resp, err - }) - } -} - -func getProvider(re RequestError) (string, error) { - if re.ServiceError != nil && len(re.ServiceError.Details) > 0 { - return re.ServiceError.Details[0]["target"].(string), nil - } - return "", errors.New("provider was not found in the response") -} - -func register(client autorest.Client, originalReq *http.Request, re RequestError) error { - subID := getSubscription(originalReq.URL.Path) - if subID == "" { - return errors.New("missing parameter subscriptionID to register resource provider") - } - providerName, err := getProvider(re) - if err != nil { - return fmt.Errorf("missing parameter provider to register resource provider: %s", err) - } - newURL := url.URL{ - Scheme: originalReq.URL.Scheme, - Host: originalReq.URL.Host, - } - - // taken from the resources SDK - // with almost identical code, this sections are easier to mantain - // It is also not a good idea to import the SDK here - // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L252 - pathParameters := map[string]interface{}{ - "resourceProviderNamespace": autorest.Encode("path", providerName), - "subscriptionId": autorest.Encode("path", subID), - } - - const APIVersion = "2016-09-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(newURL.String()), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters), - autorest.WithQueryParameters(queryParameters), - ) - - req, err := preparer.Prepare(&http.Request{}) - if err != nil { - return err - } - req = req.WithContext(originalReq.Context()) - - resp, err := autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return err - } - - type Provider struct { - RegistrationState *string `json:"registrationState,omitempty"` - } - var provider Provider - - err = autorest.Respond( - resp, - WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&provider), - autorest.ByClosing(), - ) - if err != nil { - return err - } - - // poll for registered provisioning state - registrationStartTime := time.Now() - for err == nil && (client.PollingDuration == 0 || (client.PollingDuration != 0 && time.Since(registrationStartTime) < client.PollingDuration)) { - // taken from the resources SDK - // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45 - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(newURL.String()), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters), - autorest.WithQueryParameters(queryParameters), - ) - req, err = preparer.Prepare(&http.Request{}) - if err != nil { - return err - } - req = req.WithContext(originalReq.Context()) - - resp, err := autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return err - } - - err = autorest.Respond( - resp, - WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&provider), - autorest.ByClosing(), - ) - if err != nil { - return err - } - - if provider.RegistrationState != nil && - *provider.RegistrationState == "Registered" { - break - } - - delayed := autorest.DelayWithRetryAfter(resp, originalReq.Context().Done()) - if !delayed && !autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Context().Done()) { - return originalReq.Context().Err() - } - } - if client.PollingDuration != 0 && !(time.Since(registrationStartTime) < client.PollingDuration) { - return errors.New("polling for resource provider registration has exceeded the polling duration") - } - return err -} - -func getSubscription(path string) string { - parts := strings.Split(path, "/") - for i, v := range parts { - if v == "subscriptions" && (i+1) < len(parts) { - return parts[i+1] - } - } - return "" -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go deleted file mode 100644 index 48eb0e8b..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/client.go +++ /dev/null @@ -1,268 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "log" - "net/http" - "net/http/cookiejar" - "strings" - "time" - - "github.com/Azure/go-autorest/logger" - "github.com/Azure/go-autorest/version" -) - -const ( - // DefaultPollingDelay is a reasonable delay between polling requests. - DefaultPollingDelay = 60 * time.Second - - // DefaultPollingDuration is a reasonable total polling duration. - DefaultPollingDuration = 15 * time.Minute - - // DefaultRetryAttempts is number of attempts for retry status codes (5xx). - DefaultRetryAttempts = 3 - - // DefaultRetryDuration is the duration to wait between retries. - DefaultRetryDuration = 30 * time.Second -) - -var ( - // StatusCodesForRetry are a defined group of status code for which the client will retry - StatusCodesForRetry = []int{ - http.StatusRequestTimeout, // 408 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - } -) - -const ( - requestFormat = `HTTP Request Begin =================================================== -%s -===================================================== HTTP Request End -` - responseFormat = `HTTP Response Begin =================================================== -%s -===================================================== HTTP Response End -` -) - -// Response serves as the base for all responses from generated clients. It provides access to the -// last http.Response. -type Response struct { - *http.Response `json:"-"` -} - -// LoggingInspector implements request and response inspectors that log the full request and -// response to a supplied log. -type LoggingInspector struct { - Logger *log.Logger -} - -// WithInspection returns a PrepareDecorator that emits the http.Request to the supplied logger. The -// body is restored after being emitted. -// -// Note: Since it reads the entire Body, this decorator should not be used where body streaming is -// important. It is best used to trace JSON or similar body values. -func (li LoggingInspector) WithInspection() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - var body, b bytes.Buffer - - defer r.Body.Close() - - r.Body = ioutil.NopCloser(io.TeeReader(r.Body, &body)) - if err := r.Write(&b); err != nil { - return nil, fmt.Errorf("Failed to write response: %v", err) - } - - li.Logger.Printf(requestFormat, b.String()) - - r.Body = ioutil.NopCloser(&body) - return p.Prepare(r) - }) - } -} - -// ByInspecting returns a RespondDecorator that emits the http.Response to the supplied logger. The -// body is restored after being emitted. -// -// Note: Since it reads the entire Body, this decorator should not be used where body streaming is -// important. It is best used to trace JSON or similar body values. -func (li LoggingInspector) ByInspecting() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - var body, b bytes.Buffer - defer resp.Body.Close() - resp.Body = ioutil.NopCloser(io.TeeReader(resp.Body, &body)) - if err := resp.Write(&b); err != nil { - return fmt.Errorf("Failed to write response: %v", err) - } - - li.Logger.Printf(responseFormat, b.String()) - - resp.Body = ioutil.NopCloser(&body) - return r.Respond(resp) - }) - } -} - -// Client is the base for autorest generated clients. It provides default, "do nothing" -// implementations of an Authorizer, RequestInspector, and ResponseInspector. It also returns the -// standard, undecorated http.Client as a default Sender. -// -// Generated clients should also use Error (see NewError and NewErrorWithError) for errors and -// return responses that compose with Response. -// -// Most customization of generated clients is best achieved by supplying a custom Authorizer, custom -// RequestInspector, and / or custom ResponseInspector. Users may log requests, implement circuit -// breakers (see https://msdn.microsoft.com/en-us/library/dn589784.aspx) or otherwise influence -// sending the request by providing a decorated Sender. -type Client struct { - Authorizer Authorizer - Sender Sender - RequestInspector PrepareDecorator - ResponseInspector RespondDecorator - - // PollingDelay sets the polling frequency used in absence of a Retry-After HTTP header - PollingDelay time.Duration - - // PollingDuration sets the maximum polling time after which an error is returned. - // Setting this to zero will use the provided context to control the duration. - PollingDuration time.Duration - - // RetryAttempts sets the default number of retry attempts for client. - RetryAttempts int - - // RetryDuration sets the delay duration for retries. - RetryDuration time.Duration - - // UserAgent, if not empty, will be set as the HTTP User-Agent header on all requests sent - // through the Do method. - UserAgent string - - Jar http.CookieJar - - // Set to true to skip attempted registration of resource providers (false by default). - SkipResourceProviderRegistration bool -} - -// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed -// string. -func NewClientWithUserAgent(ua string) Client { - c := Client{ - PollingDelay: DefaultPollingDelay, - PollingDuration: DefaultPollingDuration, - RetryAttempts: DefaultRetryAttempts, - RetryDuration: DefaultRetryDuration, - UserAgent: version.UserAgent(), - } - c.Sender = c.sender() - c.AddToUserAgent(ua) - return c -} - -// AddToUserAgent adds an extension to the current user agent -func (c *Client) AddToUserAgent(extension string) error { - if extension != "" { - c.UserAgent = fmt.Sprintf("%s %s", c.UserAgent, extension) - return nil - } - return fmt.Errorf("Extension was empty, User Agent stayed as %s", c.UserAgent) -} - -// Do implements the Sender interface by invoking the active Sender after applying authorization. -// If Sender is not set, it uses a new instance of http.Client. In both cases it will, if UserAgent -// is set, apply set the User-Agent header. -func (c Client) Do(r *http.Request) (*http.Response, error) { - if r.UserAgent() == "" { - r, _ = Prepare(r, - WithUserAgent(c.UserAgent)) - } - // NOTE: c.WithInspection() must be last in the list so that it can inspect all preceding operations - r, err := Prepare(r, - c.WithAuthorization(), - c.WithInspection()) - if err != nil { - var resp *http.Response - if detErr, ok := err.(DetailedError); ok { - // if the authorization failed (e.g. invalid credentials) there will - // be a response associated with the error, be sure to return it. - resp = detErr.Response - } - return resp, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed") - } - logger.Instance.WriteRequest(r, logger.Filter{ - Header: func(k string, v []string) (bool, []string) { - // remove the auth token from the log - if strings.EqualFold(k, "Authorization") || strings.EqualFold(k, "Ocp-Apim-Subscription-Key") { - v = []string{"**REDACTED**"} - } - return true, v - }, - }) - resp, err := SendWithSender(c.sender(), r) - logger.Instance.WriteResponse(resp, logger.Filter{}) - Respond(resp, c.ByInspecting()) - return resp, err -} - -// sender returns the Sender to which to send requests. -func (c Client) sender() Sender { - if c.Sender == nil { - j, _ := cookiejar.New(nil) - return &http.Client{Jar: j} - } - return c.Sender -} - -// WithAuthorization is a convenience method that returns the WithAuthorization PrepareDecorator -// from the current Authorizer. If not Authorizer is set, it uses the NullAuthorizer. -func (c Client) WithAuthorization() PrepareDecorator { - return c.authorizer().WithAuthorization() -} - -// authorizer returns the Authorizer to use. -func (c Client) authorizer() Authorizer { - if c.Authorizer == nil { - return NullAuthorizer{} - } - return c.Authorizer -} - -// WithInspection is a convenience method that passes the request to the supplied RequestInspector, -// if present, or returns the WithNothing PrepareDecorator otherwise. -func (c Client) WithInspection() PrepareDecorator { - if c.RequestInspector == nil { - return WithNothing() - } - return c.RequestInspector -} - -// ByInspecting is a convenience method that passes the response to the supplied ResponseInspector, -// if present, or returns the ByIgnoring RespondDecorator otherwise. -func (c Client) ByInspecting() RespondDecorator { - if c.ResponseInspector == nil { - return ByIgnoring() - } - return c.ResponseInspector -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/date.go b/vendor/github.com/Azure/go-autorest/autorest/date/date.go deleted file mode 100644 index c4571065..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/date.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Package date provides time.Time derivatives that conform to the Swagger.io (https://swagger.io/) -defined date formats: Date and DateTime. Both types may, in most cases, be used in lieu of -time.Time types. And both convert to time.Time through a ToTime method. -*/ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "time" -) - -const ( - fullDate = "2006-01-02" - fullDateJSON = `"2006-01-02"` - dateFormat = "%04d-%02d-%02d" - jsonFormat = `"%04d-%02d-%02d"` -) - -// Date defines a type similar to time.Time but assumes a layout of RFC3339 full-date (i.e., -// 2006-01-02). -type Date struct { - time.Time -} - -// ParseDate create a new Date from the passed string. -func ParseDate(date string) (d Date, err error) { - return parseDate(date, fullDate) -} - -func parseDate(date string, format string) (Date, error) { - d, err := time.Parse(format, date) - return Date{Time: d}, err -} - -// MarshalBinary preserves the Date as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalBinary() ([]byte, error) { - return d.MarshalText() -} - -// UnmarshalBinary reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalBinary(data []byte) error { - return d.UnmarshalText(data) -} - -// MarshalJSON preserves the Date as a JSON string conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalJSON() (json []byte, err error) { - return []byte(fmt.Sprintf(jsonFormat, d.Year(), d.Month(), d.Day())), nil -} - -// UnmarshalJSON reconstitutes the Date from a JSON string conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalJSON(data []byte) (err error) { - d.Time, err = time.Parse(fullDateJSON, string(data)) - return err -} - -// MarshalText preserves the Date as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalText() (text []byte, err error) { - return []byte(fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day())), nil -} - -// UnmarshalText reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalText(data []byte) (err error) { - d.Time, err = time.Parse(fullDate, string(data)) - return err -} - -// String returns the Date formatted as an RFC3339 full-date string (i.e., 2006-01-02). -func (d Date) String() string { - return fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day()) -} - -// ToTime returns a Date as a time.Time -func (d Date) ToTime() time.Time { - return d.Time -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/time.go b/vendor/github.com/Azure/go-autorest/autorest/date/time.go deleted file mode 100644 index b453fad0..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/time.go +++ /dev/null @@ -1,103 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "regexp" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -const ( - azureUtcFormatJSON = `"2006-01-02T15:04:05.999999999"` - azureUtcFormat = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` - rfc3339 = time.RFC3339Nano - tzOffsetRegex = `(Z|z|\+|-)(\d+:\d+)*"*$` -) - -// Time defines a type similar to time.Time but assumes a layout of RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -type Time struct { - time.Time -} - -// MarshalBinary preserves the Time as a byte array conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalBinary() ([]byte, error) { - return t.Time.MarshalText() -} - -// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalBinary(data []byte) error { - return t.UnmarshalText(data) -} - -// MarshalJSON preserves the Time as a JSON string conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalJSON() (json []byte, err error) { - return t.Time.MarshalJSON() -} - -// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalJSON(data []byte) (err error) { - timeFormat := azureUtcFormatJSON - match, err := regexp.Match(tzOffsetRegex, data) - if err != nil { - return err - } else if match { - timeFormat = rfc3339JSON - } - t.Time, err = ParseTime(timeFormat, string(data)) - return err -} - -// MarshalText preserves the Time as a byte array conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalText() (text []byte, err error) { - return t.Time.MarshalText() -} - -// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalText(data []byte) (err error) { - timeFormat := azureUtcFormat - match, err := regexp.Match(tzOffsetRegex, data) - if err != nil { - return err - } else if match { - timeFormat = rfc3339 - } - t.Time, err = ParseTime(timeFormat, string(data)) - return err -} - -// String returns the Time formatted as an RFC3339 date-time string (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) String() string { - // Note: time.Time.String does not return an RFC3339 compliant string, time.Time.MarshalText does. - b, err := t.MarshalText() - if err != nil { - return "" - } - return string(b) -} - -// ToTime returns a Time as a time.Time -func (t Time) ToTime() time.Time { - return t.Time -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go b/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go deleted file mode 100644 index 48fb39ba..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go +++ /dev/null @@ -1,100 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "errors" - "time" -) - -const ( - rfc1123JSON = `"` + time.RFC1123 + `"` - rfc1123 = time.RFC1123 -) - -// TimeRFC1123 defines a type similar to time.Time but assumes a layout of RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -type TimeRFC1123 struct { - time.Time -} - -// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalJSON(data []byte) (err error) { - t.Time, err = ParseTime(rfc1123JSON, string(data)) - if err != nil { - return err - } - return nil -} - -// MarshalJSON preserves the Time as a JSON string conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalJSON() ([]byte, error) { - if y := t.Year(); y < 0 || y >= 10000 { - return nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]") - } - b := []byte(t.Format(rfc1123JSON)) - return b, nil -} - -// MarshalText preserves the Time as a byte array conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalText() ([]byte, error) { - if y := t.Year(); y < 0 || y >= 10000 { - return nil, errors.New("Time.MarshalText: year outside of range [0,9999]") - } - - b := []byte(t.Format(rfc1123)) - return b, nil -} - -// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalText(data []byte) (err error) { - t.Time, err = ParseTime(rfc1123, string(data)) - if err != nil { - return err - } - return nil -} - -// MarshalBinary preserves the Time as a byte array conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalBinary() ([]byte, error) { - return t.MarshalText() -} - -// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalBinary(data []byte) error { - return t.UnmarshalText(data) -} - -// ToTime returns a Time as a time.Time -func (t TimeRFC1123) ToTime() time.Time { - return t.Time -} - -// String returns the Time formatted as an RFC1123 date-time string (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) String() string { - // Note: time.Time.String does not return an RFC1123 compliant string, time.Time.MarshalText does. - b, err := t.MarshalText() - if err != nil { - return "" - } - return string(b) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go b/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go deleted file mode 100644 index 7073959b..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go +++ /dev/null @@ -1,123 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/binary" - "encoding/json" - "time" -) - -// unixEpoch is the moment in time that should be treated as timestamp 0. -var unixEpoch = time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC) - -// UnixTime marshals and unmarshals a time that is represented as the number -// of seconds (ignoring skip-seconds) since the Unix Epoch. -type UnixTime time.Time - -// Duration returns the time as a Duration since the UnixEpoch. -func (t UnixTime) Duration() time.Duration { - return time.Time(t).Sub(unixEpoch) -} - -// NewUnixTimeFromSeconds creates a UnixTime as a number of seconds from the UnixEpoch. -func NewUnixTimeFromSeconds(seconds float64) UnixTime { - return NewUnixTimeFromDuration(time.Duration(seconds * float64(time.Second))) -} - -// NewUnixTimeFromNanoseconds creates a UnixTime as a number of nanoseconds from the UnixEpoch. -func NewUnixTimeFromNanoseconds(nanoseconds int64) UnixTime { - return NewUnixTimeFromDuration(time.Duration(nanoseconds)) -} - -// NewUnixTimeFromDuration creates a UnixTime as a duration of time since the UnixEpoch. -func NewUnixTimeFromDuration(dur time.Duration) UnixTime { - return UnixTime(unixEpoch.Add(dur)) -} - -// UnixEpoch retreives the moment considered the Unix Epoch. I.e. The time represented by '0' -func UnixEpoch() time.Time { - return unixEpoch -} - -// MarshalJSON preserves the UnixTime as a JSON number conforming to Unix Timestamp requirements. -// (i.e. the number of seconds since midnight January 1st, 1970 not considering leap seconds.) -func (t UnixTime) MarshalJSON() ([]byte, error) { - buffer := &bytes.Buffer{} - enc := json.NewEncoder(buffer) - err := enc.Encode(float64(time.Time(t).UnixNano()) / 1e9) - if err != nil { - return nil, err - } - return buffer.Bytes(), nil -} - -// UnmarshalJSON reconstitures a UnixTime saved as a JSON number of the number of seconds since -// midnight January 1st, 1970. -func (t *UnixTime) UnmarshalJSON(text []byte) error { - dec := json.NewDecoder(bytes.NewReader(text)) - - var secondsSinceEpoch float64 - if err := dec.Decode(&secondsSinceEpoch); err != nil { - return err - } - - *t = NewUnixTimeFromSeconds(secondsSinceEpoch) - - return nil -} - -// MarshalText stores the number of seconds since the Unix Epoch as a textual floating point number. -func (t UnixTime) MarshalText() ([]byte, error) { - cast := time.Time(t) - return cast.MarshalText() -} - -// UnmarshalText populates a UnixTime with a value stored textually as a floating point number of seconds since the Unix Epoch. -func (t *UnixTime) UnmarshalText(raw []byte) error { - var unmarshaled time.Time - - if err := unmarshaled.UnmarshalText(raw); err != nil { - return err - } - - *t = UnixTime(unmarshaled) - return nil -} - -// MarshalBinary converts a UnixTime into a binary.LittleEndian float64 of nanoseconds since the epoch. -func (t UnixTime) MarshalBinary() ([]byte, error) { - buf := &bytes.Buffer{} - - payload := int64(t.Duration()) - - if err := binary.Write(buf, binary.LittleEndian, &payload); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -// UnmarshalBinary converts a from a binary.LittleEndian float64 of nanoseconds since the epoch into a UnixTime. -func (t *UnixTime) UnmarshalBinary(raw []byte) error { - var nanosecondsSinceEpoch int64 - - if err := binary.Read(bytes.NewReader(raw), binary.LittleEndian, &nanosecondsSinceEpoch); err != nil { - return err - } - *t = NewUnixTimeFromNanoseconds(nanosecondsSinceEpoch) - return nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go b/vendor/github.com/Azure/go-autorest/autorest/date/utility.go deleted file mode 100644 index 12addf0e..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go +++ /dev/null @@ -1,25 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "strings" - "time" -) - -// ParseTime to parse Time string to specified format. -func ParseTime(format string, t string) (d time.Time, err error) { - return time.Parse(format, strings.ToUpper(t)) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/error.go b/vendor/github.com/Azure/go-autorest/autorest/error.go deleted file mode 100644 index f724f333..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/error.go +++ /dev/null @@ -1,98 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "net/http" -) - -const ( - // UndefinedStatusCode is used when HTTP status code is not available for an error. - UndefinedStatusCode = 0 -) - -// DetailedError encloses a error with details of the package, method, and associated HTTP -// status code (if any). -type DetailedError struct { - Original error - - // PackageType is the package type of the object emitting the error. For types, the value - // matches that produced the the '%T' format specifier of the fmt package. For other elements, - // such as functions, it is just the package name (e.g., "autorest"). - PackageType string - - // Method is the name of the method raising the error. - Method string - - // StatusCode is the HTTP Response StatusCode (if non-zero) that led to the error. - StatusCode interface{} - - // Message is the error message. - Message string - - // Service Error is the response body of failed API in bytes - ServiceError []byte - - // Response is the response object that was returned during failure if applicable. - Response *http.Response -} - -// NewError creates a new Error conforming object from the passed packageType, method, and -// message. message is treated as a format string to which the optional args apply. -func NewError(packageType string, method string, message string, args ...interface{}) DetailedError { - return NewErrorWithError(nil, packageType, method, nil, message, args...) -} - -// NewErrorWithResponse creates a new Error conforming object from the passed -// packageType, method, statusCode of the given resp (UndefinedStatusCode if -// resp is nil), and message. message is treated as a format string to which the -// optional args apply. -func NewErrorWithResponse(packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError { - return NewErrorWithError(nil, packageType, method, resp, message, args...) -} - -// NewErrorWithError creates a new Error conforming object from the -// passed packageType, method, statusCode of the given resp (UndefinedStatusCode -// if resp is nil), message, and original error. message is treated as a format -// string to which the optional args apply. -func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError { - if v, ok := original.(DetailedError); ok { - return v - } - - statusCode := UndefinedStatusCode - if resp != nil { - statusCode = resp.StatusCode - } - - return DetailedError{ - Original: original, - PackageType: packageType, - Method: method, - StatusCode: statusCode, - Message: fmt.Sprintf(message, args...), - Response: resp, - } -} - -// Error returns a formatted containing all available details (i.e., PackageType, Method, -// StatusCode, Message, and original error (if any)). -func (e DetailedError) Error() string { - if e.Original == nil { - return fmt.Sprintf("%s#%s: %s: StatusCode=%d", e.PackageType, e.Method, e.Message, e.StatusCode) - } - return fmt.Sprintf("%s#%s: %s: StatusCode=%d -- Original Error: %v", e.PackageType, e.Method, e.Message, e.StatusCode, e.Original) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go deleted file mode 100644 index 6d67bd73..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go +++ /dev/null @@ -1,480 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/url" - "strings" -) - -const ( - mimeTypeJSON = "application/json" - mimeTypeOctetStream = "application/octet-stream" - mimeTypeFormPost = "application/x-www-form-urlencoded" - - headerAuthorization = "Authorization" - headerContentType = "Content-Type" - headerUserAgent = "User-Agent" -) - -// Preparer is the interface that wraps the Prepare method. -// -// Prepare accepts and possibly modifies an http.Request (e.g., adding Headers). Implementations -// must ensure to not share or hold per-invocation state since Preparers may be shared and re-used. -type Preparer interface { - Prepare(*http.Request) (*http.Request, error) -} - -// PreparerFunc is a method that implements the Preparer interface. -type PreparerFunc func(*http.Request) (*http.Request, error) - -// Prepare implements the Preparer interface on PreparerFunc. -func (pf PreparerFunc) Prepare(r *http.Request) (*http.Request, error) { - return pf(r) -} - -// PrepareDecorator takes and possibly decorates, by wrapping, a Preparer. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then affect the result. -type PrepareDecorator func(Preparer) Preparer - -// CreatePreparer creates, decorates, and returns a Preparer. -// Without decorators, the returned Preparer returns the passed http.Request unmodified. -// Preparers are safe to share and re-use. -func CreatePreparer(decorators ...PrepareDecorator) Preparer { - return DecoratePreparer( - Preparer(PreparerFunc(func(r *http.Request) (*http.Request, error) { return r, nil })), - decorators...) -} - -// DecoratePreparer accepts a Preparer and a, possibly empty, set of PrepareDecorators, which it -// applies to the Preparer. Decorators are applied in the order received, but their affect upon the -// request depends on whether they are a pre-decorator (change the http.Request and then pass it -// along) or a post-decorator (pass the http.Request along and alter it on return). -func DecoratePreparer(p Preparer, decorators ...PrepareDecorator) Preparer { - for _, decorate := range decorators { - p = decorate(p) - } - return p -} - -// Prepare accepts an http.Request and a, possibly empty, set of PrepareDecorators. -// It creates a Preparer from the decorators which it then applies to the passed http.Request. -func Prepare(r *http.Request, decorators ...PrepareDecorator) (*http.Request, error) { - if r == nil { - return nil, NewError("autorest", "Prepare", "Invoked without an http.Request") - } - return CreatePreparer(decorators...).Prepare(r) -} - -// WithNothing returns a "do nothing" PrepareDecorator that makes no changes to the passed -// http.Request. -func WithNothing() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - return p.Prepare(r) - }) - } -} - -// WithHeader returns a PrepareDecorator that sets the specified HTTP header of the http.Request to -// the passed value. It canonicalizes the passed header name (via http.CanonicalHeaderKey) before -// adding the header. -func WithHeader(header string, value string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.Header == nil { - r.Header = make(http.Header) - } - r.Header.Set(http.CanonicalHeaderKey(header), value) - } - return r, err - }) - } -} - -// WithHeaders returns a PrepareDecorator that sets the specified HTTP headers of the http.Request to -// the passed value. It canonicalizes the passed headers name (via http.CanonicalHeaderKey) before -// adding them. -func WithHeaders(headers map[string]interface{}) PrepareDecorator { - h := ensureValueStrings(headers) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.Header == nil { - r.Header = make(http.Header) - } - - for name, value := range h { - r.Header.Set(http.CanonicalHeaderKey(name), value) - } - } - return r, err - }) - } -} - -// WithBearerAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is "Bearer " followed by the supplied token. -func WithBearerAuthorization(token string) PrepareDecorator { - return WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", token)) -} - -// AsContentType returns a PrepareDecorator that adds an HTTP Content-Type header whose value -// is the passed contentType. -func AsContentType(contentType string) PrepareDecorator { - return WithHeader(headerContentType, contentType) -} - -// WithUserAgent returns a PrepareDecorator that adds an HTTP User-Agent header whose value is the -// passed string. -func WithUserAgent(ua string) PrepareDecorator { - return WithHeader(headerUserAgent, ua) -} - -// AsFormURLEncoded returns a PrepareDecorator that adds an HTTP Content-Type header whose value is -// "application/x-www-form-urlencoded". -func AsFormURLEncoded() PrepareDecorator { - return AsContentType(mimeTypeFormPost) -} - -// AsJSON returns a PrepareDecorator that adds an HTTP Content-Type header whose value is -// "application/json". -func AsJSON() PrepareDecorator { - return AsContentType(mimeTypeJSON) -} - -// AsOctetStream returns a PrepareDecorator that adds the "application/octet-stream" Content-Type header. -func AsOctetStream() PrepareDecorator { - return AsContentType(mimeTypeOctetStream) -} - -// WithMethod returns a PrepareDecorator that sets the HTTP method of the passed request. The -// decorator does not validate that the passed method string is a known HTTP method. -func WithMethod(method string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r.Method = method - return p.Prepare(r) - }) - } -} - -// AsDelete returns a PrepareDecorator that sets the HTTP method to DELETE. -func AsDelete() PrepareDecorator { return WithMethod("DELETE") } - -// AsGet returns a PrepareDecorator that sets the HTTP method to GET. -func AsGet() PrepareDecorator { return WithMethod("GET") } - -// AsHead returns a PrepareDecorator that sets the HTTP method to HEAD. -func AsHead() PrepareDecorator { return WithMethod("HEAD") } - -// AsOptions returns a PrepareDecorator that sets the HTTP method to OPTIONS. -func AsOptions() PrepareDecorator { return WithMethod("OPTIONS") } - -// AsPatch returns a PrepareDecorator that sets the HTTP method to PATCH. -func AsPatch() PrepareDecorator { return WithMethod("PATCH") } - -// AsPost returns a PrepareDecorator that sets the HTTP method to POST. -func AsPost() PrepareDecorator { return WithMethod("POST") } - -// AsPut returns a PrepareDecorator that sets the HTTP method to PUT. -func AsPut() PrepareDecorator { return WithMethod("PUT") } - -// WithBaseURL returns a PrepareDecorator that populates the http.Request with a url.URL constructed -// from the supplied baseUrl. -func WithBaseURL(baseURL string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - var u *url.URL - if u, err = url.Parse(baseURL); err != nil { - return r, err - } - if u.Scheme == "" { - err = fmt.Errorf("autorest: No scheme detected in URL %s", baseURL) - } - if err == nil { - r.URL = u - } - } - return r, err - }) - } -} - -// WithCustomBaseURL returns a PrepareDecorator that replaces brace-enclosed keys within the -// request base URL (i.e., http.Request.URL) with the corresponding values from the passed map. -func WithCustomBaseURL(baseURL string, urlParameters map[string]interface{}) PrepareDecorator { - parameters := ensureValueStrings(urlParameters) - for key, value := range parameters { - baseURL = strings.Replace(baseURL, "{"+key+"}", value, -1) - } - return WithBaseURL(baseURL) -} - -// WithFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) into the -// http.Request body. -func WithFormData(v url.Values) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - s := v.Encode() - - if r.Header == nil { - r.Header = make(http.Header) - } - r.Header.Set(http.CanonicalHeaderKey(headerContentType), mimeTypeFormPost) - r.ContentLength = int64(len(s)) - r.Body = ioutil.NopCloser(strings.NewReader(s)) - } - return r, err - }) - } -} - -// WithMultiPartFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) form parameters -// into the http.Request body. -func WithMultiPartFormData(formDataParameters map[string]interface{}) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - var body bytes.Buffer - writer := multipart.NewWriter(&body) - for key, value := range formDataParameters { - if rc, ok := value.(io.ReadCloser); ok { - var fd io.Writer - if fd, err = writer.CreateFormFile(key, key); err != nil { - return r, err - } - if _, err = io.Copy(fd, rc); err != nil { - return r, err - } - } else { - if err = writer.WriteField(key, ensureValueString(value)); err != nil { - return r, err - } - } - } - if err = writer.Close(); err != nil { - return r, err - } - if r.Header == nil { - r.Header = make(http.Header) - } - r.Header.Set(http.CanonicalHeaderKey(headerContentType), writer.FormDataContentType()) - r.Body = ioutil.NopCloser(bytes.NewReader(body.Bytes())) - r.ContentLength = int64(body.Len()) - return r, err - } - return r, err - }) - } -} - -// WithFile returns a PrepareDecorator that sends file in request body. -func WithFile(f io.ReadCloser) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - b, err := ioutil.ReadAll(f) - if err != nil { - return r, err - } - r.Body = ioutil.NopCloser(bytes.NewReader(b)) - r.ContentLength = int64(len(b)) - } - return r, err - }) - } -} - -// WithBool returns a PrepareDecorator that encodes the passed bool into the body of the request -// and sets the Content-Length header. -func WithBool(v bool) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithFloat32 returns a PrepareDecorator that encodes the passed float32 into the body of the -// request and sets the Content-Length header. -func WithFloat32(v float32) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithFloat64 returns a PrepareDecorator that encodes the passed float64 into the body of the -// request and sets the Content-Length header. -func WithFloat64(v float64) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithInt32 returns a PrepareDecorator that encodes the passed int32 into the body of the request -// and sets the Content-Length header. -func WithInt32(v int32) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithInt64 returns a PrepareDecorator that encodes the passed int64 into the body of the request -// and sets the Content-Length header. -func WithInt64(v int64) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithString returns a PrepareDecorator that encodes the passed string into the body of the request -// and sets the Content-Length header. -func WithString(v string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - r.ContentLength = int64(len(v)) - r.Body = ioutil.NopCloser(strings.NewReader(v)) - } - return r, err - }) - } -} - -// WithJSON returns a PrepareDecorator that encodes the data passed as JSON into the body of the -// request and sets the Content-Length header. -func WithJSON(v interface{}) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - b, err := json.Marshal(v) - if err == nil { - r.ContentLength = int64(len(b)) - r.Body = ioutil.NopCloser(bytes.NewReader(b)) - } - } - return r, err - }) - } -} - -// WithPath returns a PrepareDecorator that adds the supplied path to the request URL. If the path -// is absolute (that is, it begins with a "/"), it replaces the existing path. -func WithPath(path string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithPath", "Invoked with a nil URL") - } - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -// WithEscapedPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the -// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. The -// values will be escaped (aka URL encoded) before insertion into the path. -func WithEscapedPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator { - parameters := escapeValueStrings(ensureValueStrings(pathParameters)) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithEscapedPathParameters", "Invoked with a nil URL") - } - for key, value := range parameters { - path = strings.Replace(path, "{"+key+"}", value, -1) - } - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -// WithPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the -// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. -func WithPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator { - parameters := ensureValueStrings(pathParameters) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithPathParameters", "Invoked with a nil URL") - } - for key, value := range parameters { - path = strings.Replace(path, "{"+key+"}", value, -1) - } - - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -func parseURL(u *url.URL, path string) (*url.URL, error) { - p := strings.TrimRight(u.String(), "/") - if !strings.HasPrefix(path, "/") { - path = "/" + path - } - return url.Parse(p + path) -} - -// WithQueryParameters returns a PrepareDecorators that encodes and applies the query parameters -// given in the supplied map (i.e., key=value). -func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorator { - parameters := ensureValueStrings(queryParameters) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithQueryParameters", "Invoked with a nil URL") - } - - v := r.URL.Query() - for key, value := range parameters { - d, err := url.QueryUnescape(value) - if err != nil { - return r, err - } - v.Add(key, d) - } - r.URL.RawQuery = v.Encode() - } - return r, err - }) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/responder.go b/vendor/github.com/Azure/go-autorest/autorest/responder.go deleted file mode 100644 index a908a0ad..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/responder.go +++ /dev/null @@ -1,250 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" -) - -// Responder is the interface that wraps the Respond method. -// -// Respond accepts and reacts to an http.Response. Implementations must ensure to not share or hold -// state since Responders may be shared and re-used. -type Responder interface { - Respond(*http.Response) error -} - -// ResponderFunc is a method that implements the Responder interface. -type ResponderFunc func(*http.Response) error - -// Respond implements the Responder interface on ResponderFunc. -func (rf ResponderFunc) Respond(r *http.Response) error { - return rf(r) -} - -// RespondDecorator takes and possibly decorates, by wrapping, a Responder. Decorators may react to -// the http.Response and pass it along or, first, pass the http.Response along then react. -type RespondDecorator func(Responder) Responder - -// CreateResponder creates, decorates, and returns a Responder. Without decorators, the returned -// Responder returns the passed http.Response unmodified. Responders may or may not be safe to share -// and re-used: It depends on the applied decorators. For example, a standard decorator that closes -// the response body is fine to share whereas a decorator that reads the body into a passed struct -// is not. -// -// To prevent memory leaks, ensure that at least one Responder closes the response body. -func CreateResponder(decorators ...RespondDecorator) Responder { - return DecorateResponder( - Responder(ResponderFunc(func(r *http.Response) error { return nil })), - decorators...) -} - -// DecorateResponder accepts a Responder and a, possibly empty, set of RespondDecorators, which it -// applies to the Responder. Decorators are applied in the order received, but their affect upon the -// request depends on whether they are a pre-decorator (react to the http.Response and then pass it -// along) or a post-decorator (pass the http.Response along and then react). -func DecorateResponder(r Responder, decorators ...RespondDecorator) Responder { - for _, decorate := range decorators { - r = decorate(r) - } - return r -} - -// Respond accepts an http.Response and a, possibly empty, set of RespondDecorators. -// It creates a Responder from the decorators it then applies to the passed http.Response. -func Respond(r *http.Response, decorators ...RespondDecorator) error { - if r == nil { - return nil - } - return CreateResponder(decorators...).Respond(r) -} - -// ByIgnoring returns a RespondDecorator that ignores the passed http.Response passing it unexamined -// to the next RespondDecorator. -func ByIgnoring() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - return r.Respond(resp) - }) - } -} - -// ByCopying copies the contents of the http.Response Body into the passed bytes.Buffer as -// the Body is read. -func ByCopying(b *bytes.Buffer) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && resp != nil && resp.Body != nil { - resp.Body = TeeReadCloser(resp.Body, b) - } - return err - }) - } -} - -// ByDiscardingBody returns a RespondDecorator that first invokes the passed Responder after which -// it copies the remaining bytes (if any) in the response body to ioutil.Discard. Since the passed -// Responder is invoked prior to discarding the response body, the decorator may occur anywhere -// within the set. -func ByDiscardingBody() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && resp != nil && resp.Body != nil { - if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil { - return fmt.Errorf("Error discarding the response body: %v", err) - } - } - return err - }) - } -} - -// ByClosing returns a RespondDecorator that first invokes the passed Responder after which it -// closes the response body. Since the passed Responder is invoked prior to closing the response -// body, the decorator may occur anywhere within the set. -func ByClosing() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if resp != nil && resp.Body != nil { - if err := resp.Body.Close(); err != nil { - return fmt.Errorf("Error closing the response body: %v", err) - } - } - return err - }) - } -} - -// ByClosingIfError returns a RespondDecorator that first invokes the passed Responder after which -// it closes the response if the passed Responder returns an error and the response body exists. -func ByClosingIfError() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err != nil && resp != nil && resp.Body != nil { - if err := resp.Body.Close(); err != nil { - return fmt.Errorf("Error closing the response body: %v", err) - } - } - return err - }) - } -} - -// ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the -// response Body into the value pointed to by v. -func ByUnmarshallingJSON(v interface{}) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil { - b, errInner := ioutil.ReadAll(resp.Body) - // Some responses might include a BOM, remove for successful unmarshalling - b = bytes.TrimPrefix(b, []byte("\xef\xbb\xbf")) - if errInner != nil { - err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) - } else if len(strings.Trim(string(b), " ")) > 0 { - errInner = json.Unmarshal(b, v) - if errInner != nil { - err = fmt.Errorf("Error occurred unmarshalling JSON - Error = '%v' JSON = '%s'", errInner, string(b)) - } - } - } - return err - }) - } -} - -// ByUnmarshallingXML returns a RespondDecorator that decodes a XML document returned in the -// response Body into the value pointed to by v. -func ByUnmarshallingXML(v interface{}) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil { - b, errInner := ioutil.ReadAll(resp.Body) - if errInner != nil { - err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) - } else { - errInner = xml.Unmarshal(b, v) - if errInner != nil { - err = fmt.Errorf("Error occurred unmarshalling Xml - Error = '%v' Xml = '%s'", errInner, string(b)) - } - } - } - return err - }) - } -} - -// WithErrorUnlessStatusCode returns a RespondDecorator that emits an error unless the response -// StatusCode is among the set passed. On error, response body is fully read into a buffer and -// presented in the returned error, as well as in the response body. -func WithErrorUnlessStatusCode(codes ...int) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && !ResponseHasStatusCode(resp, codes...) { - derr := NewErrorWithResponse("autorest", "WithErrorUnlessStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - if resp.Body != nil { - defer resp.Body.Close() - b, _ := ioutil.ReadAll(resp.Body) - derr.ServiceError = b - resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - } - err = derr - } - return err - }) - } -} - -// WithErrorUnlessOK returns a RespondDecorator that emits an error if the response StatusCode is -// anything other than HTTP 200. -func WithErrorUnlessOK() RespondDecorator { - return WithErrorUnlessStatusCode(http.StatusOK) -} - -// ExtractHeader extracts all values of the specified header from the http.Response. It returns an -// empty string slice if the passed http.Response is nil or the header does not exist. -func ExtractHeader(header string, resp *http.Response) []string { - if resp != nil && resp.Header != nil { - return resp.Header[http.CanonicalHeaderKey(header)] - } - return nil -} - -// ExtractHeaderValue extracts the first value of the specified header from the http.Response. It -// returns an empty string if the passed http.Response is nil or the header does not exist. -func ExtractHeaderValue(header string, resp *http.Response) string { - h := ExtractHeader(header, resp) - if len(h) > 0 { - return h[0] - } - return "" -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go deleted file mode 100644 index fa11dbed..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go +++ /dev/null @@ -1,52 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" -) - -// NewRetriableRequest returns a wrapper around an HTTP request that support retry logic. -func NewRetriableRequest(req *http.Request) *RetriableRequest { - return &RetriableRequest{req: req} -} - -// Request returns the wrapped HTTP request. -func (rr *RetriableRequest) Request() *http.Request { - return rr.req -} - -func (rr *RetriableRequest) prepareFromByteReader() (err error) { - // fall back to making a copy (only do this once) - b := []byte{} - if rr.req.ContentLength > 0 { - b = make([]byte, rr.req.ContentLength) - _, err = io.ReadFull(rr.req.Body, b) - if err != nil { - return err - } - } else { - b, err = ioutil.ReadAll(rr.req.Body) - if err != nil { - return err - } - } - rr.br = bytes.NewReader(b) - rr.req.Body = ioutil.NopCloser(rr.br) - return err -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go deleted file mode 100644 index 7143cc61..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build !go1.8 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import ( - "bytes" - "io/ioutil" - "net/http" -) - -// RetriableRequest provides facilities for retrying an HTTP request. -type RetriableRequest struct { - req *http.Request - br *bytes.Reader -} - -// Prepare signals that the request is about to be sent. -func (rr *RetriableRequest) Prepare() (err error) { - // preserve the request body; this is to support retry logic as - // the underlying transport will always close the reqeust body - if rr.req.Body != nil { - if rr.br != nil { - _, err = rr.br.Seek(0, 0 /*io.SeekStart*/) - rr.req.Body = ioutil.NopCloser(rr.br) - } - if err != nil { - return err - } - if rr.br == nil { - // fall back to making a copy (only do this once) - err = rr.prepareFromByteReader() - } - } - return err -} - -func removeRequestBody(req *http.Request) { - req.Body = nil - req.ContentLength = 0 -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go deleted file mode 100644 index ae15c6bf..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go +++ /dev/null @@ -1,66 +0,0 @@ -// +build go1.8 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" -) - -// RetriableRequest provides facilities for retrying an HTTP request. -type RetriableRequest struct { - req *http.Request - rc io.ReadCloser - br *bytes.Reader -} - -// Prepare signals that the request is about to be sent. -func (rr *RetriableRequest) Prepare() (err error) { - // preserve the request body; this is to support retry logic as - // the underlying transport will always close the reqeust body - if rr.req.Body != nil { - if rr.rc != nil { - rr.req.Body = rr.rc - } else if rr.br != nil { - _, err = rr.br.Seek(0, io.SeekStart) - rr.req.Body = ioutil.NopCloser(rr.br) - } - if err != nil { - return err - } - if rr.req.GetBody != nil { - // this will allow us to preserve the body without having to - // make a copy. note we need to do this on each iteration - rr.rc, err = rr.req.GetBody() - if err != nil { - return err - } - } else if rr.br == nil { - // fall back to making a copy (only do this once) - err = rr.prepareFromByteReader() - } - } - return err -} - -func removeRequestBody(req *http.Request) { - req.Body = nil - req.GetBody = nil - req.ContentLength = 0 -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go deleted file mode 100644 index e8893a28..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/sender.go +++ /dev/null @@ -1,325 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "log" - "math" - "net/http" - "strconv" - "time" -) - -// Sender is the interface that wraps the Do method to send HTTP requests. -// -// The standard http.Client conforms to this interface. -type Sender interface { - Do(*http.Request) (*http.Response, error) -} - -// SenderFunc is a method that implements the Sender interface. -type SenderFunc func(*http.Request) (*http.Response, error) - -// Do implements the Sender interface on SenderFunc. -func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) { - return sf(r) -} - -// SendDecorator takes and possibily decorates, by wrapping, a Sender. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then react to the -// http.Response result. -type SendDecorator func(Sender) Sender - -// CreateSender creates, decorates, and returns, as a Sender, the default http.Client. -func CreateSender(decorators ...SendDecorator) Sender { - return DecorateSender(&http.Client{}, decorators...) -} - -// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to -// the Sender. Decorators are applied in the order received, but their affect upon the request -// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a -// post-decorator (pass the http.Request along and react to the results in http.Response). -func DecorateSender(s Sender, decorators ...SendDecorator) Sender { - for _, decorate := range decorators { - s = decorate(s) - } - return s -} - -// Send sends, by means of the default http.Client, the passed http.Request, returning the -// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which -// it will apply the http.Client before invoking the Do method. -// -// Send is a convenience method and not recommended for production. Advanced users should use -// SendWithSender, passing and sharing their own Sender (e.g., instance of http.Client). -// -// Send will not poll or retry requests. -func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) { - return SendWithSender(&http.Client{}, r, decorators...) -} - -// SendWithSender sends the passed http.Request, through the provided Sender, returning the -// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which -// it will apply the http.Client before invoking the Do method. -// -// SendWithSender will not poll or retry requests. -func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*http.Response, error) { - return DecorateSender(s, decorators...).Do(r) -} - -// AfterDelay returns a SendDecorator that delays for the passed time.Duration before -// invoking the Sender. The delay may be terminated by closing the optional channel on the -// http.Request. If canceled, no further Senders are invoked. -func AfterDelay(d time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - if !DelayForBackoff(d, 0, r.Context().Done()) { - return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay") - } - return s.Do(r) - }) - } -} - -// AsIs returns a SendDecorator that invokes the passed Sender without modifying the http.Request. -func AsIs() SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - return s.Do(r) - }) - } -} - -// DoCloseIfError returns a SendDecorator that first invokes the passed Sender after which -// it closes the response if the passed Sender returns an error and the response body exists. -func DoCloseIfError() SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err != nil { - Respond(resp, ByDiscardingBody(), ByClosing()) - } - return resp, err - }) - } -} - -// DoErrorIfStatusCode returns a SendDecorator that emits an error if the response StatusCode is -// among the set passed. Since these are artificial errors, the response body may still require -// closing. -func DoErrorIfStatusCode(codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err == nil && ResponseHasStatusCode(resp, codes...) { - err = NewErrorWithResponse("autorest", "DoErrorIfStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - } - return resp, err - }) - } -} - -// DoErrorUnlessStatusCode returns a SendDecorator that emits an error unless the response -// StatusCode is among the set passed. Since these are artificial errors, the response body -// may still require closing. -func DoErrorUnlessStatusCode(codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err == nil && !ResponseHasStatusCode(resp, codes...) { - err = NewErrorWithResponse("autorest", "DoErrorUnlessStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - } - return resp, err - }) - } -} - -// DoPollForStatusCodes returns a SendDecorator that polls if the http.Response contains one of the -// passed status codes. It expects the http.Response to contain a Location header providing the -// URL at which to poll (using GET) and will poll until the time passed is equal to or greater than -// the supplied duration. It will delay between requests for the duration specified in the -// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled by -// closing the optional channel on the http.Request. -func DoPollForStatusCodes(duration time.Duration, delay time.Duration, codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - resp, err = s.Do(r) - - if err == nil && ResponseHasStatusCode(resp, codes...) { - r, err = NewPollingRequestWithContext(r.Context(), resp) - - for err == nil && ResponseHasStatusCode(resp, codes...) { - Respond(resp, - ByDiscardingBody(), - ByClosing()) - resp, err = SendWithSender(s, r, - AfterDelay(GetRetryAfter(resp, delay))) - } - } - - return resp, err - }) - } -} - -// DoRetryForAttempts returns a SendDecorator that retries a failed request for up to the specified -// number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on -// the http.Request. -func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - for attempt := 0; attempt < attempts; attempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - resp, err = s.Do(rr.Request()) - if err == nil { - return resp, err - } - if !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return nil, r.Context().Err() - } - } - return resp, err - }) - } -} - -// DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified -// number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on -// the http.Request. -func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - // Increment to add the first call (attempts denotes number of retries) - attempts++ - for attempt := 0; attempt < attempts; { - err = rr.Prepare() - if err != nil { - return resp, err - } - resp, err = s.Do(rr.Request()) - // if the error isn't temporary don't bother retrying - if err != nil && !IsTemporaryNetworkError(err) { - return nil, err - } - // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication - // resp and err will both have a value, so in this case we don't want to retry as it will never succeed. - if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) { - return resp, err - } - delayed := DelayWithRetryAfter(resp, r.Context().Done()) - if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return resp, r.Context().Err() - } - // don't count a 429 against the number of attempts - // so that we continue to retry until it succeeds - if resp == nil || resp.StatusCode != http.StatusTooManyRequests { - attempt++ - } - } - return resp, err - }) - } -} - -// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header in -// responses with status code 429 -func DelayWithRetryAfter(resp *http.Response, cancel <-chan struct{}) bool { - if resp == nil { - return false - } - retryAfter, _ := strconv.Atoi(resp.Header.Get("Retry-After")) - if resp.StatusCode == http.StatusTooManyRequests && retryAfter > 0 { - select { - case <-time.After(time.Duration(retryAfter) * time.Second): - return true - case <-cancel: - return false - } - } - return false -} - -// DoRetryForDuration returns a SendDecorator that retries the request until the total time is equal -// to or greater than the specified duration, exponentially backing off between requests using the -// supplied backoff time.Duration (which may be zero). Retrying may be canceled by closing the -// optional channel on the http.Request. -func DoRetryForDuration(d time.Duration, backoff time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - end := time.Now().Add(d) - for attempt := 0; time.Now().Before(end); attempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - resp, err = s.Do(rr.Request()) - if err == nil { - return resp, err - } - if !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return nil, r.Context().Err() - } - } - return resp, err - }) - } -} - -// WithLogging returns a SendDecorator that implements simple before and after logging of the -// request. -func WithLogging(logger *log.Logger) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - logger.Printf("Sending %s %s", r.Method, r.URL) - resp, err := s.Do(r) - if err != nil { - logger.Printf("%s %s received error '%v'", r.Method, r.URL, err) - } else { - logger.Printf("%s %s received %s", r.Method, r.URL, resp.Status) - } - return resp, err - }) - } -} - -// DelayForBackoff invokes time.After for the supplied backoff duration raised to the power of -// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set -// to zero for no delay. The delay may be canceled by closing the passed channel. If terminated early, -// returns false. -// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt -// count. -func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool { - select { - case <-time.After(time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second): - return true - case <-cancel: - return false - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go deleted file mode 100644 index bfddd90b..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/utility.go +++ /dev/null @@ -1,228 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "net" - "net/http" - "net/url" - "reflect" - "strings" - - "github.com/Azure/go-autorest/autorest/adal" -) - -// EncodedAs is a series of constants specifying various data encodings -type EncodedAs string - -const ( - // EncodedAsJSON states that data is encoded as JSON - EncodedAsJSON EncodedAs = "JSON" - - // EncodedAsXML states that data is encoded as Xml - EncodedAsXML EncodedAs = "XML" -) - -// Decoder defines the decoding method json.Decoder and xml.Decoder share -type Decoder interface { - Decode(v interface{}) error -} - -// NewDecoder creates a new decoder appropriate to the passed encoding. -// encodedAs specifies the type of encoding and r supplies the io.Reader containing the -// encoded data. -func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder { - if encodedAs == EncodedAsJSON { - return json.NewDecoder(r) - } else if encodedAs == EncodedAsXML { - return xml.NewDecoder(r) - } - return nil -} - -// CopyAndDecode decodes the data from the passed io.Reader while making a copy. Having a copy -// is especially useful if there is a chance the data will fail to decode. -// encodedAs specifies the expected encoding, r provides the io.Reader to the data, and v -// is the decoding destination. -func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (bytes.Buffer, error) { - b := bytes.Buffer{} - return b, NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v) -} - -// TeeReadCloser returns a ReadCloser that writes to w what it reads from rc. -// It utilizes io.TeeReader to copy the data read and has the same behavior when reading. -// Further, when it is closed, it ensures that rc is closed as well. -func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser { - return &teeReadCloser{rc, io.TeeReader(rc, w)} -} - -type teeReadCloser struct { - rc io.ReadCloser - r io.Reader -} - -func (t *teeReadCloser) Read(p []byte) (int, error) { - return t.r.Read(p) -} - -func (t *teeReadCloser) Close() error { - return t.rc.Close() -} - -func containsInt(ints []int, n int) bool { - for _, i := range ints { - if i == n { - return true - } - } - return false -} - -func escapeValueStrings(m map[string]string) map[string]string { - for key, value := range m { - m[key] = url.QueryEscape(value) - } - return m -} - -func ensureValueStrings(mapOfInterface map[string]interface{}) map[string]string { - mapOfStrings := make(map[string]string) - for key, value := range mapOfInterface { - mapOfStrings[key] = ensureValueString(value) - } - return mapOfStrings -} - -func ensureValueString(value interface{}) string { - if value == nil { - return "" - } - switch v := value.(type) { - case string: - return v - case []byte: - return string(v) - default: - return fmt.Sprintf("%v", v) - } -} - -// MapToValues method converts map[string]interface{} to url.Values. -func MapToValues(m map[string]interface{}) url.Values { - v := url.Values{} - for key, value := range m { - x := reflect.ValueOf(value) - if x.Kind() == reflect.Array || x.Kind() == reflect.Slice { - for i := 0; i < x.Len(); i++ { - v.Add(key, ensureValueString(x.Index(i))) - } - } else { - v.Add(key, ensureValueString(value)) - } - } - return v -} - -// AsStringSlice method converts interface{} to []string. This expects a -//that the parameter passed to be a slice or array of a type that has the underlying -//type a string. -func AsStringSlice(s interface{}) ([]string, error) { - v := reflect.ValueOf(s) - if v.Kind() != reflect.Slice && v.Kind() != reflect.Array { - return nil, NewError("autorest", "AsStringSlice", "the value's type is not an array.") - } - stringSlice := make([]string, 0, v.Len()) - - for i := 0; i < v.Len(); i++ { - stringSlice = append(stringSlice, v.Index(i).String()) - } - return stringSlice, nil -} - -// String method converts interface v to string. If interface is a list, it -// joins list elements using the seperator. Note that only sep[0] will be used for -// joining if any separator is specified. -func String(v interface{}, sep ...string) string { - if len(sep) == 0 { - return ensureValueString(v) - } - stringSlice, ok := v.([]string) - if ok == false { - var err error - stringSlice, err = AsStringSlice(v) - if err != nil { - panic(fmt.Sprintf("autorest: Couldn't convert value to a string %s.", err)) - } - } - return ensureValueString(strings.Join(stringSlice, sep[0])) -} - -// Encode method encodes url path and query parameters. -func Encode(location string, v interface{}, sep ...string) string { - s := String(v, sep...) - switch strings.ToLower(location) { - case "path": - return pathEscape(s) - case "query": - return queryEscape(s) - default: - return s - } -} - -func pathEscape(s string) string { - return strings.Replace(url.QueryEscape(s), "+", "%20", -1) -} - -func queryEscape(s string) string { - return url.QueryEscape(s) -} - -// ChangeToGet turns the specified http.Request into a GET (it assumes it wasn't). -// This is mainly useful for long-running operations that use the Azure-AsyncOperation -// header, so we change the initial PUT into a GET to retrieve the final result. -func ChangeToGet(req *http.Request) *http.Request { - req.Method = "GET" - req.Body = nil - req.ContentLength = 0 - req.Header.Del("Content-Length") - return req -} - -// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError -// interface. If err is a DetailedError it will walk the chain of Original errors. -func IsTokenRefreshError(err error) bool { - if _, ok := err.(adal.TokenRefreshError); ok { - return true - } - if de, ok := err.(DetailedError); ok { - return IsTokenRefreshError(de.Original) - } - return false -} - -// IsTemporaryNetworkError returns true if the specified error is a temporary network error or false -// if it's not. If the error doesn't implement the net.Error interface the return value is true. -func IsTemporaryNetworkError(err error) bool { - if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) { - return true - } - return false -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go deleted file mode 100644 index 3c645154..00000000 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ /dev/null @@ -1,22 +0,0 @@ -package autorest - -import "github.com/Azure/go-autorest/version" - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Version returns the semantic version (see http://semver.org). -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/go-autorest/logger/logger.go b/vendor/github.com/Azure/go-autorest/logger/logger.go deleted file mode 100644 index 756fd80c..00000000 --- a/vendor/github.com/Azure/go-autorest/logger/logger.go +++ /dev/null @@ -1,328 +0,0 @@ -package logger - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "strings" - "sync" - "time" -) - -// LevelType tells a logger the minimum level to log. When code reports a log entry, -// the LogLevel indicates the level of the log entry. The logger only records entries -// whose level is at least the level it was told to log. See the Log* constants. -// For example, if a logger is configured with LogError, then LogError, LogPanic, -// and LogFatal entries will be logged; lower level entries are ignored. -type LevelType uint32 - -const ( - // LogNone tells a logger not to log any entries passed to it. - LogNone LevelType = iota - - // LogFatal tells a logger to log all LogFatal entries passed to it. - LogFatal - - // LogPanic tells a logger to log all LogPanic and LogFatal entries passed to it. - LogPanic - - // LogError tells a logger to log all LogError, LogPanic and LogFatal entries passed to it. - LogError - - // LogWarning tells a logger to log all LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogWarning - - // LogInfo tells a logger to log all LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogInfo - - // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogDebug -) - -const ( - logNone = "NONE" - logFatal = "FATAL" - logPanic = "PANIC" - logError = "ERROR" - logWarning = "WARNING" - logInfo = "INFO" - logDebug = "DEBUG" - logUnknown = "UNKNOWN" -) - -// ParseLevel converts the specified string into the corresponding LevelType. -func ParseLevel(s string) (lt LevelType, err error) { - switch strings.ToUpper(s) { - case logFatal: - lt = LogFatal - case logPanic: - lt = LogPanic - case logError: - lt = LogError - case logWarning: - lt = LogWarning - case logInfo: - lt = LogInfo - case logDebug: - lt = LogDebug - default: - err = fmt.Errorf("bad log level '%s'", s) - } - return -} - -// String implements the stringer interface for LevelType. -func (lt LevelType) String() string { - switch lt { - case LogNone: - return logNone - case LogFatal: - return logFatal - case LogPanic: - return logPanic - case LogError: - return logError - case LogWarning: - return logWarning - case LogInfo: - return logInfo - case LogDebug: - return logDebug - default: - return logUnknown - } -} - -// Filter defines functions for filtering HTTP request/response content. -type Filter struct { - // URL returns a potentially modified string representation of a request URL. - URL func(u *url.URL) string - - // Header returns a potentially modified set of values for the specified key. - // To completely exclude the header key/values return false. - Header func(key string, val []string) (bool, []string) - - // Body returns a potentially modified request/response body. - Body func(b []byte) []byte -} - -func (f Filter) processURL(u *url.URL) string { - if f.URL == nil { - return u.String() - } - return f.URL(u) -} - -func (f Filter) processHeader(k string, val []string) (bool, []string) { - if f.Header == nil { - return true, val - } - return f.Header(k, val) -} - -func (f Filter) processBody(b []byte) []byte { - if f.Body == nil { - return b - } - return f.Body(b) -} - -// Writer defines methods for writing to a logging facility. -type Writer interface { - // Writeln writes the specified message with the standard log entry header and new-line character. - Writeln(level LevelType, message string) - - // Writef writes the specified format specifier with the standard log entry header and no new-line character. - Writef(level LevelType, format string, a ...interface{}) - - // WriteRequest writes the specified HTTP request to the logger if the log level is greater than - // or equal to LogInfo. The request body, if set, is logged at level LogDebug or higher. - // Custom filters can be specified to exclude URL, header, and/or body content from the log. - // By default no request content is excluded. - WriteRequest(req *http.Request, filter Filter) - - // WriteResponse writes the specified HTTP response to the logger if the log level is greater than - // or equal to LogInfo. The response body, if set, is logged at level LogDebug or higher. - // Custom filters can be specified to exclude URL, header, and/or body content from the log. - // By default no respone content is excluded. - WriteResponse(resp *http.Response, filter Filter) -} - -// Instance is the default log writer initialized during package init. -// This can be replaced with a custom implementation as required. -var Instance Writer - -// default log level -var logLevel = LogNone - -// Level returns the value specified in AZURE_GO_AUTOREST_LOG_LEVEL. -// If no value was specified the default value is LogNone. -// Custom loggers can call this to retrieve the configured log level. -func Level() LevelType { - return logLevel -} - -func init() { - // separated for testing purposes - initDefaultLogger() -} - -func initDefaultLogger() { - // init with nilLogger so callers don't have to do a nil check on Default - Instance = nilLogger{} - llStr := strings.ToLower(os.Getenv("AZURE_GO_SDK_LOG_LEVEL")) - if llStr == "" { - return - } - var err error - logLevel, err = ParseLevel(llStr) - if err != nil { - fmt.Fprintf(os.Stderr, "go-autorest: failed to parse log level: %s\n", err.Error()) - return - } - if logLevel == LogNone { - return - } - // default to stderr - dest := os.Stderr - lfStr := os.Getenv("AZURE_GO_SDK_LOG_FILE") - if strings.EqualFold(lfStr, "stdout") { - dest = os.Stdout - } else if lfStr != "" { - lf, err := os.Create(lfStr) - if err == nil { - dest = lf - } else { - fmt.Fprintf(os.Stderr, "go-autorest: failed to create log file, using stderr: %s\n", err.Error()) - } - } - Instance = fileLogger{ - logLevel: logLevel, - mu: &sync.Mutex{}, - logFile: dest, - } -} - -// the nil logger does nothing -type nilLogger struct{} - -func (nilLogger) Writeln(LevelType, string) {} - -func (nilLogger) Writef(LevelType, string, ...interface{}) {} - -func (nilLogger) WriteRequest(*http.Request, Filter) {} - -func (nilLogger) WriteResponse(*http.Response, Filter) {} - -// A File is used instead of a Logger so the stream can be flushed after every write. -type fileLogger struct { - logLevel LevelType - mu *sync.Mutex // for synchronizing writes to logFile - logFile *os.File -} - -func (fl fileLogger) Writeln(level LevelType, message string) { - fl.Writef(level, "%s\n", message) -} - -func (fl fileLogger) Writef(level LevelType, format string, a ...interface{}) { - if fl.logLevel >= level { - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprintf(fl.logFile, "%s %s", entryHeader(level), fmt.Sprintf(format, a...)) - fl.logFile.Sync() - } -} - -func (fl fileLogger) WriteRequest(req *http.Request, filter Filter) { - if req == nil || fl.logLevel < LogInfo { - return - } - b := &bytes.Buffer{} - fmt.Fprintf(b, "%s REQUEST: %s %s\n", entryHeader(LogInfo), req.Method, filter.processURL(req.URL)) - // dump headers - for k, v := range req.Header { - if ok, mv := filter.processHeader(k, v); ok { - fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ",")) - } - } - if fl.shouldLogBody(req.Header, req.Body) { - // dump body - body, err := ioutil.ReadAll(req.Body) - if err == nil { - fmt.Fprintln(b, string(filter.processBody(body))) - if nc, ok := req.Body.(io.Seeker); ok { - // rewind to the beginning - nc.Seek(0, io.SeekStart) - } else { - // recreate the body - req.Body = ioutil.NopCloser(bytes.NewReader(body)) - } - } else { - fmt.Fprintf(b, "failed to read body: %v\n", err) - } - } - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprint(fl.logFile, b.String()) - fl.logFile.Sync() -} - -func (fl fileLogger) WriteResponse(resp *http.Response, filter Filter) { - if resp == nil || fl.logLevel < LogInfo { - return - } - b := &bytes.Buffer{} - fmt.Fprintf(b, "%s RESPONSE: %d %s\n", entryHeader(LogInfo), resp.StatusCode, filter.processURL(resp.Request.URL)) - // dump headers - for k, v := range resp.Header { - if ok, mv := filter.processHeader(k, v); ok { - fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ",")) - } - } - if fl.shouldLogBody(resp.Header, resp.Body) { - // dump body - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err == nil { - fmt.Fprintln(b, string(filter.processBody(body))) - resp.Body = ioutil.NopCloser(bytes.NewReader(body)) - } else { - fmt.Fprintf(b, "failed to read body: %v\n", err) - } - } - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprint(fl.logFile, b.String()) - fl.logFile.Sync() -} - -// returns true if the provided body should be included in the log -func (fl fileLogger) shouldLogBody(header http.Header, body io.ReadCloser) bool { - ct := header.Get("Content-Type") - return fl.logLevel >= LogDebug && body != nil && strings.Index(ct, "application/octet-stream") == -1 -} - -// creates standard header for log entries, it contains a timestamp and the log level -func entryHeader(level LevelType) string { - // this format provides a fixed number of digits so the size of the timestamp is constant - return fmt.Sprintf("(%s) %s:", time.Now().Format("2006-01-02T15:04:05.0000000Z07:00"), level.String()) -} diff --git a/vendor/github.com/Azure/go-autorest/version/version.go b/vendor/github.com/Azure/go-autorest/version/version.go deleted file mode 100644 index c9876a9b..00000000 --- a/vendor/github.com/Azure/go-autorest/version/version.go +++ /dev/null @@ -1,37 +0,0 @@ -package version - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "runtime" -) - -// Number contains the semantic version of this SDK. -const Number = "v11.1.2" - -var ( - userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s", - runtime.Version(), - runtime.GOARCH, - runtime.GOOS, - Number, - ) -) - -// UserAgent returns a string containing the Go version, system archityecture and OS, and the go-autorest version. -func UserAgent() string { - return userAgent -} diff --git a/vendor/github.com/Microsoft/go-winio/.gitignore b/vendor/github.com/Microsoft/go-winio/.gitignore deleted file mode 100644 index b883f1fd..00000000 --- a/vendor/github.com/Microsoft/go-winio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.exe diff --git a/vendor/github.com/Microsoft/go-winio/LICENSE b/vendor/github.com/Microsoft/go-winio/LICENSE deleted file mode 100644 index b8b569d7..00000000 --- a/vendor/github.com/Microsoft/go-winio/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft - -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. - diff --git a/vendor/github.com/Microsoft/go-winio/README.md b/vendor/github.com/Microsoft/go-winio/README.md deleted file mode 100644 index 56800105..00000000 --- a/vendor/github.com/Microsoft/go-winio/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# go-winio - -This repository contains utilities for efficiently performing Win32 IO operations in -Go. Currently, this is focused on accessing named pipes and other file handles, and -for using named pipes as a net transport. - -This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go -to reuse the thread to schedule another goroutine. This limits support to Windows Vista and -newer operating systems. This is similar to the implementation of network sockets in Go's net -package. - -Please see the LICENSE file for licensing information. - -This project has adopted the [Microsoft Open Source Code of -Conduct](https://opensource.microsoft.com/codeofconduct/). For more information -see the [Code of Conduct -FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional -questions or comments. - -Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe -for another named pipe implementation. diff --git a/vendor/github.com/Microsoft/go-winio/backup.go b/vendor/github.com/Microsoft/go-winio/backup.go deleted file mode 100644 index 2be34af4..00000000 --- a/vendor/github.com/Microsoft/go-winio/backup.go +++ /dev/null @@ -1,280 +0,0 @@ -// +build windows - -package winio - -import ( - "encoding/binary" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "runtime" - "syscall" - "unicode/utf16" -) - -//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead -//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite - -const ( - BackupData = uint32(iota + 1) - BackupEaData - BackupSecurity - BackupAlternateData - BackupLink - BackupPropertyData - BackupObjectId - BackupReparseData - BackupSparseBlock - BackupTxfsData -) - -const ( - StreamSparseAttributes = uint32(8) -) - -const ( - WRITE_DAC = 0x40000 - WRITE_OWNER = 0x80000 - ACCESS_SYSTEM_SECURITY = 0x1000000 -) - -// BackupHeader represents a backup stream of a file. -type BackupHeader struct { - Id uint32 // The backup stream ID - Attributes uint32 // Stream attributes - Size int64 // The size of the stream in bytes - Name string // The name of the stream (for BackupAlternateData only). - Offset int64 // The offset of the stream in the file (for BackupSparseBlock only). -} - -type win32StreamId struct { - StreamId uint32 - Attributes uint32 - Size uint64 - NameSize uint32 -} - -// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series -// of BackupHeader values. -type BackupStreamReader struct { - r io.Reader - bytesLeft int64 -} - -// NewBackupStreamReader produces a BackupStreamReader from any io.Reader. -func NewBackupStreamReader(r io.Reader) *BackupStreamReader { - return &BackupStreamReader{r, 0} -} - -// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if -// it was not completely read. -func (r *BackupStreamReader) Next() (*BackupHeader, error) { - if r.bytesLeft > 0 { - if s, ok := r.r.(io.Seeker); ok { - // Make sure Seek on io.SeekCurrent sometimes succeeds - // before trying the actual seek. - if _, err := s.Seek(0, io.SeekCurrent); err == nil { - if _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil { - return nil, err - } - r.bytesLeft = 0 - } - } - if _, err := io.Copy(ioutil.Discard, r); err != nil { - return nil, err - } - } - var wsi win32StreamId - if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil { - return nil, err - } - hdr := &BackupHeader{ - Id: wsi.StreamId, - Attributes: wsi.Attributes, - Size: int64(wsi.Size), - } - if wsi.NameSize != 0 { - name := make([]uint16, int(wsi.NameSize/2)) - if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { - return nil, err - } - hdr.Name = syscall.UTF16ToString(name) - } - if wsi.StreamId == BackupSparseBlock { - if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { - return nil, err - } - hdr.Size -= 8 - } - r.bytesLeft = hdr.Size - return hdr, nil -} - -// Read reads from the current backup stream. -func (r *BackupStreamReader) Read(b []byte) (int, error) { - if r.bytesLeft == 0 { - return 0, io.EOF - } - if int64(len(b)) > r.bytesLeft { - b = b[:r.bytesLeft] - } - n, err := r.r.Read(b) - r.bytesLeft -= int64(n) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } else if r.bytesLeft == 0 && err == nil { - err = io.EOF - } - return n, err -} - -// BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API. -type BackupStreamWriter struct { - w io.Writer - bytesLeft int64 -} - -// NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer. -func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter { - return &BackupStreamWriter{w, 0} -} - -// WriteHeader writes the next backup stream header and prepares for calls to Write(). -func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error { - if w.bytesLeft != 0 { - return fmt.Errorf("missing %d bytes", w.bytesLeft) - } - name := utf16.Encode([]rune(hdr.Name)) - wsi := win32StreamId{ - StreamId: hdr.Id, - Attributes: hdr.Attributes, - Size: uint64(hdr.Size), - NameSize: uint32(len(name) * 2), - } - if hdr.Id == BackupSparseBlock { - // Include space for the int64 block offset - wsi.Size += 8 - } - if err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil { - return err - } - if len(name) != 0 { - if err := binary.Write(w.w, binary.LittleEndian, name); err != nil { - return err - } - } - if hdr.Id == BackupSparseBlock { - if err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil { - return err - } - } - w.bytesLeft = hdr.Size - return nil -} - -// Write writes to the current backup stream. -func (w *BackupStreamWriter) Write(b []byte) (int, error) { - if w.bytesLeft < int64(len(b)) { - return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft) - } - n, err := w.w.Write(b) - w.bytesLeft -= int64(n) - return n, err -} - -// BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API. -type BackupFileReader struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true, -// Read will attempt to read the security descriptor of the file. -func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { - r := &BackupFileReader{f, includeSecurity, 0} - return r -} - -// Read reads a backup stream from the file by calling the Win32 API BackupRead(). -func (r *BackupFileReader) Read(b []byte) (int, error) { - var bytesRead uint32 - err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) - if err != nil { - return 0, &os.PathError{"BackupRead", r.f.Name(), err} - } - runtime.KeepAlive(r.f) - if bytesRead == 0 { - return 0, io.EOF - } - return int(bytesRead), nil -} - -// Close frees Win32 resources associated with the BackupFileReader. It does not close -// the underlying file. -func (r *BackupFileReader) Close() error { - if r.ctx != 0 { - backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) - runtime.KeepAlive(r.f) - r.ctx = 0 - } - return nil -} - -// BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API. -type BackupFileWriter struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true, -// Write() will attempt to restore the security descriptor from the stream. -func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { - w := &BackupFileWriter{f, includeSecurity, 0} - return w -} - -// Write restores a portion of the file using the provided backup stream. -func (w *BackupFileWriter) Write(b []byte) (int, error) { - var bytesWritten uint32 - err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) - if err != nil { - return 0, &os.PathError{"BackupWrite", w.f.Name(), err} - } - runtime.KeepAlive(w.f) - if int(bytesWritten) != len(b) { - return int(bytesWritten), errors.New("not all bytes could be written") - } - return len(b), nil -} - -// Close frees Win32 resources associated with the BackupFileWriter. It does not -// close the underlying file. -func (w *BackupFileWriter) Close() error { - if w.ctx != 0 { - backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) - runtime.KeepAlive(w.f) - w.ctx = 0 - } - return nil -} - -// OpenForBackup opens a file or directory, potentially skipping access checks if the backup -// or restore privileges have been acquired. -// -// If the file opened was a directory, it cannot be used with Readdir(). -func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { - winPath, err := syscall.UTF16FromString(path) - if err != nil { - return nil, err - } - h, err := syscall.CreateFile(&winPath[0], access, share, nil, createmode, syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, 0) - if err != nil { - err = &os.PathError{Op: "open", Path: path, Err: err} - return nil, err - } - return os.NewFile(uintptr(h), path), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/ea.go b/vendor/github.com/Microsoft/go-winio/ea.go deleted file mode 100644 index 4051c1b3..00000000 --- a/vendor/github.com/Microsoft/go-winio/ea.go +++ /dev/null @@ -1,137 +0,0 @@ -package winio - -import ( - "bytes" - "encoding/binary" - "errors" -) - -type fileFullEaInformation struct { - NextEntryOffset uint32 - Flags uint8 - NameLength uint8 - ValueLength uint16 -} - -var ( - fileFullEaInformationSize = binary.Size(&fileFullEaInformation{}) - - errInvalidEaBuffer = errors.New("invalid extended attribute buffer") - errEaNameTooLarge = errors.New("extended attribute name too large") - errEaValueTooLarge = errors.New("extended attribute value too large") -) - -// ExtendedAttribute represents a single Windows EA. -type ExtendedAttribute struct { - Name string - Value []byte - Flags uint8 -} - -func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) { - var info fileFullEaInformation - err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info) - if err != nil { - err = errInvalidEaBuffer - return - } - - nameOffset := fileFullEaInformationSize - nameLen := int(info.NameLength) - valueOffset := nameOffset + int(info.NameLength) + 1 - valueLen := int(info.ValueLength) - nextOffset := int(info.NextEntryOffset) - if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) { - err = errInvalidEaBuffer - return - } - - ea.Name = string(b[nameOffset : nameOffset+nameLen]) - ea.Value = b[valueOffset : valueOffset+valueLen] - ea.Flags = info.Flags - if info.NextEntryOffset != 0 { - nb = b[info.NextEntryOffset:] - } - return -} - -// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION -// buffer retrieved from BackupRead, ZwQueryEaFile, etc. -func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) { - for len(b) != 0 { - ea, nb, err := parseEa(b) - if err != nil { - return nil, err - } - - eas = append(eas, ea) - b = nb - } - return -} - -func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error { - if int(uint8(len(ea.Name))) != len(ea.Name) { - return errEaNameTooLarge - } - if int(uint16(len(ea.Value))) != len(ea.Value) { - return errEaValueTooLarge - } - entrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value)) - withPadding := (entrySize + 3) &^ 3 - nextOffset := uint32(0) - if !last { - nextOffset = withPadding - } - info := fileFullEaInformation{ - NextEntryOffset: nextOffset, - Flags: ea.Flags, - NameLength: uint8(len(ea.Name)), - ValueLength: uint16(len(ea.Value)), - } - - err := binary.Write(buf, binary.LittleEndian, &info) - if err != nil { - return err - } - - _, err = buf.Write([]byte(ea.Name)) - if err != nil { - return err - } - - err = buf.WriteByte(0) - if err != nil { - return err - } - - _, err = buf.Write(ea.Value) - if err != nil { - return err - } - - _, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize]) - if err != nil { - return err - } - - return nil -} - -// EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION -// buffer for use with BackupWrite, ZwSetEaFile, etc. -func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) { - var buf bytes.Buffer - for i := range eas { - last := false - if i == len(eas)-1 { - last = true - } - - err := writeEa(&buf, &eas[i], last) - if err != nil { - return nil, err - } - } - return buf.Bytes(), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/file.go b/vendor/github.com/Microsoft/go-winio/file.go deleted file mode 100644 index 0385e410..00000000 --- a/vendor/github.com/Microsoft/go-winio/file.go +++ /dev/null @@ -1,323 +0,0 @@ -// +build windows - -package winio - -import ( - "errors" - "io" - "runtime" - "sync" - "sync/atomic" - "syscall" - "time" -) - -//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx -//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort -//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus -//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes -//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult - -type atomicBool int32 - -func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } -func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } -func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } -func (b *atomicBool) swap(new bool) bool { - var newInt int32 - if new { - newInt = 1 - } - return atomic.SwapInt32((*int32)(b), newInt) == 1 -} - -const ( - cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 - cFILE_SKIP_SET_EVENT_ON_HANDLE = 2 -) - -var ( - ErrFileClosed = errors.New("file has already been closed") - ErrTimeout = &timeoutError{} -) - -type timeoutError struct{} - -func (e *timeoutError) Error() string { return "i/o timeout" } -func (e *timeoutError) Timeout() bool { return true } -func (e *timeoutError) Temporary() bool { return true } - -type timeoutChan chan struct{} - -var ioInitOnce sync.Once -var ioCompletionPort syscall.Handle - -// ioResult contains the result of an asynchronous IO operation -type ioResult struct { - bytes uint32 - err error -} - -// ioOperation represents an outstanding asynchronous Win32 IO -type ioOperation struct { - o syscall.Overlapped - ch chan ioResult -} - -func initIo() { - h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff) - if err != nil { - panic(err) - } - ioCompletionPort = h - go ioCompletionProcessor(h) -} - -// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. -// It takes ownership of this handle and will close it if it is garbage collected. -type win32File struct { - handle syscall.Handle - wg sync.WaitGroup - wgLock sync.RWMutex - closing atomicBool - socket bool - readDeadline deadlineHandler - writeDeadline deadlineHandler -} - -type deadlineHandler struct { - setLock sync.Mutex - channel timeoutChan - channelLock sync.RWMutex - timer *time.Timer - timedout atomicBool -} - -// makeWin32File makes a new win32File from an existing file handle -func makeWin32File(h syscall.Handle) (*win32File, error) { - f := &win32File{handle: h} - ioInitOnce.Do(initIo) - _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) - if err != nil { - return nil, err - } - err = setFileCompletionNotificationModes(h, cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS|cFILE_SKIP_SET_EVENT_ON_HANDLE) - if err != nil { - return nil, err - } - f.readDeadline.channel = make(timeoutChan) - f.writeDeadline.channel = make(timeoutChan) - return f, nil -} - -func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { - // If we return the result of makeWin32File directly, it can result in an - // interface-wrapped nil, rather than a nil interface value. - f, err := makeWin32File(h) - if err != nil { - return nil, err - } - return f, nil -} - -// closeHandle closes the resources associated with a Win32 handle -func (f *win32File) closeHandle() { - f.wgLock.Lock() - // Atomically set that we are closing, releasing the resources only once. - if !f.closing.swap(true) { - f.wgLock.Unlock() - // cancel all IO and wait for it to complete - cancelIoEx(f.handle, nil) - f.wg.Wait() - // at this point, no new IO can start - syscall.Close(f.handle) - f.handle = 0 - } else { - f.wgLock.Unlock() - } -} - -// Close closes a win32File. -func (f *win32File) Close() error { - f.closeHandle() - return nil -} - -// prepareIo prepares for a new IO operation. -// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. -func (f *win32File) prepareIo() (*ioOperation, error) { - f.wgLock.RLock() - if f.closing.isSet() { - f.wgLock.RUnlock() - return nil, ErrFileClosed - } - f.wg.Add(1) - f.wgLock.RUnlock() - c := &ioOperation{} - c.ch = make(chan ioResult) - return c, nil -} - -// ioCompletionProcessor processes completed async IOs forever -func ioCompletionProcessor(h syscall.Handle) { - for { - var bytes uint32 - var key uintptr - var op *ioOperation - err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE) - if op == nil { - panic(err) - } - op.ch <- ioResult{bytes, err} - } -} - -// asyncIo processes the return value from ReadFile or WriteFile, blocking until -// the operation has actually completed. -func (f *win32File) asyncIo(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { - if err != syscall.ERROR_IO_PENDING { - return int(bytes), err - } - - if f.closing.isSet() { - cancelIoEx(f.handle, &c.o) - } - - var timeout timeoutChan - if d != nil { - d.channelLock.Lock() - timeout = d.channel - d.channelLock.Unlock() - } - - var r ioResult - select { - case r = <-c.ch: - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { - if f.closing.isSet() { - err = ErrFileClosed - } - } else if err != nil && f.socket { - // err is from Win32. Query the overlapped structure to get the winsock error. - var bytes, flags uint32 - err = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags) - } - case <-timeout: - cancelIoEx(f.handle, &c.o) - r = <-c.ch - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { - err = ErrTimeout - } - } - - // runtime.KeepAlive is needed, as c is passed via native - // code to ioCompletionProcessor, c must remain alive - // until the channel read is complete. - runtime.KeepAlive(c) - return int(r.bytes), err -} - -// Read reads from a file handle. -func (f *win32File) Read(b []byte) (int, error) { - c, err := f.prepareIo() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.readDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.ReadFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIo(c, &f.readDeadline, bytes, err) - runtime.KeepAlive(b) - - // Handle EOF conditions. - if err == nil && n == 0 && len(b) != 0 { - return 0, io.EOF - } else if err == syscall.ERROR_BROKEN_PIPE { - return 0, io.EOF - } else { - return n, err - } -} - -// Write writes to a file handle. -func (f *win32File) Write(b []byte) (int, error) { - c, err := f.prepareIo() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.writeDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.WriteFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIo(c, &f.writeDeadline, bytes, err) - runtime.KeepAlive(b) - return n, err -} - -func (f *win32File) SetReadDeadline(deadline time.Time) error { - return f.readDeadline.set(deadline) -} - -func (f *win32File) SetWriteDeadline(deadline time.Time) error { - return f.writeDeadline.set(deadline) -} - -func (f *win32File) Flush() error { - return syscall.FlushFileBuffers(f.handle) -} - -func (f *win32File) Fd() uintptr { - return uintptr(f.handle) -} - -func (d *deadlineHandler) set(deadline time.Time) error { - d.setLock.Lock() - defer d.setLock.Unlock() - - if d.timer != nil { - if !d.timer.Stop() { - <-d.channel - } - d.timer = nil - } - d.timedout.setFalse() - - select { - case <-d.channel: - d.channelLock.Lock() - d.channel = make(chan struct{}) - d.channelLock.Unlock() - default: - } - - if deadline.IsZero() { - return nil - } - - timeoutIO := func() { - d.timedout.setTrue() - close(d.channel) - } - - now := time.Now() - duration := deadline.Sub(now) - if deadline.After(now) { - // Deadline is in the future, set a timer to wait - d.timer = time.AfterFunc(duration, timeoutIO) - } else { - // Deadline is in the past. Cancel all pending IO now. - timeoutIO() - } - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/fileinfo.go b/vendor/github.com/Microsoft/go-winio/fileinfo.go deleted file mode 100644 index ada2fbab..00000000 --- a/vendor/github.com/Microsoft/go-winio/fileinfo.go +++ /dev/null @@ -1,61 +0,0 @@ -// +build windows - -package winio - -import ( - "os" - "runtime" - "syscall" - "unsafe" -) - -//sys getFileInformationByHandleEx(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) = GetFileInformationByHandleEx -//sys setFileInformationByHandle(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) = SetFileInformationByHandle - -const ( - fileBasicInfo = 0 - fileIDInfo = 0x12 -) - -// FileBasicInfo contains file access time and file attributes information. -type FileBasicInfo struct { - CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime - FileAttributes uint32 - pad uint32 // padding -} - -// GetFileBasicInfo retrieves times and attributes for a file. -func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { - bi := &FileBasicInfo{} - if err := getFileInformationByHandleEx(syscall.Handle(f.Fd()), fileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return bi, nil -} - -// SetFileBasicInfo sets times and attributes for a file. -func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { - if err := setFileInformationByHandle(syscall.Handle(f.Fd()), fileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil { - return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return nil -} - -// FileIDInfo contains the volume serial number and file ID for a file. This pair should be -// unique on a system. -type FileIDInfo struct { - VolumeSerialNumber uint64 - FileID [16]byte -} - -// GetFileID retrieves the unique (volume, file ID) pair for a file. -func GetFileID(f *os.File) (*FileIDInfo, error) { - fileID := &FileIDInfo{} - if err := getFileInformationByHandleEx(syscall.Handle(f.Fd()), fileIDInfo, (*byte)(unsafe.Pointer(fileID)), uint32(unsafe.Sizeof(*fileID))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return fileID, nil -} diff --git a/vendor/github.com/Microsoft/go-winio/go.mod b/vendor/github.com/Microsoft/go-winio/go.mod deleted file mode 100644 index b3846826..00000000 --- a/vendor/github.com/Microsoft/go-winio/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/Microsoft/go-winio - -go 1.12 - -require ( - github.com/pkg/errors v0.8.1 - github.com/sirupsen/logrus v1.4.1 - golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b -) diff --git a/vendor/github.com/Microsoft/go-winio/go.sum b/vendor/github.com/Microsoft/go-winio/go.sum deleted file mode 100644 index babb4a70..00000000 --- a/vendor/github.com/Microsoft/go-winio/go.sum +++ /dev/null @@ -1,16 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/Microsoft/go-winio/hvsock.go b/vendor/github.com/Microsoft/go-winio/hvsock.go deleted file mode 100644 index dbfe790e..00000000 --- a/vendor/github.com/Microsoft/go-winio/hvsock.go +++ /dev/null @@ -1,305 +0,0 @@ -package winio - -import ( - "fmt" - "io" - "net" - "os" - "syscall" - "time" - "unsafe" - - "github.com/Microsoft/go-winio/pkg/guid" -) - -//sys bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind - -const ( - afHvSock = 34 // AF_HYPERV - - socketError = ^uintptr(0) -) - -// An HvsockAddr is an address for a AF_HYPERV socket. -type HvsockAddr struct { - VMID guid.GUID - ServiceID guid.GUID -} - -type rawHvsockAddr struct { - Family uint16 - _ uint16 - VMID guid.GUID - ServiceID guid.GUID -} - -// Network returns the address's network name, "hvsock". -func (addr *HvsockAddr) Network() string { - return "hvsock" -} - -func (addr *HvsockAddr) String() string { - return fmt.Sprintf("%s:%s", &addr.VMID, &addr.ServiceID) -} - -// VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port. -func VsockServiceID(port uint32) guid.GUID { - g, _ := guid.FromString("00000000-facb-11e6-bd58-64006a7986d3") - g.Data1 = port - return g -} - -func (addr *HvsockAddr) raw() rawHvsockAddr { - return rawHvsockAddr{ - Family: afHvSock, - VMID: addr.VMID, - ServiceID: addr.ServiceID, - } -} - -func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) { - addr.VMID = raw.VMID - addr.ServiceID = raw.ServiceID -} - -// HvsockListener is a socket listener for the AF_HYPERV address family. -type HvsockListener struct { - sock *win32File - addr HvsockAddr -} - -// HvsockConn is a connected socket of the AF_HYPERV address family. -type HvsockConn struct { - sock *win32File - local, remote HvsockAddr -} - -func newHvSocket() (*win32File, error) { - fd, err := syscall.Socket(afHvSock, syscall.SOCK_STREAM, 1) - if err != nil { - return nil, os.NewSyscallError("socket", err) - } - f, err := makeWin32File(fd) - if err != nil { - syscall.Close(fd) - return nil, err - } - f.socket = true - return f, nil -} - -// ListenHvsock listens for connections on the specified hvsock address. -func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { - l := &HvsockListener{addr: *addr} - sock, err := newHvSocket() - if err != nil { - return nil, l.opErr("listen", err) - } - sa := addr.raw() - err = bind(sock.handle, unsafe.Pointer(&sa), int32(unsafe.Sizeof(sa))) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("socket", err)) - } - err = syscall.Listen(sock.handle, 16) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("listen", err)) - } - return &HvsockListener{sock: sock, addr: *addr}, nil -} - -func (l *HvsockListener) opErr(op string, err error) error { - return &net.OpError{Op: op, Net: "hvsock", Addr: &l.addr, Err: err} -} - -// Addr returns the listener's network address. -func (l *HvsockListener) Addr() net.Addr { - return &l.addr -} - -// Accept waits for the next connection and returns it. -func (l *HvsockListener) Accept() (_ net.Conn, err error) { - sock, err := newHvSocket() - if err != nil { - return nil, l.opErr("accept", err) - } - defer func() { - if sock != nil { - sock.Close() - } - }() - c, err := l.sock.prepareIo() - if err != nil { - return nil, l.opErr("accept", err) - } - defer l.sock.wg.Done() - - // AcceptEx, per documentation, requires an extra 16 bytes per address. - const addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{})) - var addrbuf [addrlen * 2]byte - - var bytes uint32 - err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0, addrlen, addrlen, &bytes, &c.o) - _, err = l.sock.asyncIo(c, nil, bytes, err) - if err != nil { - return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) - } - conn := &HvsockConn{ - sock: sock, - } - conn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0]))) - conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) - sock = nil - return conn, nil -} - -// Close closes the listener, causing any pending Accept calls to fail. -func (l *HvsockListener) Close() error { - return l.sock.Close() -} - -/* Need to finish ConnectEx handling -func DialHvsock(ctx context.Context, addr *HvsockAddr) (*HvsockConn, error) { - sock, err := newHvSocket() - if err != nil { - return nil, err - } - defer func() { - if sock != nil { - sock.Close() - } - }() - c, err := sock.prepareIo() - if err != nil { - return nil, err - } - defer sock.wg.Done() - var bytes uint32 - err = windows.ConnectEx(windows.Handle(sock.handle), sa, nil, 0, &bytes, &c.o) - _, err = sock.asyncIo(ctx, c, nil, bytes, err) - if err != nil { - return nil, err - } - conn := &HvsockConn{ - sock: sock, - remote: *addr, - } - sock = nil - return conn, nil -} -*/ - -func (conn *HvsockConn) opErr(op string, err error) error { - return &net.OpError{Op: op, Net: "hvsock", Source: &conn.local, Addr: &conn.remote, Err: err} -} - -func (conn *HvsockConn) Read(b []byte) (int, error) { - c, err := conn.sock.prepareIo() - if err != nil { - return 0, conn.opErr("read", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var flags, bytes uint32 - err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) - n, err := conn.sock.asyncIo(c, &conn.sock.readDeadline, bytes, err) - if err != nil { - if _, ok := err.(syscall.Errno); ok { - err = os.NewSyscallError("wsarecv", err) - } - return 0, conn.opErr("read", err) - } else if n == 0 { - err = io.EOF - } - return n, err -} - -func (conn *HvsockConn) Write(b []byte) (int, error) { - t := 0 - for len(b) != 0 { - n, err := conn.write(b) - if err != nil { - return t + n, err - } - t += n - b = b[n:] - } - return t, nil -} - -func (conn *HvsockConn) write(b []byte) (int, error) { - c, err := conn.sock.prepareIo() - if err != nil { - return 0, conn.opErr("write", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var bytes uint32 - err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) - n, err := conn.sock.asyncIo(c, &conn.sock.writeDeadline, bytes, err) - if err != nil { - if _, ok := err.(syscall.Errno); ok { - err = os.NewSyscallError("wsasend", err) - } - return 0, conn.opErr("write", err) - } - return n, err -} - -// Close closes the socket connection, failing any pending read or write calls. -func (conn *HvsockConn) Close() error { - return conn.sock.Close() -} - -func (conn *HvsockConn) shutdown(how int) error { - err := syscall.Shutdown(conn.sock.handle, syscall.SHUT_RD) - if err != nil { - return os.NewSyscallError("shutdown", err) - } - return nil -} - -// CloseRead shuts down the read end of the socket. -func (conn *HvsockConn) CloseRead() error { - err := conn.shutdown(syscall.SHUT_RD) - if err != nil { - return conn.opErr("close", err) - } - return nil -} - -// CloseWrite shuts down the write end of the socket, notifying the other endpoint that -// no more data will be written. -func (conn *HvsockConn) CloseWrite() error { - err := conn.shutdown(syscall.SHUT_WR) - if err != nil { - return conn.opErr("close", err) - } - return nil -} - -// LocalAddr returns the local address of the connection. -func (conn *HvsockConn) LocalAddr() net.Addr { - return &conn.local -} - -// RemoteAddr returns the remote address of the connection. -func (conn *HvsockConn) RemoteAddr() net.Addr { - return &conn.remote -} - -// SetDeadline implements the net.Conn SetDeadline method. -func (conn *HvsockConn) SetDeadline(t time.Time) error { - conn.SetReadDeadline(t) - conn.SetWriteDeadline(t) - return nil -} - -// SetReadDeadline implements the net.Conn SetReadDeadline method. -func (conn *HvsockConn) SetReadDeadline(t time.Time) error { - return conn.sock.SetReadDeadline(t) -} - -// SetWriteDeadline implements the net.Conn SetWriteDeadline method. -func (conn *HvsockConn) SetWriteDeadline(t time.Time) error { - return conn.sock.SetWriteDeadline(t) -} diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go deleted file mode 100644 index d6a46f6a..00000000 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ /dev/null @@ -1,510 +0,0 @@ -// +build windows - -package winio - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "os" - "runtime" - "syscall" - "time" - "unsafe" -) - -//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe -//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW -//sys createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateFileW -//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo -//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW -//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc -//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) = ntdll.NtCreateNamedPipeFile -//sys rtlNtStatusToDosError(status ntstatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb -//sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) = ntdll.RtlDosPathNameToNtPathName_U -//sys rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) = ntdll.RtlDefaultNpAcl - -type ioStatusBlock struct { - Status, Information uintptr -} - -type objectAttributes struct { - Length uintptr - RootDirectory uintptr - ObjectName *unicodeString - Attributes uintptr - SecurityDescriptor *securityDescriptor - SecurityQoS uintptr -} - -type unicodeString struct { - Length uint16 - MaximumLength uint16 - Buffer uintptr -} - -type securityDescriptor struct { - Revision byte - Sbz1 byte - Control uint16 - Owner uintptr - Group uintptr - Sacl uintptr - Dacl uintptr -} - -type ntstatus int32 - -func (status ntstatus) Err() error { - if status >= 0 { - return nil - } - return rtlNtStatusToDosError(status) -} - -const ( - cERROR_PIPE_BUSY = syscall.Errno(231) - cERROR_NO_DATA = syscall.Errno(232) - cERROR_PIPE_CONNECTED = syscall.Errno(535) - cERROR_SEM_TIMEOUT = syscall.Errno(121) - - cSECURITY_SQOS_PRESENT = 0x100000 - cSECURITY_ANONYMOUS = 0 - - cPIPE_TYPE_MESSAGE = 4 - - cPIPE_READMODE_MESSAGE = 2 - - cFILE_OPEN = 1 - cFILE_CREATE = 2 - - cFILE_PIPE_MESSAGE_TYPE = 1 - cFILE_PIPE_REJECT_REMOTE_CLIENTS = 2 - - cSE_DACL_PRESENT = 4 -) - -var ( - // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. - // This error should match net.errClosing since docker takes a dependency on its text. - ErrPipeListenerClosed = errors.New("use of closed network connection") - - errPipeWriteClosed = errors.New("pipe has been closed for write") -) - -type win32Pipe struct { - *win32File - path string -} - -type win32MessageBytePipe struct { - win32Pipe - writeClosed bool - readEOF bool -} - -type pipeAddress string - -func (f *win32Pipe) LocalAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) RemoteAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) SetDeadline(t time.Time) error { - f.SetReadDeadline(t) - f.SetWriteDeadline(t) - return nil -} - -// CloseWrite closes the write side of a message pipe in byte mode. -func (f *win32MessageBytePipe) CloseWrite() error { - if f.writeClosed { - return errPipeWriteClosed - } - err := f.win32File.Flush() - if err != nil { - return err - } - _, err = f.win32File.Write(nil) - if err != nil { - return err - } - f.writeClosed = true - return nil -} - -// Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since -// they are used to implement CloseWrite(). -func (f *win32MessageBytePipe) Write(b []byte) (int, error) { - if f.writeClosed { - return 0, errPipeWriteClosed - } - if len(b) == 0 { - return 0, nil - } - return f.win32File.Write(b) -} - -// Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message -// mode pipe will return io.EOF, as will all subsequent reads. -func (f *win32MessageBytePipe) Read(b []byte) (int, error) { - if f.readEOF { - return 0, io.EOF - } - n, err := f.win32File.Read(b) - if err == io.EOF { - // If this was the result of a zero-byte read, then - // it is possible that the read was due to a zero-size - // message. Since we are simulating CloseWrite with a - // zero-byte message, ensure that all future Read() calls - // also return EOF. - f.readEOF = true - } else if err == syscall.ERROR_MORE_DATA { - // ERROR_MORE_DATA indicates that the pipe's read mode is message mode - // and the message still has more bytes. Treat this as a success, since - // this package presents all named pipes as byte streams. - err = nil - } - return n, err -} - -func (s pipeAddress) Network() string { - return "pipe" -} - -func (s pipeAddress) String() string { - return string(s) -} - -// tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) { - for { - select { - case <-ctx.Done(): - return syscall.Handle(0), ctx.Err() - default: - h, err := createFile(*path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRESENT|cSECURITY_ANONYMOUS, 0) - if err == nil { - return h, nil - } - if err != cERROR_PIPE_BUSY { - return h, &os.PathError{Err: err, Op: "open", Path: *path} - } - // Wait 10 msec and try again. This is a rather simplistic - // view, as we always try each 10 milliseconds. - time.Sleep(time.Millisecond * 10) - } - } -} - -// DialPipe connects to a named pipe by path, timing out if the connection -// takes longer than the specified duration. If timeout is nil, then we use -// a default timeout of 2 seconds. (We do not use WaitNamedPipe.) -func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { - var absTimeout time.Time - if timeout != nil { - absTimeout = time.Now().Add(*timeout) - } else { - absTimeout = time.Now().Add(time.Second * 2) - } - ctx, _ := context.WithDeadline(context.Background(), absTimeout) - conn, err := DialPipeContext(ctx, path) - if err == context.DeadlineExceeded { - return nil, ErrTimeout - } - return conn, err -} - -// DialPipeContext attempts to connect to a named pipe by `path` until `ctx` -// cancellation or timeout. -func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { - var err error - var h syscall.Handle - h, err = tryDialPipe(ctx, &path) - if err != nil { - return nil, err - } - - var flags uint32 - err = getNamedPipeInfo(h, &flags, nil, nil, nil) - if err != nil { - return nil, err - } - - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - - // If the pipe is in message mode, return a message byte pipe, which - // supports CloseWrite(). - if flags&cPIPE_TYPE_MESSAGE != 0 { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: f, path: path}, - }, nil - } - return &win32Pipe{win32File: f, path: path}, nil -} - -type acceptResponse struct { - f *win32File - err error -} - -type win32PipeListener struct { - firstHandle syscall.Handle - path string - config PipeConfig - acceptCh chan (chan acceptResponse) - closeCh chan int - doneCh chan int -} - -func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) { - path16, err := syscall.UTF16FromString(path) - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - var oa objectAttributes - oa.Length = unsafe.Sizeof(oa) - - var ntPath unicodeString - if err := rtlDosPathNameToNtPathName(&path16[0], &ntPath, 0, 0).Err(); err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - defer localFree(ntPath.Buffer) - oa.ObjectName = &ntPath - - // The security descriptor is only needed for the first pipe. - if first { - if sd != nil { - len := uint32(len(sd)) - sdb := localAlloc(0, len) - defer localFree(sdb) - copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) - oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) - } else { - // Construct the default named pipe security descriptor. - var dacl uintptr - if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { - return 0, fmt.Errorf("getting default named pipe ACL: %s", err) - } - defer localFree(dacl) - - sdb := &securityDescriptor{ - Revision: 1, - Control: cSE_DACL_PRESENT, - Dacl: dacl, - } - oa.SecurityDescriptor = sdb - } - } - - typ := uint32(cFILE_PIPE_REJECT_REMOTE_CLIENTS) - if c.MessageMode { - typ |= cFILE_PIPE_MESSAGE_TYPE - } - - disposition := uint32(cFILE_OPEN) - access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE) - if first { - disposition = cFILE_CREATE - // By not asking for read or write access, the named pipe file system - // will put this pipe into an initially disconnected state, blocking - // client connections until the next call with first == false. - access = syscall.SYNCHRONIZE - } - - timeout := int64(-50 * 10000) // 50ms - - var ( - h syscall.Handle - iosb ioStatusBlock - ) - err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, disposition, 0, typ, 0, 0, 0xffffffff, uint32(c.InputBufferSize), uint32(c.OutputBufferSize), &timeout).Err() - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - runtime.KeepAlive(ntPath) - return h, nil -} - -func (l *win32PipeListener) makeServerPipe() (*win32File, error) { - h, err := makeServerPipeHandle(l.path, nil, &l.config, false) - if err != nil { - return nil, err - } - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - return f, nil -} - -func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) { - p, err := l.makeServerPipe() - if err != nil { - return nil, err - } - - // Wait for the client to connect. - ch := make(chan error) - go func(p *win32File) { - ch <- connectPipe(p) - }(p) - - select { - case err = <-ch: - if err != nil { - p.Close() - p = nil - } - case <-l.closeCh: - // Abort the connect request by closing the handle. - p.Close() - p = nil - err = <-ch - if err == nil || err == ErrFileClosed { - err = ErrPipeListenerClosed - } - } - return p, err -} - -func (l *win32PipeListener) listenerRoutine() { - closed := false - for !closed { - select { - case <-l.closeCh: - closed = true - case responseCh := <-l.acceptCh: - var ( - p *win32File - err error - ) - for { - p, err = l.makeConnectedServerPipe() - // If the connection was immediately closed by the client, try - // again. - if err != cERROR_NO_DATA { - break - } - } - responseCh <- acceptResponse{p, err} - closed = err == ErrPipeListenerClosed - } - } - syscall.Close(l.firstHandle) - l.firstHandle = 0 - // Notify Close() and Accept() callers that the handle has been closed. - close(l.doneCh) -} - -// PipeConfig contain configuration for the pipe listener. -type PipeConfig struct { - // SecurityDescriptor contains a Windows security descriptor in SDDL format. - SecurityDescriptor string - - // MessageMode determines whether the pipe is in byte or message mode. In either - // case the pipe is read in byte mode by default. The only practical difference in - // this implementation is that CloseWrite() is only supported for message mode pipes; - // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only - // transferred to the reader (and returned as io.EOF in this implementation) - // when the pipe is in message mode. - MessageMode bool - - // InputBufferSize specifies the size the input buffer, in bytes. - InputBufferSize int32 - - // OutputBufferSize specifies the size the input buffer, in bytes. - OutputBufferSize int32 -} - -// ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe. -// The pipe must not already exist. -func ListenPipe(path string, c *PipeConfig) (net.Listener, error) { - var ( - sd []byte - err error - ) - if c == nil { - c = &PipeConfig{} - } - if c.SecurityDescriptor != "" { - sd, err = SddlToSecurityDescriptor(c.SecurityDescriptor) - if err != nil { - return nil, err - } - } - h, err := makeServerPipeHandle(path, sd, c, true) - if err != nil { - return nil, err - } - l := &win32PipeListener{ - firstHandle: h, - path: path, - config: *c, - acceptCh: make(chan (chan acceptResponse)), - closeCh: make(chan int), - doneCh: make(chan int), - } - go l.listenerRoutine() - return l, nil -} - -func connectPipe(p *win32File) error { - c, err := p.prepareIo() - if err != nil { - return err - } - defer p.wg.Done() - - err = connectNamedPipe(p.handle, &c.o) - _, err = p.asyncIo(c, nil, 0, err) - if err != nil && err != cERROR_PIPE_CONNECTED { - return err - } - return nil -} - -func (l *win32PipeListener) Accept() (net.Conn, error) { - ch := make(chan acceptResponse) - select { - case l.acceptCh <- ch: - response := <-ch - err := response.err - if err != nil { - return nil, err - } - if l.config.MessageMode { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: response.f, path: l.path}, - }, nil - } - return &win32Pipe{win32File: response.f, path: l.path}, nil - case <-l.doneCh: - return nil, ErrPipeListenerClosed - } -} - -func (l *win32PipeListener) Close() error { - select { - case l.closeCh <- 1: - <-l.doneCh - case <-l.doneCh: - } - return nil -} - -func (l *win32PipeListener) Addr() net.Addr { - return pipeAddress(l.path) -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go deleted file mode 100644 index 58640657..00000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go +++ /dev/null @@ -1,235 +0,0 @@ -// Package guid provides a GUID type. The backing structure for a GUID is -// identical to that used by the golang.org/x/sys/windows GUID type. -// There are two main binary encodings used for a GUID, the big-endian encoding, -// and the Windows (mixed-endian) encoding. See here for details: -// https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding -package guid - -import ( - "crypto/rand" - "crypto/sha1" - "encoding" - "encoding/binary" - "fmt" - "strconv" - - "golang.org/x/sys/windows" -) - -// Variant specifies which GUID variant (or "type") of the GUID. It determines -// how the entirety of the rest of the GUID is interpreted. -type Variant uint8 - -// The variants specified by RFC 4122. -const ( - // VariantUnknown specifies a GUID variant which does not conform to one of - // the variant encodings specified in RFC 4122. - VariantUnknown Variant = iota - VariantNCS - VariantRFC4122 - VariantMicrosoft - VariantFuture -) - -// Version specifies how the bits in the GUID were generated. For instance, a -// version 4 GUID is randomly generated, and a version 5 is generated from the -// hash of an input string. -type Version uint8 - -var _ = (encoding.TextMarshaler)(GUID{}) -var _ = (encoding.TextUnmarshaler)(&GUID{}) - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type so that stringification and -// marshaling can be supported. The representation matches that used by native -// Windows code. -type GUID windows.GUID - -// NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122. -func NewV4() (GUID, error) { - var b [16]byte - if _, err := rand.Read(b[:]); err != nil { - return GUID{}, err - } - - g := FromArray(b) - g.setVersion(4) // Version 4 means randomly generated. - g.setVariant(VariantRFC4122) - - return g, nil -} - -// NewV5 returns a new version 5 (generated from a string via SHA-1 hashing) -// GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name, -// and the sample code treats it as a series of bytes, so we do the same here. -// -// Some implementations, such as those found on Windows, treat the name as a -// big-endian UTF16 stream of bytes. If that is desired, the string can be -// encoded as such before being passed to this function. -func NewV5(namespace GUID, name []byte) (GUID, error) { - b := sha1.New() - namespaceBytes := namespace.ToArray() - b.Write(namespaceBytes[:]) - b.Write(name) - - a := [16]byte{} - copy(a[:], b.Sum(nil)) - - g := FromArray(a) - g.setVersion(5) // Version 5 means generated from a string. - g.setVariant(VariantRFC4122) - - return g, nil -} - -func fromArray(b [16]byte, order binary.ByteOrder) GUID { - var g GUID - g.Data1 = order.Uint32(b[0:4]) - g.Data2 = order.Uint16(b[4:6]) - g.Data3 = order.Uint16(b[6:8]) - copy(g.Data4[:], b[8:16]) - return g -} - -func (g GUID) toArray(order binary.ByteOrder) [16]byte { - b := [16]byte{} - order.PutUint32(b[0:4], g.Data1) - order.PutUint16(b[4:6], g.Data2) - order.PutUint16(b[6:8], g.Data3) - copy(b[8:16], g.Data4[:]) - return b -} - -// FromArray constructs a GUID from a big-endian encoding array of 16 bytes. -func FromArray(b [16]byte) GUID { - return fromArray(b, binary.BigEndian) -} - -// ToArray returns an array of 16 bytes representing the GUID in big-endian -// encoding. -func (g GUID) ToArray() [16]byte { - return g.toArray(binary.BigEndian) -} - -// FromWindowsArray constructs a GUID from a Windows encoding array of bytes. -func FromWindowsArray(b [16]byte) GUID { - return fromArray(b, binary.LittleEndian) -} - -// ToWindowsArray returns an array of 16 bytes representing the GUID in Windows -// encoding. -func (g GUID) ToWindowsArray() [16]byte { - return g.toArray(binary.LittleEndian) -} - -func (g GUID) String() string { - return fmt.Sprintf( - "%08x-%04x-%04x-%04x-%012x", - g.Data1, - g.Data2, - g.Data3, - g.Data4[:2], - g.Data4[2:]) -} - -// FromString parses a string containing a GUID and returns the GUID. The only -// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` -// format. -func FromString(s string) (GUID, error) { - if len(s) != 36 { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - - var g GUID - - data1, err := strconv.ParseUint(s[0:8], 16, 32) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data1 = uint32(data1) - - data2, err := strconv.ParseUint(s[9:13], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data2 = uint16(data2) - - data3, err := strconv.ParseUint(s[14:18], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data3 = uint16(data3) - - for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} { - v, err := strconv.ParseUint(s[x:x+2], 16, 8) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data4[i] = uint8(v) - } - - return g, nil -} - -func (g *GUID) setVariant(v Variant) { - d := g.Data4[0] - switch v { - case VariantNCS: - d = (d & 0x7f) - case VariantRFC4122: - d = (d & 0x3f) | 0x80 - case VariantMicrosoft: - d = (d & 0x1f) | 0xc0 - case VariantFuture: - d = (d & 0x0f) | 0xe0 - case VariantUnknown: - fallthrough - default: - panic(fmt.Sprintf("invalid variant: %d", v)) - } - g.Data4[0] = d -} - -// Variant returns the GUID variant, as defined in RFC 4122. -func (g GUID) Variant() Variant { - b := g.Data4[0] - if b&0x80 == 0 { - return VariantNCS - } else if b&0xc0 == 0x80 { - return VariantRFC4122 - } else if b&0xe0 == 0xc0 { - return VariantMicrosoft - } else if b&0xe0 == 0xe0 { - return VariantFuture - } - return VariantUnknown -} - -func (g *GUID) setVersion(v Version) { - g.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12) -} - -// Version returns the GUID version, as defined in RFC 4122. -func (g GUID) Version() Version { - return Version((g.Data3 & 0xF000) >> 12) -} - -// MarshalText returns the textual representation of the GUID. -func (g GUID) MarshalText() ([]byte, error) { - return []byte(g.String()), nil -} - -// UnmarshalText takes the textual representation of a GUID, and unmarhals it -// into this GUID. -func (g *GUID) UnmarshalText(text []byte) error { - g2, err := FromString(string(text)) - if err != nil { - return err - } - *g = g2 - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/privilege.go b/vendor/github.com/Microsoft/go-winio/privilege.go deleted file mode 100644 index 9c83d36f..00000000 --- a/vendor/github.com/Microsoft/go-winio/privilege.go +++ /dev/null @@ -1,202 +0,0 @@ -// +build windows - -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "runtime" - "sync" - "syscall" - "unicode/utf16" - - "golang.org/x/sys/windows" -) - -//sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges -//sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf -//sys revertToSelf() (err error) = advapi32.RevertToSelf -//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken -//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread -//sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW -//sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW -//sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW - -const ( - SE_PRIVILEGE_ENABLED = 2 - - ERROR_NOT_ALL_ASSIGNED syscall.Errno = 1300 - - SeBackupPrivilege = "SeBackupPrivilege" - SeRestorePrivilege = "SeRestorePrivilege" -) - -const ( - securityAnonymous = iota - securityIdentification - securityImpersonation - securityDelegation -) - -var ( - privNames = make(map[string]uint64) - privNameMutex sync.Mutex -) - -// PrivilegeError represents an error enabling privileges. -type PrivilegeError struct { - privileges []uint64 -} - -func (e *PrivilegeError) Error() string { - s := "" - if len(e.privileges) > 1 { - s = "Could not enable privileges " - } else { - s = "Could not enable privilege " - } - for i, p := range e.privileges { - if i != 0 { - s += ", " - } - s += `"` - s += getPrivilegeName(p) - s += `"` - } - return s -} - -// RunWithPrivilege enables a single privilege for a function call. -func RunWithPrivilege(name string, fn func() error) error { - return RunWithPrivileges([]string{name}, fn) -} - -// RunWithPrivileges enables privileges for a function call. -func RunWithPrivileges(names []string, fn func() error) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - runtime.LockOSThread() - defer runtime.UnlockOSThread() - token, err := newThreadToken() - if err != nil { - return err - } - defer releaseThreadToken(token) - err = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED) - if err != nil { - return err - } - return fn() -} - -func mapPrivileges(names []string) ([]uint64, error) { - var privileges []uint64 - privNameMutex.Lock() - defer privNameMutex.Unlock() - for _, name := range names { - p, ok := privNames[name] - if !ok { - err := lookupPrivilegeValue("", name, &p) - if err != nil { - return nil, err - } - privNames[name] = p - } - privileges = append(privileges, p) - } - return privileges, nil -} - -// EnableProcessPrivileges enables privileges globally for the process. -func EnableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED) -} - -// DisableProcessPrivileges disables privileges globally for the process. -func DisableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, 0) -} - -func enableDisableProcessPrivilege(names []string, action uint32) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - - p, _ := windows.GetCurrentProcess() - var token windows.Token - err = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token) - if err != nil { - return err - } - - defer token.Close() - return adjustPrivileges(token, privileges, action) -} - -func adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error { - var b bytes.Buffer - binary.Write(&b, binary.LittleEndian, uint32(len(privileges))) - for _, p := range privileges { - binary.Write(&b, binary.LittleEndian, p) - binary.Write(&b, binary.LittleEndian, action) - } - prevState := make([]byte, b.Len()) - reqSize := uint32(0) - success, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize) - if !success { - return err - } - if err == ERROR_NOT_ALL_ASSIGNED { - return &PrivilegeError{privileges} - } - return nil -} - -func getPrivilegeName(luid uint64) string { - var nameBuffer [256]uint16 - bufSize := uint32(len(nameBuffer)) - err := lookupPrivilegeName("", &luid, &nameBuffer[0], &bufSize) - if err != nil { - return fmt.Sprintf("", luid) - } - - var displayNameBuffer [256]uint16 - displayBufSize := uint32(len(displayNameBuffer)) - var langID uint32 - err = lookupPrivilegeDisplayName("", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID) - if err != nil { - return fmt.Sprintf("", string(utf16.Decode(nameBuffer[:bufSize]))) - } - - return string(utf16.Decode(displayNameBuffer[:displayBufSize])) -} - -func newThreadToken() (windows.Token, error) { - err := impersonateSelf(securityImpersonation) - if err != nil { - return 0, err - } - - var token windows.Token - err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token) - if err != nil { - rerr := revertToSelf() - if rerr != nil { - panic(rerr) - } - return 0, err - } - return token, nil -} - -func releaseThreadToken(h windows.Token) { - err := revertToSelf() - if err != nil { - panic(err) - } - h.Close() -} diff --git a/vendor/github.com/Microsoft/go-winio/reparse.go b/vendor/github.com/Microsoft/go-winio/reparse.go deleted file mode 100644 index fc1ee4d3..00000000 --- a/vendor/github.com/Microsoft/go-winio/reparse.go +++ /dev/null @@ -1,128 +0,0 @@ -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "strings" - "unicode/utf16" - "unsafe" -) - -const ( - reparseTagMountPoint = 0xA0000003 - reparseTagSymlink = 0xA000000C -) - -type reparseDataBuffer struct { - ReparseTag uint32 - ReparseDataLength uint16 - Reserved uint16 - SubstituteNameOffset uint16 - SubstituteNameLength uint16 - PrintNameOffset uint16 - PrintNameLength uint16 -} - -// ReparsePoint describes a Win32 symlink or mount point. -type ReparsePoint struct { - Target string - IsMountPoint bool -} - -// UnsupportedReparsePointError is returned when trying to decode a non-symlink or -// mount point reparse point. -type UnsupportedReparsePointError struct { - Tag uint32 -} - -func (e *UnsupportedReparsePointError) Error() string { - return fmt.Sprintf("unsupported reparse point %x", e.Tag) -} - -// DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink -// or a mount point. -func DecodeReparsePoint(b []byte) (*ReparsePoint, error) { - tag := binary.LittleEndian.Uint32(b[0:4]) - return DecodeReparsePointData(tag, b[8:]) -} - -func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) { - isMountPoint := false - switch tag { - case reparseTagMountPoint: - isMountPoint = true - case reparseTagSymlink: - default: - return nil, &UnsupportedReparsePointError{tag} - } - nameOffset := 8 + binary.LittleEndian.Uint16(b[4:6]) - if !isMountPoint { - nameOffset += 4 - } - nameLength := binary.LittleEndian.Uint16(b[6:8]) - name := make([]uint16, nameLength/2) - err := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name) - if err != nil { - return nil, err - } - return &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil -} - -func isDriveLetter(c byte) bool { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') -} - -// EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or -// mount point. -func EncodeReparsePoint(rp *ReparsePoint) []byte { - // Generate an NT path and determine if this is a relative path. - var ntTarget string - relative := false - if strings.HasPrefix(rp.Target, `\\?\`) { - ntTarget = `\??\` + rp.Target[4:] - } else if strings.HasPrefix(rp.Target, `\\`) { - ntTarget = `\??\UNC\` + rp.Target[2:] - } else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' { - ntTarget = `\??\` + rp.Target - } else { - ntTarget = rp.Target - relative = true - } - - // The paths must be NUL-terminated even though they are counted strings. - target16 := utf16.Encode([]rune(rp.Target + "\x00")) - ntTarget16 := utf16.Encode([]rune(ntTarget + "\x00")) - - size := int(unsafe.Sizeof(reparseDataBuffer{})) - 8 - size += len(ntTarget16)*2 + len(target16)*2 - - tag := uint32(reparseTagMountPoint) - if !rp.IsMountPoint { - tag = reparseTagSymlink - size += 4 // Add room for symlink flags - } - - data := reparseDataBuffer{ - ReparseTag: tag, - ReparseDataLength: uint16(size), - SubstituteNameOffset: 0, - SubstituteNameLength: uint16((len(ntTarget16) - 1) * 2), - PrintNameOffset: uint16(len(ntTarget16) * 2), - PrintNameLength: uint16((len(target16) - 1) * 2), - } - - var b bytes.Buffer - binary.Write(&b, binary.LittleEndian, &data) - if !rp.IsMountPoint { - flags := uint32(0) - if relative { - flags |= 1 - } - binary.Write(&b, binary.LittleEndian, flags) - } - - binary.Write(&b, binary.LittleEndian, ntTarget16) - binary.Write(&b, binary.LittleEndian, target16) - return b.Bytes() -} diff --git a/vendor/github.com/Microsoft/go-winio/sd.go b/vendor/github.com/Microsoft/go-winio/sd.go deleted file mode 100644 index db1b370a..00000000 --- a/vendor/github.com/Microsoft/go-winio/sd.go +++ /dev/null @@ -1,98 +0,0 @@ -// +build windows - -package winio - -import ( - "syscall" - "unsafe" -) - -//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW -//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW -//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW -//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW -//sys localFree(mem uintptr) = LocalFree -//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength - -const ( - cERROR_NONE_MAPPED = syscall.Errno(1332) -) - -type AccountLookupError struct { - Name string - Err error -} - -func (e *AccountLookupError) Error() string { - if e.Name == "" { - return "lookup account: empty account name specified" - } - var s string - switch e.Err { - case cERROR_NONE_MAPPED: - s = "not found" - default: - s = e.Err.Error() - } - return "lookup account " + e.Name + ": " + s -} - -type SddlConversionError struct { - Sddl string - Err error -} - -func (e *SddlConversionError) Error() string { - return "convert " + e.Sddl + ": " + e.Err.Error() -} - -// LookupSidByName looks up the SID of an account by name -func LookupSidByName(name string) (sid string, err error) { - if name == "" { - return "", &AccountLookupError{name, cERROR_NONE_MAPPED} - } - - var sidSize, sidNameUse, refDomainSize uint32 - err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER { - return "", &AccountLookupError{name, err} - } - sidBuffer := make([]byte, sidSize) - refDomainBuffer := make([]uint16, refDomainSize) - err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) - if err != nil { - return "", &AccountLookupError{name, err} - } - var strBuffer *uint16 - err = convertSidToStringSid(&sidBuffer[0], &strBuffer) - if err != nil { - return "", &AccountLookupError{name, err} - } - sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) - localFree(uintptr(unsafe.Pointer(strBuffer))) - return sid, nil -} - -func SddlToSecurityDescriptor(sddl string) ([]byte, error) { - var sdBuffer uintptr - err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil) - if err != nil { - return nil, &SddlConversionError{sddl, err} - } - defer localFree(sdBuffer) - sd := make([]byte, getSecurityDescriptorLength(sdBuffer)) - copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)]) - return sd, nil -} - -func SecurityDescriptorToSddl(sd []byte) (string, error) { - var sddl *uint16 - // The returned string length seems to including an aribtrary number of terminating NULs. - // Don't use it. - err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil) - if err != nil { - return "", err - } - defer localFree(uintptr(unsafe.Pointer(sddl))) - return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/syscall.go b/vendor/github.com/Microsoft/go-winio/syscall.go deleted file mode 100644 index 5cb52bc7..00000000 --- a/vendor/github.com/Microsoft/go-winio/syscall.go +++ /dev/null @@ -1,3 +0,0 @@ -package winio - -//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go hvsock.go diff --git a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go deleted file mode 100644 index e26b01fa..00000000 --- a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go +++ /dev/null @@ -1,562 +0,0 @@ -// Code generated by 'go generate'; DO NOT EDIT. - -package winio - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return nil - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - modntdll = windows.NewLazySystemDLL("ntdll.dll") - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") - procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") - procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") - procCreateFileW = modkernel32.NewProc("CreateFileW") - procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") - procLocalAlloc = modkernel32.NewProc("LocalAlloc") - procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") - procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") - procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") - procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") - procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") - procLocalFree = modkernel32.NewProc("LocalFree") - procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") - procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx") - procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle") - procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") - procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") - procRevertToSelf = modadvapi32.NewProc("RevertToSelf") - procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") - procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") - procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") - procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") - procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") - procBackupRead = modkernel32.NewProc("BackupRead") - procBackupWrite = modkernel32.NewProc("BackupWrite") - procbind = modws2_32.NewProc("bind") -) - -func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0) - newport = syscall.Handle(r0) - if newport == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { - var _p0 uint32 - if wait { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) -} - -func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _createFile(_p0, access, mode, sa, createmode, attrs, templatefile) -} - -func _createFile(name *uint16, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func localAlloc(uFlags uint32, length uint32) (ptr uintptr) { - r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0) - ptr = uintptr(r0) - return -} - -func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) - status = ntstatus(r0) - return -} - -func rtlNtStatusToDosError(status ntstatus) (winerr error) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0) - if r0 != 0 { - winerr = syscall.Errno(r0) - } - return -} - -func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0) - status = ntstatus(r0) - return -} - -func rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0) - status = ntstatus(r0) - return -} - -func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(accountName) - if err != nil { - return - } - return _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse) -} - -func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func convertSidToStringSid(sid *byte, str **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(str) - if err != nil { - return - } - return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) -} - -func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func localFree(mem uintptr) { - syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0) - return -} - -func getSecurityDescriptorLength(sd uintptr) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0) - len = uint32(r0) - return -} - -func getFileInformationByHandleEx(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(h), uintptr(class), uintptr(unsafe.Pointer(buffer)), uintptr(size), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func setFileInformationByHandle(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(h), uintptr(class), uintptr(unsafe.Pointer(buffer)), uintptr(size), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { - var _p0 uint32 - if releaseAll { - _p0 = 1 - } else { - _p0 = 0 - } - r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) - success = r0 != 0 - if true { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func impersonateSelf(level uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func revertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { - var _p0 uint32 - if openAsSelf { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func getCurrentThread() (h syscall.Handle) { - r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) - h = syscall.Handle(r0) - return -} - -func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - var _p1 *uint16 - _p1, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _lookupPrivilegeValue(_p0, _p1, luid) -} - -func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeName(_p0, luid, buffer, size) -} - -func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId) -} - -func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } else { - _p1 = 0 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } else { - _p2 = 0 - } - r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } else { - _p1 = 0 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } else { - _p2 = 0 - } - r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socketError { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/.gitignore b/vendor/github.com/PagerDuty/go-pagerduty/.gitignore deleted file mode 100644 index dc0fe944..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bin/* -*.swp diff --git a/vendor/github.com/PagerDuty/go-pagerduty/.goreleaser.yml b/vendor/github.com/PagerDuty/go-pagerduty/.goreleaser.yml deleted file mode 100644 index 4ecd2cbe..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/.goreleaser.yml +++ /dev/null @@ -1,33 +0,0 @@ -project_name: go-pagerduty -release: - github: - owner: PagerDuty - name: go-pagerduty - draft: false - prerelease: true - name_template: "{{.ProjectName}}-v{{.Version}}" -builds: -- goos: - - linux - - darwin - - windows - goarch: - - amd64 - - 386 - main: ./command/*.go - binary: pd -archive: - format: tar.gz - format_overrides: - - goos: windows - format: zip - replacements: - amd64: 64-bit - darwin: macOS - linux: Tux - name_template: "{{.Binary}}_{{.Version}}_{{.Os}}-{{.Arch}}" - files: - - LICENSE.txt - - README.md - - examples/* - - CHANGELOG.md \ No newline at end of file diff --git a/vendor/github.com/PagerDuty/go-pagerduty/CHANGELOG.md b/vendor/github.com/PagerDuty/go-pagerduty/CHANGELOG.md deleted file mode 100644 index 5936ccc3..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/CHANGELOG.md +++ /dev/null @@ -1,89 +0,0 @@ -# Change Log - -## [1.0.0](https://github.com/PagerDuty/go-pagerduty/tree/1.0.0) (2018-05-28) -**Fixed bugs:** - -- Escalation Policy's repeat\_enabled Is Ignored [\#57](https://github.com/PagerDuty/go-pagerduty/issues/57) -- Problems running freshly built pd utility [\#39](https://github.com/PagerDuty/go-pagerduty/issues/39) -- Manage Incident gives error [\#32](https://github.com/PagerDuty/go-pagerduty/issues/32) -- Added missing slash to delete integration method url [\#59](https://github.com/PagerDuty/go-pagerduty/pull/59) ([jescochu](https://github.com/jescochu)) - -**Closed issues:** - -- Trouble creating an integration [\#102](https://github.com/PagerDuty/go-pagerduty/issues/102) -- Client does not trigger events [\#101](https://github.com/PagerDuty/go-pagerduty/issues/101) -- Paging help [\#94](https://github.com/PagerDuty/go-pagerduty/issues/94) -- Help with incident creation API [\#89](https://github.com/PagerDuty/go-pagerduty/issues/89) -- Memory leak because of response body is not closed [\#66](https://github.com/PagerDuty/go-pagerduty/issues/66) -- Since and Until don't work for log\_entries [\#61](https://github.com/PagerDuty/go-pagerduty/issues/61) -- service: auto\_resolve\_timeout & acknowledgement\_timeout cannot be set to null [\#51](https://github.com/PagerDuty/go-pagerduty/issues/51) -- Possible to create new service and integration together [\#42](https://github.com/PagerDuty/go-pagerduty/issues/42) -- Documentation does not match code [\#16](https://github.com/PagerDuty/go-pagerduty/issues/16) -- Typo in repo description [\#15](https://github.com/PagerDuty/go-pagerduty/issues/15) -- Webhook decoder [\#14](https://github.com/PagerDuty/go-pagerduty/issues/14) -- incident\_key for create\_event [\#13](https://github.com/PagerDuty/go-pagerduty/issues/13) - -**Merged pull requests:** - -- Fix pagination for ListOnCalls [\#90](https://github.com/PagerDuty/go-pagerduty/pull/90) ([IainCole](https://github.com/IainCole)) -- Revert "Fix inconsistency with some REST Options objects passed by reference …" [\#88](https://github.com/PagerDuty/go-pagerduty/pull/88) ([mimato](https://github.com/mimato)) -- Adding travis config, fixup Makefile [\#87](https://github.com/PagerDuty/go-pagerduty/pull/87) ([mimato](https://github.com/mimato)) -- Fixed invalid JSON descriptor for FirstTriggerLogEntry [\#86](https://github.com/PagerDuty/go-pagerduty/pull/86) ([mwisniewski0](https://github.com/mwisniewski0)) -- \[incidents\] fix entries typo in a few places [\#85](https://github.com/PagerDuty/go-pagerduty/pull/85) ([joeyparsons](https://github.com/joeyparsons)) -- Fix inconsistency with some REST Options objects passed by reference … [\#79](https://github.com/PagerDuty/go-pagerduty/pull/79) ([lowesoftware](https://github.com/lowesoftware)) -- Explicit JSON reference to schedules [\#77](https://github.com/PagerDuty/go-pagerduty/pull/77) ([domudall](https://github.com/domudall)) -- Adding AlertCreation to Service struct [\#76](https://github.com/PagerDuty/go-pagerduty/pull/76) ([domudall](https://github.com/domudall)) -- Add support for escalation rules [\#71](https://github.com/PagerDuty/go-pagerduty/pull/71) ([heimweh](https://github.com/heimweh)) -- Fix maintenance window JSON [\#69](https://github.com/PagerDuty/go-pagerduty/pull/69) ([domudall](https://github.com/domudall)) -- Fixing Maintenance typo [\#68](https://github.com/PagerDuty/go-pagerduty/pull/68) ([domudall](https://github.com/domudall)) -- Update event.go - fix a memory leak [\#65](https://github.com/PagerDuty/go-pagerduty/pull/65) ([AngelRefael](https://github.com/AngelRefael)) -- Add query to vendor [\#64](https://github.com/PagerDuty/go-pagerduty/pull/64) ([heimweh](https://github.com/heimweh)) -- Fix JSON decode \(errorObject\) [\#63](https://github.com/PagerDuty/go-pagerduty/pull/63) ([heimweh](https://github.com/heimweh)) -- fix since and until by adding them to url scheme [\#60](https://github.com/PagerDuty/go-pagerduty/pull/60) ([ethansommer](https://github.com/ethansommer)) -- fix webhook struct member name [\#58](https://github.com/PagerDuty/go-pagerduty/pull/58) ([pgray](https://github.com/pgray)) -- Incident - Add status field to incident [\#56](https://github.com/PagerDuty/go-pagerduty/pull/56) ([heimweh](https://github.com/heimweh)) -- enable fetch log entries via incident api [\#55](https://github.com/PagerDuty/go-pagerduty/pull/55) ([flyinprogrammer](https://github.com/flyinprogrammer)) -- Allow service timeouts to be disabled [\#53](https://github.com/PagerDuty/go-pagerduty/pull/53) ([heimweh](https://github.com/heimweh)) -- Schedule restriction - Add support for start\_day\_of\_week [\#52](https://github.com/PagerDuty/go-pagerduty/pull/52) ([heimweh](https://github.com/heimweh)) -- Add vendor support [\#49](https://github.com/PagerDuty/go-pagerduty/pull/49) ([heimweh](https://github.com/heimweh)) -- Add schedules listing [\#46](https://github.com/PagerDuty/go-pagerduty/pull/46) ([Marc-Morata-Fite](https://github.com/Marc-Morata-Fite)) -- dont declare main twice in examples [\#45](https://github.com/PagerDuty/go-pagerduty/pull/45) ([ranjib](https://github.com/ranjib)) -- add service show [\#44](https://github.com/PagerDuty/go-pagerduty/pull/44) ([cmluciano](https://github.com/cmluciano)) -- \(feat\)implement integration creation [\#43](https://github.com/PagerDuty/go-pagerduty/pull/43) ([ranjib](https://github.com/ranjib)) -- \(chore\)add create event example [\#41](https://github.com/PagerDuty/go-pagerduty/pull/41) ([ranjib](https://github.com/ranjib)) -- \(bug\)Add test. fix version issue [\#40](https://github.com/PagerDuty/go-pagerduty/pull/40) ([ranjib](https://github.com/ranjib)) -- Remove subdomain argument from escalation\_policy example. [\#38](https://github.com/PagerDuty/go-pagerduty/pull/38) ([cmluciano](https://github.com/cmluciano)) -- Skip JSON encoding if no payload was given [\#37](https://github.com/PagerDuty/go-pagerduty/pull/37) ([heimweh](https://github.com/heimweh)) -- \(feat\)add ability API and CLI [\#36](https://github.com/PagerDuty/go-pagerduty/pull/36) ([ranjib](https://github.com/ranjib)) -- Make updates to Escalation Policies work [\#35](https://github.com/PagerDuty/go-pagerduty/pull/35) ([heimweh](https://github.com/heimweh)) -- Fix misspelling in User struct and add JSON tags [\#34](https://github.com/PagerDuty/go-pagerduty/pull/34) ([heimweh](https://github.com/heimweh)) -- \(bug\)allow passing headers in http do call. fix manage incident call [\#33](https://github.com/PagerDuty/go-pagerduty/pull/33) ([ranjib](https://github.com/ranjib)) -- \(chore\)get rid of logrus from all core structs except CLI entries. fix schedule override command [\#31](https://github.com/PagerDuty/go-pagerduty/pull/31) ([ranjib](https://github.com/ranjib)) -- \(bug\)rename override struct [\#30](https://github.com/PagerDuty/go-pagerduty/pull/30) ([ranjib](https://github.com/ranjib)) -- \(bug\)implement schedule override [\#29](https://github.com/PagerDuty/go-pagerduty/pull/29) ([ranjib](https://github.com/ranjib)) -- fix misspelling in trigger\_summary\_data's JSON key. [\#28](https://github.com/PagerDuty/go-pagerduty/pull/28) ([tomwans](https://github.com/tomwans)) -- Correctly set meta flag for incident list [\#26](https://github.com/PagerDuty/go-pagerduty/pull/26) ([afirth](https://github.com/afirth)) -- Add \*.swp to gitignore [\#25](https://github.com/PagerDuty/go-pagerduty/pull/25) ([afirth](https://github.com/afirth)) -- Support the /oncalls endpoint in the CLI [\#24](https://github.com/PagerDuty/go-pagerduty/pull/24) ([afirth](https://github.com/afirth)) -- Refactor to work correctly with V2 API [\#23](https://github.com/PagerDuty/go-pagerduty/pull/23) ([dthagard](https://github.com/dthagard)) -- \(feat\)Add webhook decoding capability [\#22](https://github.com/PagerDuty/go-pagerduty/pull/22) ([ranjib](https://github.com/ranjib)) -- \(chore\)Decode event API response. [\#21](https://github.com/PagerDuty/go-pagerduty/pull/21) ([ranjib](https://github.com/ranjib)) -- \(bug\)add incident\_key field in event api client [\#20](https://github.com/PagerDuty/go-pagerduty/pull/20) ([ranjib](https://github.com/ranjib)) -- \(chore\)nuke sub domain, v2 api does not need one [\#19](https://github.com/PagerDuty/go-pagerduty/pull/19) ([ranjib](https://github.com/ranjib)) -- Implement list users CLI [\#17](https://github.com/PagerDuty/go-pagerduty/pull/17) ([ranjib](https://github.com/ranjib)) -- Add team\_ids\[\] query string arg [\#12](https://github.com/PagerDuty/go-pagerduty/pull/12) ([marklap](https://github.com/marklap)) -- Incidents fix [\#11](https://github.com/PagerDuty/go-pagerduty/pull/11) ([jareksm](https://github.com/jareksm)) -- Added APIListObject to Option types to allow setting offset and [\#10](https://github.com/PagerDuty/go-pagerduty/pull/10) ([jareksm](https://github.com/jareksm)) -- fix typo [\#9](https://github.com/PagerDuty/go-pagerduty/pull/9) ([sjansen](https://github.com/sjansen)) -- implement incident list cli. event posting api [\#8](https://github.com/PagerDuty/go-pagerduty/pull/8) ([ranjib](https://github.com/ranjib)) -- CLI for create escalation policy, maintainenance window , schedule ov… [\#7](https://github.com/PagerDuty/go-pagerduty/pull/7) ([ranjib](https://github.com/ranjib)) -- \(feat\)implement create service cli [\#6](https://github.com/PagerDuty/go-pagerduty/pull/6) ([ranjib](https://github.com/ranjib)) -- \(feat\)list service cli [\#5](https://github.com/PagerDuty/go-pagerduty/pull/5) ([ranjib](https://github.com/ranjib)) -- \(feat\)implement addon update/delete [\#4](https://github.com/PagerDuty/go-pagerduty/pull/4) ([ranjib](https://github.com/ranjib)) -- \(feat\)Show addon cli [\#3](https://github.com/PagerDuty/go-pagerduty/pull/3) ([ranjib](https://github.com/ranjib)) -- \(feat\) addon list api. create cli [\#2](https://github.com/PagerDuty/go-pagerduty/pull/2) ([ranjib](https://github.com/ranjib)) -- \(chore\) list addon [\#1](https://github.com/PagerDuty/go-pagerduty/pull/1) ([ranjib](https://github.com/ranjib)) - - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/vendor/github.com/PagerDuty/go-pagerduty/Dockerfile b/vendor/github.com/PagerDuty/go-pagerduty/Dockerfile deleted file mode 100644 index 650a6921..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM golang -ADD . /go/src/github.com/PagerDuty/go-pagerduty -WORKDIR /go/src/github.com/PagerDuty/go-pagerduty -RUN go get ./... && go test -v -race -cover ./... diff --git a/vendor/github.com/PagerDuty/go-pagerduty/LICENSE.txt b/vendor/github.com/PagerDuty/go-pagerduty/LICENSE.txt deleted file mode 100644 index e872ebb3..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 PagerDuty, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/PagerDuty/go-pagerduty/Makefile b/vendor/github.com/PagerDuty/go-pagerduty/Makefile deleted file mode 100644 index 2e075a69..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# SOURCEDIR=. -# SOURCES = $(shell find $(SOURCEDIR) -name '*.go') -# VERSION=$(git describe --always --tags) -# BINARY=bin/pd - -# bin: $(BINARY) - -# $(BINARY): $(SOURCES) -# go build -o $(BINARY) command/* - -.PHONY: build -build: - go get ./... - # go test -v -race -cover ./... - # go tool vet $(SOURCES) - -.PHONY: test -test: - go test ./... - -deploy: - - curl -sL https://git.io/goreleaser | bash - diff --git a/vendor/github.com/PagerDuty/go-pagerduty/README.md b/vendor/github.com/PagerDuty/go-pagerduty/README.md deleted file mode 100644 index eeb83444..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/README.md +++ /dev/null @@ -1,92 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/PagerDuty/go-pagerduty?status.svg)](http://godoc.org/github.com/PagerDuty/go-pagerduty) [![Go Report Card](https://goreportcard.com/badge/github.com/PagerDuty/go-pagerduty)](https://goreportcard.com/report/github.com/PagerDuty/go-pagerduty) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/gojp/goreportcard/blob/master/LICENSE) -# go-pagerduty - -go-pagerduty is a CLI and [go](https://golang.org/) client library for the [PagerDuty v2 API](https://v2.developer.pagerduty.com/v2/page/api-reference). - -## Installation - -First, download the source code -```cli -go get github.com/PagerDuty/go-pagerduty -``` - -Next build the application. -```cli -cd $GOPATH/src/github.com/PagerDuty/go-pagerduty -go build -o $GOPATH/bin/pd command/* -``` -If you do not have the dependencies necessary to build the project, run this in the project root and try again - -```cli -go get ./... -``` - -## Usage - -### CLI - -The CLI requires an [authentication token](https://v2.developer.pagerduty.com/docs/authentication), which can be specified in `.pd.yml` -file in the home directory of the user, or passed as a command-line argument. -Example of config file: - -```yaml ---- -authtoken: fooBar -``` - -#### Commands -`pd` command provides a single entrypoint for all the API endpoints, with individual -API represented by their own sub commands. For an exhaustive list of sub-commands, try: -``` -pd --help -``` - -An example of the `service` sub-command - -``` -pd service list -``` - - -### Client Library - -```go -package main - -import ( - "fmt" - "github.com/PagerDuty/go-pagerduty" -) - -var authtoken = "" // Set your auth token here - -func main() { - var opts pagerduty.ListEscalationPoliciesOptions - client := pagerduty.NewClient(authtoken) - eps, err := client.ListEscalationPolicies(opts) - if err != nil { - panic(err) - } - for _, p := range eps.EscalationPolicies { - fmt.Println(p.Name) - } -} -``` - -The PagerDuty API client also exposes its HTTP client as the `HTTPClient` field. -If you need to use your own HTTP client, for doing things like defining your own -transport settings, you can replace the default HTTP client with your own by -simply by setting a new value in the `HTTPClient` field. -## License -[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) - -## Contributing - -1. Fork it ( https://github.com/PagerDuty/go-pagerduty/fork ) -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create a new Pull Request - -## License -[Apache 2](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/vendor/github.com/PagerDuty/go-pagerduty/ability.go b/vendor/github.com/PagerDuty/go-pagerduty/ability.go deleted file mode 100644 index 26fe9096..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/ability.go +++ /dev/null @@ -1,22 +0,0 @@ -package pagerduty - -// ListAbilityResponse is the response when calling the ListAbility API endpoint. -type ListAbilityResponse struct { - Abilities []string `json:"abilities"` -} - -// ListAbilities lists all abilities on your account. -func (c *Client) ListAbilities() (*ListAbilityResponse, error) { - resp, err := c.get("/abilities") - if err != nil { - return nil, err - } - var result ListAbilityResponse - return &result, c.decodeJSON(resp, &result) -} - -// TestAbility Check if your account has the given ability. -func (c *Client) TestAbility(ability string) error { - _, err := c.get("/abilities/" + ability) - return err -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/addon.go b/vendor/github.com/PagerDuty/go-pagerduty/addon.go deleted file mode 100644 index d5490f3b..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/addon.go +++ /dev/null @@ -1,97 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// Addon is a third-party add-on to PagerDuty's UI. -type Addon struct { - APIObject - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Services []APIObject `json:"services,omitempty"` -} - -// ListAddonOptions are the options available when calling the ListAddons API endpoint. -type ListAddonOptions struct { - APIListObject - Includes []string `url:"include,omitempty,brackets"` - ServiceIDs []string `url:"service_ids,omitempty,brackets"` - Filter string `url:"filter,omitempty"` -} - -// ListAddonResponse is the response when calling the ListAddons API endpoint. -type ListAddonResponse struct { - APIListObject - Addons []Addon `json:"addons"` -} - -// ListAddons lists all of the add-ons installed on your account. -func (c *Client) ListAddons(o ListAddonOptions) (*ListAddonResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/addons?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListAddonResponse - return &result, c.decodeJSON(resp, &result) -} - -// InstallAddon installs an add-on for your account. -func (c *Client) InstallAddon(a Addon) (*Addon, error) { - data := make(map[string]Addon) - data["addon"] = a - resp, err := c.post("/addons", data, nil) - defer resp.Body.Close() - if err != nil { - return nil, err - } - if resp.StatusCode != http.StatusCreated { - return nil, fmt.Errorf("Failed to create. HTTP Status code: %d", resp.StatusCode) - } - return getAddonFromResponse(c, resp) -} - -// DeleteAddon deletes an add-on from your account. -func (c *Client) DeleteAddon(id string) error { - _, err := c.delete("/addons/" + id) - return err -} - -// GetAddon gets details about an existing add-on. -func (c *Client) GetAddon(id string) (*Addon, error) { - resp, err := c.get("/addons/" + id) - if err != nil { - return nil, err - } - return getAddonFromResponse(c, resp) -} - -// UpdateAddon updates an existing add-on. -func (c *Client) UpdateAddon(id string, a Addon) (*Addon, error) { - v := make(map[string]Addon) - v["addon"] = a - resp, err := c.put("/addons/"+id, v, nil) - if err != nil { - return nil, err - } - return getAddonFromResponse(c, resp) -} - -func getAddonFromResponse(c *Client, resp *http.Response) (*Addon, error) { - var result map[string]Addon - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - a, ok := result["addon"] - if !ok { - return nil, fmt.Errorf("JSON response does not have 'addon' field") - } - return &a, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/client.go b/vendor/github.com/PagerDuty/go-pagerduty/client.go deleted file mode 100644 index 6594f8bc..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/client.go +++ /dev/null @@ -1,181 +0,0 @@ -package pagerduty - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net" - "net/http" - "runtime" - "time" -) - -const ( - apiEndpoint = "https://api.pagerduty.com" -) - -// APIObject represents generic api json response that is shared by most -// domain object (like escalation -type APIObject struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Summary string `json:"summary,omitempty"` - Self string `json:"self,omitempty"` - HTMLURL string `json:"html_url,omitempty"` -} - -// APIListObject are the fields used to control pagination when listing objects. -type APIListObject struct { - Limit uint `url:"limit,omitempty"` - Offset uint `url:"offset,omitempty"` - More bool `url:"more,omitempty"` - Total uint `url:"total,omitempty"` -} - -// APIReference are the fields required to reference another API object. -type APIReference struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` -} - -type APIDetails struct { - Type string `json:"type,omitempty"` - Details string `json:"details,omitempty"` -} - -type errorObject struct { - Code int `json:"code,omitempty"` - Message string `json:"message,omitempty"` - Errors interface{} `json:"errors,omitempty"` -} - -func newDefaultHTTPClient() *http.Client { - return &http.Client{ - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - MaxIdleConns: 10, - IdleConnTimeout: 60 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, - }, - } -} - -// HTTPClient is an interface which declares the functionality we need from an -// HTTP client. This is to allow consumers to provide their own HTTP client as -// needed, without restricting them to only using *http.Client. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// defaultHTTPClient is our own default HTTP client. We use this, instead of -// http.DefaultClient, to avoid other packages tweaks to http.DefaultClient -// causing issues with our HTTP calls. This also allows us to tweak the -// transport values to be more resilient without making changes to the -// http.DefaultClient. -// -// Keep this unexported so consumers of the package can't make changes to it. -var defaultHTTPClient HTTPClient = newDefaultHTTPClient() - -// Client wraps http client -type Client struct { - authToken string - apiEndpoint string - - // HTTPClient is the HTTP client used for making requests against the - // PagerDuty API. You can use either *http.Client here, or your own - // implementation. - HTTPClient HTTPClient -} - -// NewClient creates an API client -func NewClient(authToken string) *Client { - return &Client{ - authToken: authToken, - apiEndpoint: apiEndpoint, - HTTPClient: defaultHTTPClient, - } -} - -func (c *Client) delete(path string) (*http.Response, error) { - return c.do("DELETE", path, nil, nil) -} - -func (c *Client) put(path string, payload interface{}, headers *map[string]string) (*http.Response, error) { - - if payload != nil { - data, err := json.Marshal(payload) - if err != nil { - return nil, err - } - return c.do("PUT", path, bytes.NewBuffer(data), headers) - } - return c.do("PUT", path, nil, headers) -} - -func (c *Client) post(path string, payload interface{}, headers *map[string]string) (*http.Response, error) { - data, err := json.Marshal(payload) - if err != nil { - return nil, err - } - return c.do("POST", path, bytes.NewBuffer(data), headers) -} - -func (c *Client) get(path string) (*http.Response, error) { - return c.do("GET", path, nil, nil) -} - -func (c *Client) do(method, path string, body io.Reader, headers *map[string]string) (*http.Response, error) { - endpoint := c.apiEndpoint + path - req, _ := http.NewRequest(method, endpoint, body) - req.Header.Set("Accept", "application/vnd.pagerduty+json;version=2") - if headers != nil { - for k, v := range *headers { - req.Header.Set(k, v) - } - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Authorization", "Token token="+c.authToken) - - resp, err := c.HTTPClient.Do(req) - return c.checkResponse(resp, err) -} - -func (c *Client) decodeJSON(resp *http.Response, payload interface{}) error { - defer resp.Body.Close() - decoder := json.NewDecoder(resp.Body) - return decoder.Decode(payload) -} - -func (c *Client) checkResponse(resp *http.Response, err error) (*http.Response, error) { - if err != nil { - return resp, fmt.Errorf("Error calling the API endpoint: %v", err) - } - if 199 >= resp.StatusCode || 300 <= resp.StatusCode { - var eo *errorObject - var getErr error - if eo, getErr = c.getErrorFromResponse(resp); getErr != nil { - return resp, fmt.Errorf("Response did not contain formatted error: %s. HTTP response code: %v. Raw response: %+v", getErr, resp.StatusCode, resp) - } - return resp, fmt.Errorf("Failed call API endpoint. HTTP response code: %v. Error: %v", resp.StatusCode, eo) - } - return resp, nil -} - -func (c *Client) getErrorFromResponse(resp *http.Response) (*errorObject, error) { - var result map[string]errorObject - if err := c.decodeJSON(resp, &result); err != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", err) - } - s, ok := result["error"] - if !ok { - return nil, fmt.Errorf("JSON response does not have error field") - } - return &s, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/escalation_policy.go b/vendor/github.com/PagerDuty/go-pagerduty/escalation_policy.go deleted file mode 100644 index 74befc66..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/escalation_policy.go +++ /dev/null @@ -1,186 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -const ( - escPath = "/escalation_policies" -) - -// EscalationRule is a rule for an escalation policy to trigger. -type EscalationRule struct { - ID string `json:"id,omitempty"` - Delay uint `json:"escalation_delay_in_minutes,omitempty"` - Targets []APIObject `json:"targets"` -} - -// EscalationPolicy is a collection of escalation rules. -type EscalationPolicy struct { - APIObject - Name string `json:"name,omitempty"` - EscalationRules []EscalationRule `json:"escalation_rules,omitempty"` - Services []APIObject `json:"services,omitempty"` - NumLoops uint `json:"num_loops,omitempty"` - Teams []APIReference `json:"teams"` - Description string `json:"description,omitempty"` - RepeatEnabled bool `json:"repeat_enabled,omitempty"` -} - -// ListEscalationPoliciesResponse is the data structure returned from calling the ListEscalationPolicies API endpoint. -type ListEscalationPoliciesResponse struct { - APIListObject - EscalationPolicies []EscalationPolicy `json:"escalation_policies"` -} - -type ListEscalationRulesResponse struct { - APIListObject - EscalationRules []EscalationRule `json:"escalation_rules"` -} - -// ListEscalationPoliciesOptions is the data structure used when calling the ListEscalationPolicies API endpoint. -type ListEscalationPoliciesOptions struct { - APIListObject - Query string `url:"query,omitempty"` - UserIDs []string `url:"user_ids,omitempty,brackets"` - TeamIDs []string `url:"team_ids,omitempty,brackets"` - Includes []string `url:"include,omitempty,brackets"` - SortBy string `url:"sort_by,omitempty"` -} - -// GetEscalationRuleOptions is the data structure used when calling the GetEscalationRule API endpoint. -type GetEscalationRuleOptions struct { - Includes []string `url:"include,omitempty,brackets"` -} - -// ListEscalationPolicies lists all of the existing escalation policies. -func (c *Client) ListEscalationPolicies(o ListEscalationPoliciesOptions) (*ListEscalationPoliciesResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get(escPath + "?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListEscalationPoliciesResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateEscalationPolicy creates a new escalation policy. -func (c *Client) CreateEscalationPolicy(e EscalationPolicy) (*EscalationPolicy, error) { - data := make(map[string]EscalationPolicy) - data["escalation_policy"] = e - resp, err := c.post(escPath, data, nil) - return getEscalationPolicyFromResponse(c, resp, err) -} - -// DeleteEscalationPolicy deletes an existing escalation policy and rules. -func (c *Client) DeleteEscalationPolicy(id string) error { - _, err := c.delete(escPath + "/" + id) - return err -} - -// GetEscalationPolicyOptions is the data structure used when calling the GetEscalationPolicy API endpoint. -type GetEscalationPolicyOptions struct { - Includes []string `url:"include,omitempty,brackets"` -} - -// GetEscalationPolicy gets information about an existing escalation policy and its rules. -func (c *Client) GetEscalationPolicy(id string, o *GetEscalationPolicyOptions) (*EscalationPolicy, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get(escPath + "/" + id + "?" + v.Encode()) - return getEscalationPolicyFromResponse(c, resp, err) -} - -// UpdateEscalationPolicy updates an existing escalation policy and its rules. -func (c *Client) UpdateEscalationPolicy(id string, e *EscalationPolicy) (*EscalationPolicy, error) { - data := make(map[string]EscalationPolicy) - data["escalation_policy"] = *e - resp, err := c.put(escPath+"/"+id, data, nil) - return getEscalationPolicyFromResponse(c, resp, err) -} - -// CreateEscalationRule creates a new escalation rule for an escalation policy -// and appends it to the end of the existing escalation rules. -func (c *Client) CreateEscalationRule(escID string, e EscalationRule) (*EscalationRule, error) { - data := make(map[string]EscalationRule) - data["escalation_rule"] = e - resp, err := c.post(escPath+"/"+escID+"/escalation_rules", data, nil) - return getEscalationRuleFromResponse(c, resp, err) -} - -// GetEscalationRule gets information about an existing escalation rule. -func (c *Client) GetEscalationRule(escID string, id string, o *GetEscalationRuleOptions) (*EscalationRule, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get(escPath + "/" + escID + "/escalation_rules/" + id + "?" + v.Encode()) - return getEscalationRuleFromResponse(c, resp, err) -} - -// DeleteEscalationRule deletes an existing escalation rule. -func (c *Client) DeleteEscalationRule(escID string, id string) error { - _, err := c.delete(escPath + "/" + escID + "/escalation_rules/" + id) - return err -} - -// UpdateEscalationRule updates an existing escalation rule. -func (c *Client) UpdateEscalationRule(escID string, id string, e *EscalationRule) (*EscalationRule, error) { - data := make(map[string]EscalationRule) - data["escalation_rule"] = *e - resp, err := c.put(escPath+"/"+escID+"/escalation_rules/"+id, data, nil) - return getEscalationRuleFromResponse(c, resp, err) -} - -// ListEscalationRules lists all of the escalation rules for an existing escalation policy. -func (c *Client) ListEscalationRules(escID string) (*ListEscalationRulesResponse, error) { - resp, err := c.get(escPath + "/" + escID + "/escalation_rules") - if err != nil { - return nil, err - } - - var result ListEscalationRulesResponse - return &result, c.decodeJSON(resp, &result) -} - -func getEscalationRuleFromResponse(c *Client, resp *http.Response, err error) (*EscalationRule, error) { - defer resp.Body.Close() - if err != nil { - return nil, err - } - var target map[string]EscalationRule - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "escalation_rule" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} - -func getEscalationPolicyFromResponse(c *Client, resp *http.Response, err error) (*EscalationPolicy, error) { - defer resp.Body.Close() - if err != nil { - return nil, err - } - var target map[string]EscalationPolicy - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "escalation_policy" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/event.go b/vendor/github.com/PagerDuty/go-pagerduty/event.go deleted file mode 100644 index e3519710..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/event.go +++ /dev/null @@ -1,62 +0,0 @@ -package pagerduty - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" -) - -const eventEndPoint = "https://events.pagerduty.com/generic/2010-04-15/create_event.json" - -// Event stores data for problem reporting, acknowledgement, and resolution. -type Event struct { - ServiceKey string `json:"service_key"` - Type string `json:"event_type"` - IncidentKey string `json:"incident_key,omitempty"` - Description string `json:"description"` - Client string `json:"client,omitempty"` - ClientURL string `json:"client_url,omitempty"` - Details interface{} `json:"details,omitempty"` - Contexts []interface{} `json:"contexts,omitempty"` -} - -// EventResponse is the data returned from the CreateEvent API endpoint. -type EventResponse struct { - Status string `json:"status"` - Message string `json:"message"` - IncidentKey string `json:"incident_key"` -} - -// CreateEvent sends PagerDuty an event to trigger, acknowledge, or resolve a -// problem. If you need to provide a custom HTTP client, please use -// CreateEventWithHTTPClient. -func CreateEvent(e Event) (*EventResponse, error) { - return CreateEventWithHTTPClient(e, defaultHTTPClient) -} - -// CreateEventWithHTTPClient sends PagerDuty an event to trigger, acknowledge, -// or resolve a problem. This function accepts a custom HTTP Client, if the -// default one used by this package doesn't fit your needs. If you don't need a -// custom HTTP client, please use CreateEvent instead. -func CreateEventWithHTTPClient(e Event, client HTTPClient) (*EventResponse, error) { - data, err := json.Marshal(e) - if err != nil { - return nil, err - } - req, _ := http.NewRequest("POST", eventEndPoint, bytes.NewBuffer(data)) - req.Header.Set("Content-Type", "application/json") - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("HTTP Status Code: %d", resp.StatusCode) - } - var eventResponse EventResponse - if err := json.NewDecoder(resp.Body).Decode(&eventResponse); err != nil { - return nil, err - } - return &eventResponse, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/event_v2.go b/vendor/github.com/PagerDuty/go-pagerduty/event_v2.go deleted file mode 100644 index 1051cf79..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/event_v2.go +++ /dev/null @@ -1,69 +0,0 @@ -package pagerduty - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" -) - -// Event includes the incident/alert details -type V2Event struct { - RoutingKey string `json:"routing_key"` - Action string `json:"event_action"` - DedupKey string `json:"dedup_key,omitempty"` - Images []interface{} `json:"images,omitempty"` - Links []interface{} `json:"links,omitempty"` - Client string `json:"client,omitempty"` - ClientURL string `json:"client_url,omitempty"` - Payload *V2Payload `json:"payload,omitempty"` -} - -// Payload represents the individual event details for an event -type V2Payload struct { - Summary string `json:"summary"` - Source string `json:"source"` - Severity string `json:"severity"` - Timestamp string `json:"timestamp,omitempty"` - Component string `json:"component,omitempty"` - Group string `json:"group,omitempty"` - Class string `json:"class,omitempty"` - Details interface{} `json:"custom_details,omitempty"` -} - -// Response is the json response body for an event -type V2EventResponse struct { - RoutingKey string `json:"routing_key"` - DedupKey string `json:"dedup_key"` - EventAction string `json:"event_action"` -} - -const v2eventEndPoint = "https://events.pagerduty.com/v2/enqueue" - -// ManageEvent handles the trigger, acknowledge, and resolve methods for an event -func ManageEvent(e V2Event) (*V2EventResponse, error) { - data, err := json.Marshal(e) - if err != nil { - return nil, err - } - req, _ := http.NewRequest("POST", v2eventEndPoint, bytes.NewBuffer(data)) - req.Header.Set("Content-Type", "application/json") - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusAccepted { - bytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("HTTP Status Code: %d", resp.StatusCode) - } - return nil, fmt.Errorf("HTTP Status Code: %d, Message: %s", resp.StatusCode, string(bytes)) - } - var eventResponse V2EventResponse - if err := json.NewDecoder(resp.Body).Decode(&eventResponse); err != nil { - return nil, err - } - return &eventResponse, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/incident.go b/vendor/github.com/PagerDuty/go-pagerduty/incident.go deleted file mode 100644 index 8dd8649f..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/incident.go +++ /dev/null @@ -1,307 +0,0 @@ -package pagerduty - -import ( - "encoding/json" - "fmt" - - "github.com/google/go-querystring/query" -) - -// Acknowledgement is the data structure of an acknowledgement of an incident. -type Acknowledgement struct { - At string `json:"at,omitempty"` - Acknowledger APIObject `json:"acknowledger,omitempty"` -} - -// PendingAction is the data structure for any pending actions on an incident. -type PendingAction struct { - Type string `json:"type,omitempty"` - At string `json:"at,omitempty"` -} - -// Assignment is the data structure for an assignment of an incident -type Assignment struct { - At string `json:"at,omitempty"` - Assignee APIObject `json:"assignee,omitempty"` -} - -// AlertCounts is the data structure holding a summary of the number of alerts by status of an incident. -type AlertCounts struct { - Triggered uint `json:"triggered,omitempty"` - Resolved uint `json:"resolved,omitempty"` - All uint `json:"all,omitempty"` -} - -// Priority is the data structure describing the priority of an incident. -type Priority struct { - APIObject - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` -} - -// Resolve reason is the data structure describing the reason an incident was resolved -type ResolveReason struct { - Type string `json:"type,omitempty"` - Incident APIObject `json:"incident"` -} - -// IncidentBody is the datastructure containing data describing the incident. -type IncidentBody struct { - Type string `json:"type,omitempty"` - Details string `json:"details,omitempty"` -} - -// Incident is a normalized, de-duplicated event generated by a PagerDuty integration. -type Incident struct { - APIObject - IncidentNumber uint `json:"incident_number,omitempty"` - Title string `json:"title,omitempty"` - Description string `json:"description,omitempty"` - CreatedAt string `json:"created_at,omitempty"` - PendingActions []PendingAction `json:"pending_actions,omitempty"` - IncidentKey string `json:"incident_key,omitempty"` - Service APIObject `json:"service,omitempty"` - Assignments []Assignment `json:"assignments,omitempty"` - Acknowledgements []Acknowledgement `json:"acknowledgements,omitempty"` - LastStatusChangeAt string `json:"last_status_change_at,omitempty"` - LastStatusChangeBy APIObject `json:"last_status_change_by,omitempty"` - FirstTriggerLogEntry APIObject `json:"first_trigger_log_entry,omitempty"` - EscalationPolicy APIObject `json:"escalation_policy,omitempty"` - Teams []APIObject `json:"teams,omitempty"` - Priority *Priority `json:"priority,omitempty"` - Urgency string `json:"urgency,omitempty"` - Status string `json:"status,omitempty"` - Id string `json:"id,omitempty"` - ResolveReason ResolveReason `json:"resolve_reason,omitempty"` - AlertCounts AlertCounts `json:"alert_counts,omitempty"` - Body IncidentBody `json:"body,omitempty"` - IsMergeable bool `json:"is_mergeable,omitempty"` -} - -// ListIncidentsResponse is the response structure when calling the ListIncident API endpoint. -type ListIncidentsResponse struct { - APIListObject - Incidents []Incident `json:"incidents,omitempty"` -} - -// ListIncidentsOptions is the structure used when passing parameters to the ListIncident API endpoint. -type ListIncidentsOptions struct { - APIListObject - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - DateRange string `url:"date_range,omitempty"` - Statuses []string `url:"statuses,omitempty,brackets"` - IncidentKey string `url:"incident_key,omitempty"` - ServiceIDs []string `url:"service_ids,omitempty,brackets"` - TeamIDs []string `url:"team_ids,omitempty,brackets"` - UserIDs []string `url:"user_ids,omitempty,brackets"` - Urgencies []string `url:"urgencies,omitempty,brackets"` - TimeZone string `url:"time_zone,omitempty"` - SortBy string `url:"sort_by,omitempty"` - Includes []string `url:"include,omitempty,brackets"` -} - -// ListIncidents lists existing incidents. -func (c *Client) ListIncidents(o ListIncidentsOptions) (*ListIncidentsResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/incidents?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListIncidentsResponse - return &result, c.decodeJSON(resp, &result) -} - -// createIncidentResponse is returned from the API when creating a response. -type createIncidentResponse struct { - Incident Incident `json:"incident"` -} - -// CreateIncidentOptions is the structure used when POSTing to the CreateIncident API endpoint. -type CreateIncidentOptions struct { - Type string `json:"type"` - Title string `json:"title"` - Service *APIReference `json:"service"` - Priority *APIReference `json:"priority,omitempty"` - IncidentKey string `json:"incident_key,omitempty"` - Body *APIDetails `json:"body,omitempty"` - EscalationPolicy *APIReference `json:"escalation_policy,omitempty"` -} - -// CreateIncident creates an incident synchronously without a corresponding event from a monitoring service. -func (c *Client) CreateIncident(from string, o *CreateIncidentOptions) (*Incident, error) { - headers := make(map[string]string) - headers["From"] = from - data := make(map[string]*CreateIncidentOptions) - data["incident"] = o - resp, e := c.post("/incidents", data, &headers) - if e != nil { - return nil, e - } - - var ii createIncidentResponse - e = json.NewDecoder(resp.Body).Decode(&ii) - if e != nil { - return nil, e - } - - return &ii.Incident, nil -} - -// ManageIncidents acknowledges, resolves, escalates, or reassigns one or more incidents. -func (c *Client) ManageIncidents(from string, incidents []Incident) error { - r := make(map[string][]Incident) - headers := make(map[string]string) - headers["From"] = from - r["incidents"] = incidents - _, e := c.put("/incidents", r, &headers) - return e -} - -// MergeIncidents a list of source incidents into a specified incident. -func (c *Client) MergeIncidents(from string, id string, incidents []Incident) error { - r := make(map[string][]Incident) - r["source_incidents"] = incidents - headers := make(map[string]string) - headers["From"] = from - _, e := c.put("/incidents/"+id+"/merge", r, &headers) - return e -} - -// GetIncident shows detailed information about an incident. -func (c *Client) GetIncident(id string) (*Incident, error) { - resp, err := c.get("/incidents/" + id) - if err != nil { - return nil, err - } - var result map[string]Incident - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - i, ok := result["incident"] - if !ok { - return nil, fmt.Errorf("JSON response does not have incident field") - } - return &i, nil -} - -// IncidentNote is a note for the specified incident. -type IncidentNote struct { - ID string `json:"id,omitempty"` - User APIObject `json:"user,omitempty"` - Content string `json:"content,omitempty"` - CreatedAt string `json:"created_at,omitempty"` -} - -// ListIncidentNotes lists existing notes for the specified incident. -func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error) { - resp, err := c.get("/incidents/" + id + "/notes") - if err != nil { - return nil, err - } - var result map[string][]IncidentNote - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - notes, ok := result["notes"] - if !ok { - return nil, fmt.Errorf("JSON response does not have notes field") - } - return notes, nil -} - -// IncidentAlert is a alert for the specified incident. -type IncidentAlert struct { - APIObject - CreatedAt string `json:"created_at,omitempty"` - Status string `json:"status,omitempty"` - AlertKey string `json:"alert_key,omitempty"` - Service APIObject `json:"service,omitempty"` - Body map[string]interface{} `json:"body,omitempty"` - Incident APIReference `json:"incident,omitempty"` - Suppressed bool `json:"suppressed,omitempty"` - Severity string `json:"severity,omitempty"` - Integration APIObject `json:"integration,omitempty"` -} - -// ListAlertsResponse is the response structure when calling the ListAlert API endpoint. -type ListAlertsResponse struct { - APIListObject - Alerts []IncidentAlert `json:"alerts,omitempty"` -} - -// ListIncidentAlerts lists existing alerts for the specified incident. -func (c *Client) ListIncidentAlerts(id string) (*ListAlertsResponse, error) { - resp, err := c.get("/incidents/" + id + "/alerts") - if err != nil { - return nil, err - } - - var result ListAlertsResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateIncidentNote creates a new note for the specified incident. -func (c *Client) CreateIncidentNote(id string, note IncidentNote) error { - data := make(map[string]IncidentNote) - headers := make(map[string]string) - headers["From"] = note.User.Summary - - data["note"] = note - _, err := c.post("/incidents/"+id+"/notes", data, &headers) - return err -} - -// SnoozeIncident sets an incident to not alert for a specified period of time. -func (c *Client) SnoozeIncident(id string, duration uint) error { - data := make(map[string]uint) - data["duration"] = duration - _, err := c.post("/incidents/"+id+"/snooze", data, nil) - return err -} - -// ListIncidentLogEntriesResponse is the response structure when calling the ListIncidentLogEntries API endpoint. -type ListIncidentLogEntriesResponse struct { - APIListObject - LogEntries []LogEntry `json:"log_entries,omitempty"` -} - -// ListIncidentLogEntriesOptions is the structure used when passing parameters to the ListIncidentLogEntries API endpoint. -type ListIncidentLogEntriesOptions struct { - APIListObject - Includes []string `url:"include,omitempty,brackets"` - IsOverview bool `url:"is_overview,omitempty"` - TimeZone string `url:"time_zone,omitempty"` -} - -// ListIncidentLogEntries lists existing log entries for the specified incident. -func (c *Client) ListIncidentLogEntries(id string, o ListIncidentLogEntriesOptions) (*ListIncidentLogEntriesResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/incidents/" + id + "/log_entries?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListIncidentLogEntriesResponse - return &result, c.decodeJSON(resp, &result) -} - -// Alert is a list of all of the alerts that happened to an incident. -type Alert struct { - APIObject - Service APIObject `json:"service,omitempty"` - CreatedAt string `json:"created_at,omitempty"` - Status string `json:"status,omitempty"` - AlertKey string `json:"alert_key,omitempty"` - Incident APIObject `json:"incident,omitempty"` -} - -type ListAlertResponse struct { - APIListObject - Alerts []Alert `json:"alerts,omitempty"` -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/log_entry.go b/vendor/github.com/PagerDuty/go-pagerduty/log_entry.go deleted file mode 100644 index 1b5e2fc0..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/log_entry.go +++ /dev/null @@ -1,94 +0,0 @@ -package pagerduty - -import ( - "fmt" - - "github.com/google/go-querystring/query" -) - -// Agent is the actor who carried out the action. -type Agent APIObject - -// Channel is the means by which the action was carried out. -type Channel struct { - Type string -} - -// Context are to be included with the trigger such as links to graphs or images. -type Context struct { - Alt string - Href string - Src string - Text string - Type string -} - -// LogEntry is a list of all of the events that happened to an incident. -type LogEntry struct { - APIObject - CreatedAt string `json:"created_at"` - Agent Agent - Channel Channel - Incident Incident - Teams []Team - Contexts []Context - AcknowledgementTimeout int `json:"acknowledgement_timeout"` - EventDetails map[string]string -} - -// ListLogEntryResponse is the response data when calling the ListLogEntry API endpoint. -type ListLogEntryResponse struct { - APIListObject - LogEntries []LogEntry `json:"log_entries"` -} - -// ListLogEntriesOptions is the data structure used when calling the ListLogEntry API endpoint. -type ListLogEntriesOptions struct { - APIListObject - TimeZone string `url:"time_zone"` - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - IsOverview bool `url:"is_overview,omitempty"` - Includes []string `url:"include,omitempty,brackets"` -} - -// ListLogEntries lists all of the incident log entries across the entire account. -func (c *Client) ListLogEntries(o ListLogEntriesOptions) (*ListLogEntryResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/log_entries?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListLogEntryResponse - return &result, c.decodeJSON(resp, &result) -} - -// GetLogEntryOptions is the data structure used when calling the GetLogEntry API endpoint. -type GetLogEntryOptions struct { - TimeZone string `url:"time_zone,omitempty"` - Includes []string `url:"include,omitempty,brackets"` -} - -// GetLogEntry list log entries for the specified incident. -func (c *Client) GetLogEntry(id string, o GetLogEntryOptions) (*LogEntry, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/log_entries/" + id + "?" + v.Encode()) - if err != nil { - return nil, err - } - var result map[string]LogEntry - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - le, ok := result["log_entry"] - if !ok { - return nil, fmt.Errorf("JSON response does not have log_entry field") - } - return &le, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/maintenance_window.go b/vendor/github.com/PagerDuty/go-pagerduty/maintenance_window.go deleted file mode 100644 index 21e9061f..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/maintenance_window.go +++ /dev/null @@ -1,112 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// MaintenanceWindow is used to temporarily disable one or more services for a set period of time. -type MaintenanceWindow struct { - APIObject - SequenceNumber uint `json:"sequence_number,omitempty"` - StartTime string `json:"start_time"` - EndTime string `json:"end_time"` - Description string `json:"description"` - Services []APIObject `json:"services"` - Teams []APIListObject `json:"teams"` - CreatedBy APIListObject `json:"created_by"` -} - -// ListMaintenanceWindowsResponse is the data structur returned from calling the ListMaintenanceWindows API endpoint. -type ListMaintenanceWindowsResponse struct { - APIListObject - MaintenanceWindows []MaintenanceWindow `json:"maintenance_windows"` -} - -// ListMaintenanceWindowsOptions is the data structure used when calling the ListMaintenanceWindows API endpoint. -type ListMaintenanceWindowsOptions struct { - APIListObject - Query string `url:"query,omitempty"` - Includes []string `url:"include,omitempty,brackets"` - TeamIDs []string `url:"team_ids,omitempty,brackets"` - ServiceIDs []string `url:"service_ids,omitempty,brackets"` - Filter string `url:"filter,omitempty,brackets"` -} - -// ListMaintenanceWindows lists existing maintenance windows, optionally filtered by service and/or team, or whether they are from the past, present or future. -func (c *Client) ListMaintenanceWindows(o ListMaintenanceWindowsOptions) (*ListMaintenanceWindowsResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/maintenance_windows?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListMaintenanceWindowsResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateMaintenanceWindow creates a new maintenance window for the specified services. -func (c *Client) CreateMaintenanceWindow(from string, o MaintenanceWindow) (*MaintenanceWindow, error) { - data := make(map[string]MaintenanceWindow) - o.Type = "maintenance_window" - data["maintenance_window"] = o - headers := make(map[string]string) - if from != "" { - headers["From"] = from - } - resp, err := c.post("/maintenance_windows", data, &headers) - return getMaintenanceWindowFromResponse(c, resp, err) -} - -// CreateMaintenanceWindows creates a new maintenance window for the specified services. -// Deprecated: Use `CreateMaintenanceWindow` instead. -func (c *Client) CreateMaintenanceWindows(o MaintenanceWindow) (*MaintenanceWindow, error) { - return c.CreateMaintenanceWindow("", o) -} - -// DeleteMaintenanceWindow deletes an existing maintenance window if it's in the future, or ends it if it's currently on-going. -func (c *Client) DeleteMaintenanceWindow(id string) error { - _, err := c.delete("/maintenance_windows/" + id) - return err -} - -// GetMaintenanceWindowOptions is the data structure used when calling the GetMaintenanceWindow API endpoint. -type GetMaintenanceWindowOptions struct { - Includes []string `url:"include,omitempty,brackets"` -} - -// GetMaintenanceWindow gets an existing maintenance window. -func (c *Client) GetMaintenanceWindow(id string, o GetMaintenanceWindowOptions) (*MaintenanceWindow, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/maintenance_windows/" + id + "?" + v.Encode()) - return getMaintenanceWindowFromResponse(c, resp, err) -} - -// UpdateMaintenanceWindow updates an existing maintenance window. -func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) (*MaintenanceWindow, error) { - resp, err := c.put("/maintenance_windows/"+m.ID, m, nil) - return getMaintenanceWindowFromResponse(c, resp, err) -} - -func getMaintenanceWindowFromResponse(c *Client, resp *http.Response, err error) (*MaintenanceWindow, error) { - if err != nil { - return nil, err - } - var target map[string]MaintenanceWindow - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "maintenance_window" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/notification.go b/vendor/github.com/PagerDuty/go-pagerduty/notification.go deleted file mode 100644 index cdd87c12..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/notification.go +++ /dev/null @@ -1,44 +0,0 @@ -package pagerduty - -import ( - "github.com/google/go-querystring/query" -) - -// Notification is a message containing the details of the incident. -type Notification struct { - ID string `json:"id"` - Type string - StartedAt string `json:"started_at"` - Address string - User APIObject -} - -// ListNotificationOptions is the data structure used when calling the ListNotifications API endpoint. -type ListNotificationOptions struct { - APIListObject - TimeZone string `url:"time_zone,omitempty"` - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - Filter string `url:"filter,omitempty"` - Includes []string `url:"include,omitempty"` -} - -// ListNotificationsResponse is the data structure returned from the ListNotifications API endpoint. -type ListNotificationsResponse struct { - APIListObject - Notifications []Notification -} - -// ListNotifications lists notifications for a given time range, optionally filtered by type (sms_notification, email_notification, phone_notification, or push_notification). -func (c *Client) ListNotifications(o ListNotificationOptions) (*ListNotificationsResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/notifications?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListNotificationsResponse - return &result, c.decodeJSON(resp, &result) -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/on_call.go b/vendor/github.com/PagerDuty/go-pagerduty/on_call.go deleted file mode 100644 index 537ef102..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/on_call.go +++ /dev/null @@ -1,48 +0,0 @@ -package pagerduty - -import ( - "github.com/google/go-querystring/query" -) - -// OnCall represents a contiguous unit of time for which a user will be on call for a given escalation policy and escalation rule. -type OnCall struct { - User User `json:"user,omitempty"` - Schedule Schedule `json:"schedule,omitempty"` - EscalationPolicy EscalationPolicy `json:"escalation_policy,omitempty"` - EscalationLevel uint `json:"escalation_level,omitempty"` - Start string `json:"start,omitempty"` - End string `json:"end,omitempty"` -} - -// ListOnCallsResponse is the data structure returned from calling the ListOnCalls API endpoint. -type ListOnCallsResponse struct { - APIListObject - OnCalls []OnCall `json:"oncalls"` -} - -// ListOnCallOptions is the data structure used when calling the ListOnCalls API endpoint. -type ListOnCallOptions struct { - APIListObject - TimeZone string `url:"time_zone,omitempty"` - Includes []string `url:"include,omitempty,brackets"` - UserIDs []string `url:"user_ids,omitempty,brackets"` - EscalationPolicyIDs []string `url:"escalation_policy_ids,omitempty,brackets"` - ScheduleIDs []string `url:"schedule_ids,omitempty,brackets"` - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - Earliest bool `url:"earliest,omitempty"` -} - -// ListOnCalls list the on-call entries during a given time range. -func (c *Client) ListOnCalls(o ListOnCallOptions) (*ListOnCallsResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/oncalls?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListOnCallsResponse - return &result, c.decodeJSON(resp, &result) -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/priorites.go b/vendor/github.com/PagerDuty/go-pagerduty/priorites.go deleted file mode 100644 index 69a33a2b..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/priorites.go +++ /dev/null @@ -1,33 +0,0 @@ -package pagerduty - -import ( - "encoding/json" -) - -// PriorityProperty is a single priorty object returned from the Priorities endpoint -type PriorityProperty struct { - APIObject - Name string `json:"name"` - Description string `json:"description"` -} - -type Priorities struct { - APIListObject - Priorities []PriorityProperty `json:"priorities"` -} - -// ListPriorities lists existing priorities -func (c *Client) ListPriorities() (*Priorities, error) { - resp, e := c.get("/priorities") - if e != nil { - return nil, e - } - - var p Priorities - e = json.NewDecoder(resp.Body).Decode(&p) - if e != nil { - return nil, e - } - - return &p, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/schedule.go b/vendor/github.com/PagerDuty/go-pagerduty/schedule.go deleted file mode 100644 index 40e0acde..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/schedule.go +++ /dev/null @@ -1,264 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// Restriction limits on-call responsibility for a layer to certain times of the day or week. -type Restriction struct { - Type string `json:"type,omitempty"` - StartTimeOfDay string `json:"start_time_of_day,omitempty"` - StartDayOfWeek uint `json:"start_day_of_week,omitempty"` - DurationSeconds uint `json:"duration_seconds,omitempty"` -} - -// RenderedScheduleEntry represents the computed set of schedule layer entries that put users on call for a schedule, and cannot be modified directly. -type RenderedScheduleEntry struct { - Start string `json:"start,omitempty"` - End string `json:"end,omitempty"` - User APIObject `json:"user,omitempty"` -} - -// ScheduleLayer is an entry that puts users on call for a schedule. -type ScheduleLayer struct { - APIObject - Name string `json:"name,omitempty"` - Start string `json:"start,omitempty"` - End string `json:"end,omitempty"` - RotationVirtualStart string `json:"rotation_virtual_start,omitempty"` - RotationTurnLengthSeconds uint `json:"rotation_turn_length_seconds,omitempty"` - Users []UserReference `json:"users,omitempty"` - Restrictions []Restriction `json:"restrictions,omitempty"` - RenderedScheduleEntries []RenderedScheduleEntry `json:"rendered_schedule_entries,omitempty"` - RenderedCoveragePercentage float64 `json:"rendered_coverage_percentage,omitempty"` -} - -// Schedule determines the time periods that users are on call. -type Schedule struct { - APIObject - Name string `json:"name,omitempty"` - TimeZone string `json:"time_zone,omitempty"` - Description string `json:"description,omitempty"` - EscalationPolicies []APIObject `json:"escalation_policies,omitempty"` - Users []APIObject `json:"users,omitempty"` - ScheduleLayers []ScheduleLayer `json:"schedule_layers,omitempty"` - OverrideSubschedule ScheduleLayer `json:"override_subschedule,omitempty"` - FinalSchedule ScheduleLayer `json:"final_schedule,omitempty"` -} - -// ListSchedulesOptions is the data structure used when calling the ListSchedules API endpoint. -type ListSchedulesOptions struct { - APIListObject - Query string `url:"query,omitempty"` -} - -// ListSchedulesResponse is the data structure returned from calling the ListSchedules API endpoint. -type ListSchedulesResponse struct { - APIListObject - Schedules []Schedule `json:"schedules"` -} - -// UserReference is a reference to an authorized PagerDuty user. -type UserReference struct { - User APIObject `json:"user"` -} - -// ListSchedules lists the on-call schedules. -func (c *Client) ListSchedules(o ListSchedulesOptions) (*ListSchedulesResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/schedules?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListSchedulesResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateSchedule creates a new on-call schedule. -func (c *Client) CreateSchedule(s Schedule) (*Schedule, error) { - data := make(map[string]Schedule) - data["schedule"] = s - resp, err := c.post("/schedules", data, nil) - if err != nil { - return nil, err - } - return getScheduleFromResponse(c, resp) -} - -// PreviewScheduleOptions is the data structure used when calling the PreviewSchedule API endpoint. -type PreviewScheduleOptions struct { - APIListObject - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - Overflow bool `url:"overflow,omitempty"` -} - -// PreviewSchedule previews what an on-call schedule would look like without saving it. -func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error { - v, err := query.Values(o) - if err != nil { - return err - } - var data map[string]Schedule - data["schedule"] = s - _, e := c.post("/schedules/preview?"+v.Encode(), data, nil) - return e -} - -// DeleteSchedule deletes an on-call schedule. -func (c *Client) DeleteSchedule(id string) error { - _, err := c.delete("/schedules/" + id) - return err -} - -// GetScheduleOptions is the data structure used when calling the GetSchedule API endpoint. -type GetScheduleOptions struct { - APIListObject - TimeZone string `url:"time_zone,omitempty"` - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` -} - -// GetSchedule shows detailed information about a schedule, including entries for each layer and sub-schedule. -func (c *Client) GetSchedule(id string, o GetScheduleOptions) (*Schedule, error) { - v, err := query.Values(o) - if err != nil { - return nil, fmt.Errorf("Could not parse values for query: %v", err) - } - resp, err := c.get("/schedules/" + id + "?" + v.Encode()) - if err != nil { - return nil, err - } - return getScheduleFromResponse(c, resp) -} - -// UpdateScheduleOptions is the data structure used when calling the UpdateSchedule API endpoint. -type UpdateScheduleOptions struct { - Overflow bool `url:"overflow,omitempty"` -} - -// UpdateSchedule updates an existing on-call schedule. -func (c *Client) UpdateSchedule(id string, s Schedule) (*Schedule, error) { - v := make(map[string]Schedule) - v["schedule"] = s - resp, err := c.put("/schedules/"+id, v, nil) - if err != nil { - return nil, err - } - return getScheduleFromResponse(c, resp) -} - -// ListOverridesOptions is the data structure used when calling the ListOverrides API endpoint. -type ListOverridesOptions struct { - APIListObject - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` - Editable bool `url:"editable,omitempty"` - Overflow bool `url:"overflow,omitempty"` -} - -// Overrides are any schedule layers from the override layer. -type Override struct { - ID string `json:"id,omitempty"` - Start string `json:"start,omitempty"` - End string `json:"end,omitempty"` - User APIObject `json:"user,omitempty"` -} - -// ListOverrides lists overrides for a given time range. -func (c *Client) ListOverrides(id string, o ListOverridesOptions) ([]Override, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/schedules/" + id + "/overrides?" + v.Encode()) - if err != nil { - return nil, err - } - var result map[string][]Override - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - overrides, ok := result["overrides"] - if !ok { - return nil, fmt.Errorf("JSON response does not have overrides field") - } - return overrides, nil -} - -// CreateOverride creates an override for a specific user covering the specified time range. -func (c *Client) CreateOverride(id string, o Override) (*Override, error) { - data := make(map[string]Override) - data["override"] = o - resp, err := c.post("/schedules/"+id+"/overrides", data, nil) - if err != nil { - return nil, err - } - return getOverrideFromResponse(c, resp) -} - -// DeleteOverride removes an override. -func (c *Client) DeleteOverride(scheduleID, overrideID string) error { - _, err := c.delete("/schedules/" + scheduleID + "/overrides/" + overrideID) - return err -} - -// ListOnCallUsersOptions is the data structure used when calling the ListOnCallUsers API endpoint. -type ListOnCallUsersOptions struct { - APIListObject - Since string `url:"since,omitempty"` - Until string `url:"until,omitempty"` -} - -// ListOnCallUsers lists all of the users on call in a given schedule for a given time range. -func (c *Client) ListOnCallUsers(id string, o ListOnCallUsersOptions) ([]User, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/schedules/" + id + "/users?" + v.Encode()) - if err != nil { - return nil, err - } - var result map[string][]User - if err := c.decodeJSON(resp, &result); err != nil { - return nil, err - } - u, ok := result["users"] - if !ok { - return nil, fmt.Errorf("JSON response does not have users field") - } - return u, nil -} - -func getScheduleFromResponse(c *Client, resp *http.Response) (*Schedule, error) { - var target map[string]Schedule - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "schedule" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} - -func getOverrideFromResponse(c *Client, resp *http.Response) (*Override, error) { - var target map[string]Override - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "override" - o, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &o, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/service.go b/vendor/github.com/PagerDuty/go-pagerduty/service.go deleted file mode 100644 index c30994e7..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/service.go +++ /dev/null @@ -1,204 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// Integration is an endpoint (like Nagios, email, or an API call) that generates events, which are normalized and de-duplicated by PagerDuty to create incidents. -type Integration struct { - APIObject - Name string `json:"name,omitempty"` - Service *APIObject `json:"service,omitempty"` - CreatedAt string `json:"created_at,omitempty"` - Vendor *APIObject `json:"vendor,omitempty"` - Type string `json:"type,omitempty"` - IntegrationKey string `json:"integration_key,omitempty"` - IntegrationEmail string `json:"integration_email,omitempty"` -} - -// InlineModel represents when a scheduled action will occur. -type InlineModel struct { - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` -} - -// ScheduledAction contains scheduled actions for the service. -type ScheduledAction struct { - Type string `json:"type,omitempty"` - At InlineModel `json:"at,omitempty"` - ToUrgency string `json:"to_urgency"` -} - -// IncidentUrgencyType are the incidents urgency during or outside support hours. -type IncidentUrgencyType struct { - Type string `json:"type,omitempty"` - Urgency string `json:"urgency,omitempty"` -} - -// SupportHours are the support hours for the service. -type SupportHours struct { - Type string `json:"type,omitempty"` - Timezone string `json:"time_zone,omitempty"` - StartTime string `json:"start_time,omitempty"` - EndTime string `json:"end_time,omitempty"` - DaysOfWeek []uint `json:"days_of_week,omitempty"` -} - -// IncidentUrgencyRule is the default urgency for new incidents. -type IncidentUrgencyRule struct { - Type string `json:"type,omitempty"` - Urgency string `json:"urgency,omitempty"` - DuringSupportHours *IncidentUrgencyType `json:"during_support_hours,omitempty"` - OutsideSupportHours *IncidentUrgencyType `json:"outside_support_hours,omitempty"` -} - -// Service represents something you monitor (like a web service, email service, or database service). -type Service struct { - APIObject - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - AutoResolveTimeout *uint `json:"auto_resolve_timeout"` - AcknowledgementTimeout *uint `json:"acknowledgement_timeout"` - CreateAt string `json:"created_at,omitempty"` - Status string `json:"status,omitempty"` - LastIncidentTimestamp string `json:"last_incident_timestamp,omitempty"` - Integrations []Integration `json:"integrations,omitempty"` - EscalationPolicy EscalationPolicy `json:"escalation_policy,omitempty"` - Teams []Team `json:"teams,omitempty"` - IncidentUrgencyRule *IncidentUrgencyRule `json:"incident_urgency_rule,omitempty"` - SupportHours *SupportHours `json:"support_hours,omitempty"` - ScheduledActions []ScheduledAction `json:"scheduled_actions,omitempty"` - AlertCreation string `json:"alert_creation,omitempty"` -} - -// ListServiceOptions is the data structure used when calling the ListServices API endpoint. -type ListServiceOptions struct { - APIListObject - TeamIDs []string `url:"team_ids,omitempty,brackets"` - TimeZone string `url:"time_zone,omitempty"` - SortBy string `url:"sort_by,omitempty"` - Query string `url:"query,omitempty"` - Includes []string `url:"include,omitempty,brackets"` -} - -// ListServiceResponse is the data structure returned from calling the ListServices API endpoint. -type ListServiceResponse struct { - APIListObject - Services []Service -} - -// ListServices lists existing services. -func (c *Client) ListServices(o ListServiceOptions) (*ListServiceResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/services?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListServiceResponse - return &result, c.decodeJSON(resp, &result) -} - -// GetServiceOptions is the data structure used when calling the GetService API endpoint. -type GetServiceOptions struct { - Includes []string `url:"include,brackets,omitempty"` -} - -// GetService gets details about an existing service. -func (c *Client) GetService(id string, o *GetServiceOptions) (*Service, error) { - v, err := query.Values(o) - resp, err := c.get("/services/" + id + "?" + v.Encode()) - return getServiceFromResponse(c, resp, err) -} - -// CreateService creates a new service. -func (c *Client) CreateService(s Service) (*Service, error) { - data := make(map[string]Service) - data["service"] = s - resp, err := c.post("/services", data, nil) - return getServiceFromResponse(c, resp, err) -} - -// UpdateService updates an existing service. -func (c *Client) UpdateService(s Service) (*Service, error) { - resp, err := c.put("/services/"+s.ID, s, nil) - return getServiceFromResponse(c, resp, err) -} - -// DeleteService deletes an existing service. -func (c *Client) DeleteService(id string) error { - _, err := c.delete("/services/" + id) - return err -} - -// CreateIntegration creates a new integration belonging to a service. -func (c *Client) CreateIntegration(id string, i Integration) (*Integration, error) { - data := make(map[string]Integration) - data["integration"] = i - resp, err := c.post("/services/"+id+"/integrations", data, nil) - return getIntegrationFromResponse(c, resp, err) -} - -// GetIntegrationOptions is the data structure used when calling the GetIntegration API endpoint. -type GetIntegrationOptions struct { - Includes []string `url:"include,omitempty,brackets"` -} - -// GetIntegration gets details about an integration belonging to a service. -func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error) { - v, queryErr := query.Values(o) - if queryErr != nil { - return nil, queryErr - } - resp, err := c.get("/services/" + serviceID + "/integrations/" + integrationID + "?" + v.Encode()) - return getIntegrationFromResponse(c, resp, err) -} - -// UpdateIntegration updates an integration belonging to a service. -func (c *Client) UpdateIntegration(serviceID string, i Integration) (*Integration, error) { - resp, err := c.put("/services/"+serviceID+"/integrations/"+i.ID, i, nil) - return getIntegrationFromResponse(c, resp, err) -} - -// DeleteIntegration deletes an existing integration. -func (c *Client) DeleteIntegration(serviceID string, integrationID string) error { - _, err := c.delete("/services/" + serviceID + "/integrations/" + integrationID) - return err -} - -func getServiceFromResponse(c *Client, resp *http.Response, err error) (*Service, error) { - if err != nil { - return nil, err - } - var target map[string]Service - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "service" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} - -func getIntegrationFromResponse(c *Client, resp *http.Response, err error) (*Integration, error) { - if err != nil { - return nil, err - } - var target map[string]Integration - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", err) - } - rootNode := "integration" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/team.go b/vendor/github.com/PagerDuty/go-pagerduty/team.go deleted file mode 100644 index 75ba20e7..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/team.go +++ /dev/null @@ -1,106 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// Team is a collection of users and escalation policies that represent a group of people within an organization. -type Team struct { - APIObject - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` -} - -// ListTeamResponse is the structure used when calling the ListTeams API endpoint. -type ListTeamResponse struct { - APIListObject - Teams []Team -} - -// ListTeamOptions are the input parameters used when calling the ListTeams API endpoint. -type ListTeamOptions struct { - APIListObject - Query string `url:"query,omitempty"` -} - -// ListTeams lists teams of your PagerDuty account, optionally filtered by a search query. -func (c *Client) ListTeams(o ListTeamOptions) (*ListTeamResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - - resp, err := c.get("/teams?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListTeamResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateTeam creates a new team. -func (c *Client) CreateTeam(t *Team) (*Team, error) { - resp, err := c.post("/teams", t, nil) - return getTeamFromResponse(c, resp, err) -} - -// DeleteTeam removes an existing team. -func (c *Client) DeleteTeam(id string) error { - _, err := c.delete("/teams/" + id) - return err -} - -// GetTeam gets details about an existing team. -func (c *Client) GetTeam(id string) (*Team, error) { - resp, err := c.get("/teams/" + id) - return getTeamFromResponse(c, resp, err) -} - -// UpdateTeam updates an existing team. -func (c *Client) UpdateTeam(id string, t *Team) (*Team, error) { - resp, err := c.put("/teams/"+id, t, nil) - return getTeamFromResponse(c, resp, err) -} - -// RemoveEscalationPolicyFromTeam removes an escalation policy from a team. -func (c *Client) RemoveEscalationPolicyFromTeam(teamID, epID string) error { - _, err := c.delete("/teams/" + teamID + "/escalation_policies/" + epID) - return err -} - -// AddEscalationPolicyToTeam adds an escalation policy to a team. -func (c *Client) AddEscalationPolicyToTeam(teamID, epID string) error { - _, err := c.put("/teams/"+teamID+"/escalation_policies/"+epID, nil, nil) - return err -} - -// RemoveUserFromTeam removes a user from a team. -func (c *Client) RemoveUserFromTeam(teamID, userID string) error { - _, err := c.delete("/teams/" + teamID + "/users/" + userID) - return err -} - -// AddUserToTeam adds a user to a team. -func (c *Client) AddUserToTeam(teamID, userID string) error { - _, err := c.put("/teams/"+teamID+"/users/"+userID, nil, nil) - return err -} - -func getTeamFromResponse(c *Client, resp *http.Response, err error) (*Team, error) { - if err != nil { - return nil, err - } - var target map[string]Team - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "team" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/user.go b/vendor/github.com/PagerDuty/go-pagerduty/user.go deleted file mode 100644 index 62e15579..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/user.go +++ /dev/null @@ -1,172 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// NotificationRule is a rule for notifying the user. -type NotificationRule struct { - ID string `json:"id"` - StartDelayInMinutes uint `json:"start_delay_in_minutes"` - CreatedAt string `json:"created_at"` - ContactMethod ContactMethod `json:"contact_method"` - Urgency string `json:"urgency"` - Type string `json:"type"` -} - -// User is a member of a PagerDuty account that has the ability to interact with incidents and other data on the account. -type User struct { - APIObject - Type string `json:"type"` - Name string `json:"name"` - Summary string `json:"summary"` - Email string `json:"email"` - Timezone string `json:"time_zone,omitempty"` - Color string `json:"color,omitempty"` - Role string `json:"role,omitempty"` - AvatarURL string `json:"avatar_url,omitempty"` - Description string `json:"description,omitempty"` - InvitationSent bool `json:"invitation_sent,omitempty"` - ContactMethods []ContactMethod `json:"contact_methods"` - NotificationRules []NotificationRule `json:"notification_rules"` - JobTitle string `json:"job_title,omitempty"` - Teams []Team -} - -// ContactMethod is a way of contacting the user. -type ContactMethod struct { - ID string `json:"id"` - Type string `json:"type"` - Summary string `json:"summary"` - Self string `json:"self"` - Label string `json:"label"` - Address string `json:"address"` - SendShortEmail bool `json:"send_short_email,omitempty"` - SendHTMLEmail bool `json:"send_html_email,omitempty"` - Blacklisted bool `json:"blacklisted,omitempty"` - CountryCode int `json:"country_code,omitempty"` - Enabled bool `json:"enabled,omitempty"` - HTMLUrl string `json:"html_url"` -} - -// ListUsersResponse is the data structure returned from calling the ListUsers API endpoint. -type ListUsersResponse struct { - APIListObject - Users []User -} - -// ListUsersOptions is the data structure used when calling the ListUsers API endpoint. -type ListUsersOptions struct { - APIListObject - Query string `url:"query,omitempty"` - TeamIDs []string `url:"team_ids,omitempty,brackets"` - Includes []string `url:"include,omitempty,brackets"` -} - -// ListContactMethodResponse is the data structure returned from calling the GetUserContactMethod API endpoint. -type ListContactMethodsResponse struct { - APIListObject - ContactMethods []ContactMethod `json:"contact_methods"` -} - -// GetUserOptions is the data structure used when calling the GetUser API endpoint. -type GetUserOptions struct { - Includes []string `url:"include,omitempty,brackets"` -} - -// ListUsers lists users of your PagerDuty account, optionally filtered by a search query. -func (c *Client) ListUsers(o ListUsersOptions) (*ListUsersResponse, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/users?" + v.Encode()) - if err != nil { - return nil, err - } - var result ListUsersResponse - return &result, c.decodeJSON(resp, &result) -} - -// CreateUser creates a new user. -func (c *Client) CreateUser(u User) (*User, error) { - data := make(map[string]User) - data["user"] = u - resp, err := c.post("/users", data, nil) - return getUserFromResponse(c, resp, err) -} - -// DeleteUser deletes a user. -func (c *Client) DeleteUser(id string) error { - _, err := c.delete("/users/" + id) - return err -} - -// GetUser gets details about an existing user. -func (c *Client) GetUser(id string, o GetUserOptions) (*User, error) { - v, err := query.Values(o) - if err != nil { - return nil, err - } - resp, err := c.get("/users/" + id + "?" + v.Encode()) - return getUserFromResponse(c, resp, err) -} - -// UpdateUser updates an existing user. -func (c *Client) UpdateUser(u User) (*User, error) { - v := make(map[string]User) - v["user"] = u - resp, err := c.put("/users/"+u.ID, v, nil) - return getUserFromResponse(c, resp, err) -} - -func getUserFromResponse(c *Client, resp *http.Response, err error) (*User, error) { - if err != nil { - return nil, err - } - var target map[string]User - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "user" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} - -// ListUserContactMethod fetches contact methods of the existing user. -func (c *Client) ListUserContactMethods(userId string) (*ListContactMethodsResponse, error) { - resp, err := c.get("/users/" + userId + "/contact_methods") - if err != nil { - return nil, err - } - var result ListContactMethodsResponse - return &result, c.decodeJSON(resp, &result) -} - -// GetContactMethod gets details about a contact method. -func (c *Client) GetUserContactMethod(userID, id string) (*ContactMethod, error) { - resp, err := c.get("/users/" + userID + "/contact_methods/" + id) - return getContactMethodFromResponse(c, resp, err) -} - -func getContactMethodFromResponse(c *Client, resp *http.Response, err error) (*ContactMethod, error) { - if err != nil { - return nil, err - } - var target map[string]ContactMethod - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "contact_method" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/vendor.go b/vendor/github.com/PagerDuty/go-pagerduty/vendor.go deleted file mode 100644 index cb971602..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/vendor.go +++ /dev/null @@ -1,77 +0,0 @@ -package pagerduty - -import ( - "fmt" - "net/http" - - "github.com/google/go-querystring/query" -) - -// Vendor represents a specific type of integration. AWS Cloudwatch, Splunk, Datadog, etc are all examples of vendors that can be integrated in PagerDuty by making an integration. -type Vendor struct { - APIObject - Name string `json:"name,omitempty"` - LogoURL string `json:"logo_url,omitempty"` - LongName string `json:"long_name,omitempty"` - WebsiteURL string `json:"website_url,omitempty"` - Description string `json:"description,omitempty"` - Connectable bool `json:"connectable,omitempty"` - ThumbnailURL string `json:"thumbnail_url,omitempty"` - GenericServiceType string `json:"generic_service_type,omitempty"` - IntegrationGuideURL string `json:"integration_guide_url,omitempty"` - AlertCreationDefault string `json:"alert_creation_default,omitempty"` - AlertCreationEditable bool `json:"alert_creation_editable,omitempty"` - IsPDCEF bool `json:"is_pd_cef,omitempty"` -} - -// ListVendorResponse is the data structure returned from calling the ListVendors API endpoint. -type ListVendorResponse struct { - APIListObject - Vendors []Vendor -} - -// ListVendorOptions is the data structure used when calling the ListVendors API endpoint. -type ListVendorOptions struct { - APIListObject - Query string `url:"query,omitempty"` -} - -// ListVendors lists existing vendors. -func (c *Client) ListVendors(o ListVendorOptions) (*ListVendorResponse, error) { - v, err := query.Values(o) - - if err != nil { - return nil, err - } - - resp, err := c.get("/vendors?" + v.Encode()) - - if err != nil { - return nil, err - } - - var result ListVendorResponse - return &result, c.decodeJSON(resp, &result) -} - -// GetVendor gets details about an existing vendor. -func (c *Client) GetVendor(id string) (*Vendor, error) { - resp, err := c.get("/vendors/" + id) - return getVendorFromResponse(c, resp, err) -} - -func getVendorFromResponse(c *Client, resp *http.Response, err error) (*Vendor, error) { - if err != nil { - return nil, err - } - var target map[string]Vendor - if dErr := c.decodeJSON(resp, &target); dErr != nil { - return nil, fmt.Errorf("Could not decode JSON response: %v", dErr) - } - rootNode := "vendor" - t, nodeOK := target[rootNode] - if !nodeOK { - return nil, fmt.Errorf("JSON response does not have %s field", rootNode) - } - return &t, nil -} diff --git a/vendor/github.com/PagerDuty/go-pagerduty/webhook.go b/vendor/github.com/PagerDuty/go-pagerduty/webhook.go deleted file mode 100644 index 010b1a79..00000000 --- a/vendor/github.com/PagerDuty/go-pagerduty/webhook.go +++ /dev/null @@ -1,37 +0,0 @@ -package pagerduty - -import ( - "encoding/json" - "io" -) - -// IncidentDetail contains a representation of the incident associated with the action that caused this webhook message. -type IncidentDetail struct { - ID string `json:"id"` - IncidentNumber uint `json:"incident_number"` - CreatedOn string `json:"created_on"` - Status string `json:"status"` - HTMLUrl string `json:"html_url"` - Service string `json:"service"` - AssignedToUser *json.RawMessage `json:"assigned_to_user"` - AssignedTo []string `json:"assigned_to"` - TriggerSummaryData *json.RawMessage `json:"trigger_summary_data"` - TriggerDetailsHTMLUrl string `json:"trigger_details_html_url"` -} - -// WebhookPayload is a single message array for a webhook. -type WebhookPayload struct { - ID string `json:"id"` - Type string `json:"type"` - CreatedOn string `json:"created_on"` - Data *json.RawMessage `json:"data"` -} - -// DecodeWebhook decodes a webhook from a response object. -func DecodeWebhook(r io.Reader) (*WebhookPayload, error) { - var payload WebhookPayload - if err := json.NewDecoder(r).Decode(&payload); err != nil { - return nil, err - } - return &payload, nil -} diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitattributes b/vendor/github.com/PuerkitoBio/goquery/.gitattributes deleted file mode 100644 index 0cc26ec0..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -testdata/* linguist-vendored diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitignore b/vendor/github.com/PuerkitoBio/goquery/.gitignore deleted file mode 100644 index 970381cd..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# editor temporary files -*.sublime-* -.DS_Store -*.swp -#*.*# -tags - -# direnv config -.env* - -# test binaries -*.test - -# coverage and profilte outputs -*.out - diff --git a/vendor/github.com/PuerkitoBio/goquery/.travis.yml b/vendor/github.com/PuerkitoBio/goquery/.travis.yml deleted file mode 100644 index cc1402d5..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go - -go: - - 1.1 - - 1.2.x - - 1.3.x - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - "1.10.x" - - 1.11.x - - tip - diff --git a/vendor/github.com/PuerkitoBio/goquery/LICENSE b/vendor/github.com/PuerkitoBio/goquery/LICENSE deleted file mode 100644 index f743d372..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012-2016, Martin Angers & Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/goquery/README.md b/vendor/github.com/PuerkitoBio/goquery/README.md deleted file mode 100644 index 84f9af39..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/README.md +++ /dev/null @@ -1,179 +0,0 @@ -# goquery - a little like that j-thing, only in Go -[![build status](https://secure.travis-ci.org/PuerkitoBio/goquery.svg?branch=master)](http://travis-ci.org/PuerkitoBio/goquery) [![GoDoc](https://godoc.org/github.com/PuerkitoBio/goquery?status.png)](http://godoc.org/github.com/PuerkitoBio/goquery) [![Sourcegraph Badge](https://sourcegraph.com/github.com/PuerkitoBio/goquery/-/badge.svg)](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge) - -goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...). - -## Table of Contents - -* [Installation](#installation) -* [Changelog](#changelog) -* [API](#api) -* [Examples](#examples) -* [Related Projects](#related-projects) -* [Support](#support) -* [License](#license) - -## Installation - -Please note that because of the net/html dependency, goquery requires Go1.1+. - - $ go get github.com/PuerkitoBio/goquery - -(optional) To run unit tests: - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test - -(optional) To run benchmarks (warning: it runs for a few minutes): - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test -bench=".*" - -## Changelog - -**Note that goquery's API is now stable, and will not break.** - -* **2018-11-15 (v1.5.0)** : Go module support (thanks @Zaba505). -* **2018-06-07 (v1.4.1)** : Add `NewDocumentFromReader` examples. -* **2018-03-24 (v1.4.0)** : Deprecate `NewDocument(url)` and `NewDocumentFromResponse(response)`. -* **2018-01-28 (v1.3.0)** : Add `ToEnd` constant to `Slice` until the end of the selection (thanks to @davidjwilkins for raising the issue). -* **2018-01-11 (v1.2.0)** : Add `AddBack*` and deprecate `AndSelf` (thanks to @davidjwilkins). -* **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv). -* **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb). -* **2016-08-28 (v1.0.1)** : Optimize performance for large documents. -* **2016-07-27 (v1.0.0)** : Tag version 1.0.0. -* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object. -* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see godoc for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`). -* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr]. -* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used. -* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s. -* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader. -* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response. -* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility. -* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out). -* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method. -* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases). -* **v0.1.0** : Initial release. - -## API - -goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate. - -jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention: - -* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`) -* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`) -* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`) -* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`) -* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`) -* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`) - -Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour). - -The complete [godoc reference documentation can be found here][doc]. - -Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string): - -* `Find("~")` returns an empty selection because the selector string doesn't match anything. -* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything). -* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything. -* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element. - -## Examples - -See some tips and tricks in the [wiki][]. - -Adapted from example_test.go: - -```Go -package main - -import ( - "fmt" - "log" - "net/http" - - "github.com/PuerkitoBio/goquery" -) - -func ExampleScrape() { - // Request the HTML page. - res, err := http.Get("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - defer res.Body.Close() - if res.StatusCode != 200 { - log.Fatalf("status code error: %d %s", res.StatusCode, res.Status) - } - - // Load the HTML document - doc, err := goquery.NewDocumentFromReader(res.Body) - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { - // For each item found, get the band and title - band := s.Find("a").Text() - title := s.Find("i").Text() - fmt.Printf("Review %d: %s - %s\n", i, band, title) - }) -} - -func main() { - ExampleScrape() -} -``` - -## Related Projects - -- [Goq][goq], an HTML deserialization and scraping library based on goquery and struct tags. -- [andybalholm/cascadia][cascadia], the CSS selector library used by goquery. -- [suntong/cascadia][cascadiacli], a command-line interface to the cascadia CSS selector library, useful to test selectors. -- [asciimoo/colly](https://github.com/asciimoo/colly), a lightning fast and elegant Scraping Framework -- [gnulnx/goperf](https://github.com/gnulnx/goperf), a website performance test tool that also fetches static assets. -- [MontFerret/ferret](https://github.com/MontFerret/ferret), declarative web scraping. - -## Support - -There are a number of ways you can support the project: - -* Use it, star it, build something with it, spread the word! - - If you do build something open-source or otherwise publicly-visible, let me know so I can add it to the [Related Projects](#related-projects) section! -* Raise issues to improve the project (note: doc typos and clarifications are issues too!) - - Please search existing issues before opening a new one - it may have already been adressed. -* Pull requests: please discuss new code in an issue first, unless the fix is really trivial. - - Make sure new code is tested. - - Be mindful of existing code - PRs that break existing code have a high probability of being declined, unless it fixes a serious issue. - -If you desperately want to send money my way, I have a BuyMeACoffee.com page: - -Buy Me A Coffee - -## License - -The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic]. - -[jquery]: http://jquery.com/ -[go]: http://golang.org/ -[cascadia]: https://github.com/andybalholm/cascadia -[cascadiacli]: https://github.com/suntong/cascadia -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[golic]: http://golang.org/LICENSE -[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE -[doc]: http://godoc.org/github.com/PuerkitoBio/goquery -[index]: http://api.jquery.com/index/ -[gonet]: https://github.com/golang/net/ -[html]: http://godoc.org/golang.org/x/net/html -[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks -[thatguystone]: https://github.com/thatguystone -[piotr]: https://github.com/piotrkowalczuk -[goq]: https://github.com/andrewstuart/goq diff --git a/vendor/github.com/PuerkitoBio/goquery/array.go b/vendor/github.com/PuerkitoBio/goquery/array.go deleted file mode 100644 index 1b1f6cbe..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/array.go +++ /dev/null @@ -1,124 +0,0 @@ -package goquery - -import ( - "golang.org/x/net/html" -) - -const ( - maxUint = ^uint(0) - maxInt = int(maxUint >> 1) - - // ToEnd is a special index value that can be used as end index in a call - // to Slice so that all elements are selected until the end of the Selection. - // It is equivalent to passing (*Selection).Length(). - ToEnd = maxInt -) - -// First reduces the set of matched elements to the first in the set. -// It returns a new Selection object, and an empty Selection object if the -// the selection is empty. -func (s *Selection) First() *Selection { - return s.Eq(0) -} - -// Last reduces the set of matched elements to the last in the set. -// It returns a new Selection object, and an empty Selection object if -// the selection is empty. -func (s *Selection) Last() *Selection { - return s.Eq(-1) -} - -// Eq reduces the set of matched elements to the one at the specified index. -// If a negative index is given, it counts backwards starting at the end of the -// set. It returns a new Selection object, and an empty Selection object if the -// index is invalid. -func (s *Selection) Eq(index int) *Selection { - if index < 0 { - index += len(s.Nodes) - } - - if index >= len(s.Nodes) || index < 0 { - return newEmptySelection(s.document) - } - - return s.Slice(index, index+1) -} - -// Slice reduces the set of matched elements to a subset specified by a range -// of indices. The start index is 0-based and indicates the index of the first -// element to select. The end index is 0-based and indicates the index at which -// the elements stop being selected (the end index is not selected). -// -// The indices may be negative, in which case they represent an offset from the -// end of the selection. -// -// The special value ToEnd may be specified as end index, in which case all elements -// until the end are selected. This works both for a positive and negative start -// index. -func (s *Selection) Slice(start, end int) *Selection { - if start < 0 { - start += len(s.Nodes) - } - if end == ToEnd { - end = len(s.Nodes) - } else if end < 0 { - end += len(s.Nodes) - } - return pushStack(s, s.Nodes[start:end]) -} - -// Get retrieves the underlying node at the specified index. -// Get without parameter is not implemented, since the node array is available -// on the Selection object. -func (s *Selection) Get(index int) *html.Node { - if index < 0 { - index += len(s.Nodes) // Negative index gets from the end - } - return s.Nodes[index] -} - -// Index returns the position of the first element within the Selection object -// relative to its sibling elements. -func (s *Selection) Index() int { - if len(s.Nodes) > 0 { - return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length() - } - return -1 -} - -// IndexSelector returns the position of the first element within the -// Selection object relative to the elements matched by the selector, or -1 if -// not found. -func (s *Selection) IndexSelector(selector string) int { - if len(s.Nodes) > 0 { - sel := s.document.Find(selector) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexMatcher returns the position of the first element within the -// Selection object relative to the elements matched by the matcher, or -1 if -// not found. -func (s *Selection) IndexMatcher(m Matcher) int { - if len(s.Nodes) > 0 { - sel := s.document.FindMatcher(m) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexOfNode returns the position of the specified node within the Selection -// object, or -1 if not found. -func (s *Selection) IndexOfNode(node *html.Node) int { - return indexInSlice(s.Nodes, node) -} - -// IndexOfSelection returns the position of the first node in the specified -// Selection object within this Selection object, or -1 if not found. -func (s *Selection) IndexOfSelection(sel *Selection) int { - if sel != nil && len(sel.Nodes) > 0 { - return indexInSlice(s.Nodes, sel.Nodes[0]) - } - return -1 -} diff --git a/vendor/github.com/PuerkitoBio/goquery/doc.go b/vendor/github.com/PuerkitoBio/goquery/doc.go deleted file mode 100644 index 71146a78..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/doc.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2012-2016, Martin Angers & Contributors -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation and/or -// other materials provided with the distribution. -// * Neither the name of the author nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package goquery implements features similar to jQuery, including the chainable -syntax, to manipulate and query an HTML document. - -It brings a syntax and a set of features similar to jQuery to the Go language. -It is based on Go's net/html package and the CSS Selector library cascadia. -Since the net/html parser returns nodes, and not a full-featured DOM -tree, jQuery's stateful manipulation functions (like height(), css(), detach()) -have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is -the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. -See the repository's wiki for various options on how to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same method names when -possible, and that warm and fuzzy chainable interface. jQuery being the -ultra-popular library that it is, writing a similar HTML-manipulating -library was better to follow its API than to start anew (in the same spirit as -Go's fmt package), even though some of its methods are less than intuitive (looking -at you, index()...). - -It is hosted on GitHub, along with additional documentation in the README.md -file: https://github.com/puerkitobio/goquery - -Please note that because of the net/html dependency, goquery requires Go1.1+. - -The various methods are split into files based on the category of behavior. -The three dots (...) indicate that various "overloads" are available. - -* array.go : array-like positional manipulation of the selection. - - Eq() - - First() - - Get() - - Index...() - - Last() - - Slice() - -* expand.go : methods that expand or augment the selection's set. - - Add...() - - AndSelf() - - Union(), which is an alias for AddSelection() - -* filter.go : filtering methods, that reduce the selection's set. - - End() - - Filter...() - - Has...() - - Intersection(), which is an alias of FilterSelection() - - Not...() - -* iteration.go : methods to loop over the selection's nodes. - - Each() - - EachWithBreak() - - Map() - -* manipulation.go : methods for modifying the document - - After...() - - Append...() - - Before...() - - Clone() - - Empty() - - Prepend...() - - Remove...() - - ReplaceWith...() - - Unwrap() - - Wrap...() - - WrapAll...() - - WrapInner...() - -* property.go : methods that inspect and get the node's properties values. - - Attr*(), RemoveAttr(), SetAttr() - - AddClass(), HasClass(), RemoveClass(), ToggleClass() - - Html() - - Length() - - Size(), which is an alias for Length() - - Text() - -* query.go : methods that query, or reflect, a node's identity. - - Contains() - - Is...() - -* traversal.go : methods to traverse the HTML document tree. - - Children...() - - Contents() - - Find...() - - Next...() - - Parent[s]...() - - Prev...() - - Siblings...() - -* type.go : definition of the types exposed by goquery. - - Document - - Selection - - Matcher - -* utilities.go : definition of helper functions (and not methods on a *Selection) -that are not part of jQuery, but are useful to goquery. - - NodeName - - OuterHtml -*/ -package goquery diff --git a/vendor/github.com/PuerkitoBio/goquery/expand.go b/vendor/github.com/PuerkitoBio/goquery/expand.go deleted file mode 100644 index 7caade53..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/expand.go +++ /dev/null @@ -1,70 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Add adds the selector string's matching nodes to those in the current -// selection and returns a new Selection object. -// The selector string is run in the context of the document of the current -// Selection object. -func (s *Selection) Add(selector string) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...) -} - -// AddMatcher adds the matcher's matching nodes to those in the current -// selection and returns a new Selection object. -// The matcher is run in the context of the document of the current -// Selection object. -func (s *Selection) AddMatcher(m Matcher) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...) -} - -// AddSelection adds the specified Selection object's nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddSelection(sel *Selection) *Selection { - if sel == nil { - return s.AddNodes() - } - return s.AddNodes(sel.Nodes...) -} - -// Union is an alias for AddSelection. -func (s *Selection) Union(sel *Selection) *Selection { - return s.AddSelection(sel) -} - -// AddNodes adds the specified nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddNodes(nodes ...*html.Node) *Selection { - return pushStack(s, appendWithoutDuplicates(s.Nodes, nodes, nil)) -} - -// AndSelf adds the previous set of elements on the stack to the current set. -// It returns a new Selection object containing the current Selection combined -// with the previous one. -// Deprecated: This function has been deprecated and is now an alias for AddBack(). -func (s *Selection) AndSelf() *Selection { - return s.AddBack() -} - -// AddBack adds the previous set of elements on the stack to the current set. -// It returns a new Selection object containing the current Selection combined -// with the previous one. -func (s *Selection) AddBack() *Selection { - return s.AddSelection(s.prevSel) -} - -// AddBackFiltered reduces the previous set of elements on the stack to those that -// match the selector string, and adds them to the current set. -// It returns a new Selection object containing the current Selection combined -// with the filtered previous one -func (s *Selection) AddBackFiltered(selector string) *Selection { - return s.AddSelection(s.prevSel.Filter(selector)) -} - -// AddBackMatcher reduces the previous set of elements on the stack to those that match -// the mateher, and adds them to the curernt set. -// It returns a new Selection object containing the current Selection combined -// with the filtered previous one -func (s *Selection) AddBackMatcher(m Matcher) *Selection { - return s.AddSelection(s.prevSel.FilterMatcher(m)) -} diff --git a/vendor/github.com/PuerkitoBio/goquery/filter.go b/vendor/github.com/PuerkitoBio/goquery/filter.go deleted file mode 100644 index 9138ffb3..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/filter.go +++ /dev/null @@ -1,163 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Filter reduces the set of matched elements to those that match the selector string. -// It returns a new Selection object for this subset of matching elements. -func (s *Selection) Filter(selector string) *Selection { - return s.FilterMatcher(compileMatcher(selector)) -} - -// FilterMatcher reduces the set of matched elements to those that match -// the given matcher. It returns a new Selection object for this subset -// of matching elements. -func (s *Selection) FilterMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, true)) -} - -// Not removes elements from the Selection that match the selector string. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) Not(selector string) *Selection { - return s.NotMatcher(compileMatcher(selector)) -} - -// NotMatcher removes elements from the Selection that match the given matcher. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, false)) -} - -// FilterFunction reduces the set of matched elements to those that pass the function's test. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, true)) -} - -// NotFunction removes elements from the Selection that pass the function's test. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, false)) -} - -// FilterNodes reduces the set of matched elements to those that match the specified nodes. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, true)) -} - -// NotNodes removes elements from the Selection that match the specified nodes. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, false)) -} - -// FilterSelection reduces the set of matched elements to those that match a -// node in the specified Selection object. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, true)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, true)) -} - -// NotSelection removes elements from the Selection that match a node in the specified -// Selection object. It returns a new Selection object with the matching elements removed. -func (s *Selection) NotSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, false)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, false)) -} - -// Intersection is an alias for FilterSelection. -func (s *Selection) Intersection(sel *Selection) *Selection { - return s.FilterSelection(sel) -} - -// Has reduces the set of matched elements to those that have a descendant -// that matches the selector. -// It returns a new Selection object with the matching elements. -func (s *Selection) Has(selector string) *Selection { - return s.HasSelection(s.document.Find(selector)) -} - -// HasMatcher reduces the set of matched elements to those that have a descendant -// that matches the matcher. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasMatcher(m Matcher) *Selection { - return s.HasSelection(s.document.FindMatcher(m)) -} - -// HasNodes reduces the set of matched elements to those that have a -// descendant that matches one of the nodes. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasNodes(nodes ...*html.Node) *Selection { - return s.FilterFunction(func(_ int, sel *Selection) bool { - // Add all nodes that contain one of the specified nodes - for _, n := range nodes { - if sel.Contains(n) { - return true - } - } - return false - }) -} - -// HasSelection reduces the set of matched elements to those that have a -// descendant that matches one of the nodes of the specified Selection object. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasSelection(sel *Selection) *Selection { - if sel == nil { - return s.HasNodes() - } - return s.HasNodes(sel.Nodes...) -} - -// End ends the most recent filtering operation in the current chain and -// returns the set of matched elements to its previous state. -func (s *Selection) End() *Selection { - if s.prevSel != nil { - return s.prevSel - } - return newEmptySelection(s.document) -} - -// Filter based on the matcher, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnow(sel *Selection, m Matcher, keep bool) []*html.Node { - // Optimize if keep is requested - if keep { - return m.Filter(sel.Nodes) - } - // Use grep - return grep(sel, func(i int, s *Selection) bool { - return !m.Match(s.Get(0)) - }) -} - -// Filter based on an array of nodes, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node { - if len(nodes)+len(sel.Nodes) < minNodesForSet { - return grep(sel, func(i int, s *Selection) bool { - return isInSlice(nodes, s.Get(0)) == keep - }) - } - - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return grep(sel, func(i int, s *Selection) bool { - return set[s.Get(0)] == keep - }) -} - -// Filter based on a function test, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowFunction(sel *Selection, f func(int, *Selection) bool, keep bool) []*html.Node { - return grep(sel, func(i int, s *Selection) bool { - return f(i, s) == keep - }) -} diff --git a/vendor/github.com/PuerkitoBio/goquery/go.mod b/vendor/github.com/PuerkitoBio/goquery/go.mod deleted file mode 100644 index 2fa1332a..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/go.mod +++ /dev/null @@ -1,6 +0,0 @@ -module github.com/PuerkitoBio/goquery - -require ( - github.com/andybalholm/cascadia v1.0.0 - golang.org/x/net v0.0.0-20181114220301-adae6a3d119a -) diff --git a/vendor/github.com/PuerkitoBio/goquery/go.sum b/vendor/github.com/PuerkitoBio/goquery/go.sum deleted file mode 100644 index 11c57575..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/go.sum +++ /dev/null @@ -1,5 +0,0 @@ -github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= -github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a h1:gOpx8G595UYyvj8UK4+OFyY4rx037g3fmfhe5SasG3U= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/vendor/github.com/PuerkitoBio/goquery/iteration.go b/vendor/github.com/PuerkitoBio/goquery/iteration.go deleted file mode 100644 index e246f2e0..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/iteration.go +++ /dev/null @@ -1,39 +0,0 @@ -package goquery - -// Each iterates over a Selection object, executing a function for each -// matched element. It returns the current Selection object. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Each(f func(int, *Selection)) *Selection { - for i, n := range s.Nodes { - f(i, newSingleSelection(n, s.document)) - } - return s -} - -// EachWithBreak iterates over a Selection object, executing a function for each -// matched element. It is identical to Each except that it is possible to break -// out of the loop by returning false in the callback function. It returns the -// current Selection object. -func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection { - for i, n := range s.Nodes { - if !f(i, newSingleSelection(n, s.document)) { - return s - } - } - return s -} - -// Map passes each element in the current matched set through a function, -// producing a slice of string holding the returned values. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Map(f func(int, *Selection) string) (result []string) { - for i, n := range s.Nodes { - result = append(result, f(i, newSingleSelection(n, s.document))) - } - - return result -} diff --git a/vendor/github.com/PuerkitoBio/goquery/manipulation.go b/vendor/github.com/PuerkitoBio/goquery/manipulation.go deleted file mode 100644 index 34eb7570..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/manipulation.go +++ /dev/null @@ -1,574 +0,0 @@ -package goquery - -import ( - "strings" - - "golang.org/x/net/html" -) - -// After applies the selector from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) After(selector string) *Selection { - return s.AfterMatcher(compileMatcher(selector)) -} - -// AfterMatcher applies the matcher from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterMatcher(m Matcher) *Selection { - return s.AfterNodes(m.MatchAll(s.document.rootNode)...) -} - -// AfterSelection inserts the elements in the selection after each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterSelection(sel *Selection) *Selection { - return s.AfterNodes(sel.Nodes...) -} - -// AfterHtml parses the html and inserts it after the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterHtml(html string) *Selection { - return s.AfterNodes(parseHtml(html)...) -} - -// AfterNodes inserts the nodes after each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn.NextSibling) - } - }) -} - -// Append appends the elements specified by the selector to the end of each element -// in the set of matched elements, following those rules: -// -// 1) The selector is applied to the root document. -// -// 2) Elements that are part of the document will be moved to the new location. -// -// 3) If there are multiple locations to append to, cloned nodes will be -// appended to all target locations except the last one, which will be moved -// as noted in (2). -func (s *Selection) Append(selector string) *Selection { - return s.AppendMatcher(compileMatcher(selector)) -} - -// AppendMatcher appends the elements specified by the matcher to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendMatcher(m Matcher) *Selection { - return s.AppendNodes(m.MatchAll(s.document.rootNode)...) -} - -// AppendSelection appends the elements in the selection to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendSelection(sel *Selection) *Selection { - return s.AppendNodes(sel.Nodes...) -} - -// AppendHtml parses the html and appends it to the set of matched elements. -func (s *Selection) AppendHtml(html string) *Selection { - return s.AppendNodes(parseHtml(html)...) -} - -// AppendNodes appends the specified nodes to each node in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - sn.AppendChild(n) - }) -} - -// Before inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) Before(selector string) *Selection { - return s.BeforeMatcher(compileMatcher(selector)) -} - -// BeforeMatcher inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeMatcher(m Matcher) *Selection { - return s.BeforeNodes(m.MatchAll(s.document.rootNode)...) -} - -// BeforeSelection inserts the elements in the selection before each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeSelection(sel *Selection) *Selection { - return s.BeforeNodes(sel.Nodes...) -} - -// BeforeHtml parses the html and inserts it before the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeHtml(html string) *Selection { - return s.BeforeNodes(parseHtml(html)...) -} - -// BeforeNodes inserts the nodes before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn) - } - }) -} - -// Clone creates a deep copy of the set of matched nodes. The new nodes will not be -// attached to the document. -func (s *Selection) Clone() *Selection { - ns := newEmptySelection(s.document) - ns.Nodes = cloneNodes(s.Nodes) - return ns -} - -// Empty removes all children nodes from the set of matched elements. -// It returns the children nodes in a new Selection. -func (s *Selection) Empty() *Selection { - var nodes []*html.Node - - for _, n := range s.Nodes { - for c := n.FirstChild; c != nil; c = n.FirstChild { - n.RemoveChild(c) - nodes = append(nodes, c) - } - } - - return pushStack(s, nodes) -} - -// Prepend prepends the elements specified by the selector to each element in -// the set of matched elements, following the same rules as Append. -func (s *Selection) Prepend(selector string) *Selection { - return s.PrependMatcher(compileMatcher(selector)) -} - -// PrependMatcher prepends the elements specified by the matcher to each -// element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependMatcher(m Matcher) *Selection { - return s.PrependNodes(m.MatchAll(s.document.rootNode)...) -} - -// PrependSelection prepends the elements in the selection to each element in -// the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependSelection(sel *Selection) *Selection { - return s.PrependNodes(sel.Nodes...) -} - -// PrependHtml parses the html and prepends it to the set of matched elements. -func (s *Selection) PrependHtml(html string) *Selection { - return s.PrependNodes(parseHtml(html)...) -} - -// PrependNodes prepends the specified nodes to each node in the set of -// matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - // sn.FirstChild may be nil, in which case this functions like - // sn.AppendChild() - sn.InsertBefore(n, sn.FirstChild) - }) -} - -// Remove removes the set of matched elements from the document. -// It returns the same selection, now consisting of nodes not in the document. -func (s *Selection) Remove() *Selection { - for _, n := range s.Nodes { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - } - - return s -} - -// RemoveFiltered removes the set of matched elements by selector. -// It returns the Selection of removed nodes. -func (s *Selection) RemoveFiltered(selector string) *Selection { - return s.RemoveMatcher(compileMatcher(selector)) -} - -// RemoveMatcher removes the set of matched elements. -// It returns the Selection of removed nodes. -func (s *Selection) RemoveMatcher(m Matcher) *Selection { - return s.FilterMatcher(m).Remove() -} - -// ReplaceWith replaces each element in the set of matched elements with the -// nodes matched by the given selector. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWith(selector string) *Selection { - return s.ReplaceWithMatcher(compileMatcher(selector)) -} - -// ReplaceWithMatcher replaces each element in the set of matched elements with -// the nodes matched by the given Matcher. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithMatcher(m Matcher) *Selection { - return s.ReplaceWithNodes(m.MatchAll(s.document.rootNode)...) -} - -// ReplaceWithSelection replaces each element in the set of matched elements with -// the nodes from the given Selection. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection { - return s.ReplaceWithNodes(sel.Nodes...) -} - -// ReplaceWithHtml replaces each element in the set of matched elements with -// the parsed HTML. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithHtml(html string) *Selection { - return s.ReplaceWithNodes(parseHtml(html)...) -} - -// ReplaceWithNodes replaces each element in the set of matched elements with -// the given nodes. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection { - s.AfterNodes(ns...) - return s.Remove() -} - -// SetHtml sets the html content of each element in the selection to -// specified html string. -func (s *Selection) SetHtml(html string) *Selection { - return setHtmlNodes(s, parseHtml(html)...) -} - -// SetText sets the content of each element in the selection to specified content. -// The provided text string is escaped. -func (s *Selection) SetText(text string) *Selection { - return s.SetHtml(html.EscapeString(text)) -} - -// Unwrap removes the parents of the set of matched elements, leaving the matched -// elements (and their siblings, if any) in their place. -// It returns the original selection. -func (s *Selection) Unwrap() *Selection { - s.Parent().Each(func(i int, ss *Selection) { - // For some reason, jquery allows unwrap to remove the element, so - // allowing it here too. Same for . Why it allows those elements to - // be unwrapped while not allowing body is a mystery to me. - if ss.Nodes[0].Data != "body" { - ss.ReplaceWithSelection(ss.Contents()) - } - }) - - return s -} - -// Wrap wraps each element in the set of matched elements inside the first -// element matched by the given selector. The matched child is cloned before -// being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) Wrap(selector string) *Selection { - return s.WrapMatcher(compileMatcher(selector)) -} - -// WrapMatcher wraps each element in the set of matched elements inside the -// first element matched by the given matcher. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapMatcher(m Matcher) *Selection { - return s.wrapNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapSelection wraps each element in the set of matched elements inside the -// first element in the given Selection. The element is cloned before being -// inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapSelection(sel *Selection) *Selection { - return s.wrapNodes(sel.Nodes...) -} - -// WrapHtml wraps each element in the set of matched elements inside the inner- -// most child of the given HTML. -// -// It returns the original set of elements. -func (s *Selection) WrapHtml(html string) *Selection { - return s.wrapNodes(parseHtml(html)...) -} - -// WrapNode wraps each element in the set of matched elements inside the inner- -// most child of the given node. The given node is copied before being inserted -// into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapNode(n *html.Node) *Selection { - return s.wrapNodes(n) -} - -func (s *Selection) wrapNodes(ns ...*html.Node) *Selection { - s.Each(func(i int, ss *Selection) { - ss.wrapAllNodes(ns...) - }) - - return s -} - -// WrapAll wraps a single HTML structure, matched by the given selector, around -// all elements in the set of matched elements. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAll(selector string) *Selection { - return s.WrapAllMatcher(compileMatcher(selector)) -} - -// WrapAllMatcher wraps a single HTML structure, matched by the given Matcher, -// around all elements in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllMatcher(m Matcher) *Selection { - return s.wrapAllNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapAllSelection wraps a single HTML structure, the first node of the given -// Selection, around all elements in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllSelection(sel *Selection) *Selection { - return s.wrapAllNodes(sel.Nodes...) -} - -// WrapAllHtml wraps the given HTML structure around all elements in the set of -// matched elements. The matched child is cloned before being inserted into the -// document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllHtml(html string) *Selection { - return s.wrapAllNodes(parseHtml(html)...) -} - -func (s *Selection) wrapAllNodes(ns ...*html.Node) *Selection { - if len(ns) > 0 { - return s.WrapAllNode(ns[0]) - } - return s -} - -// WrapAllNode wraps the given node around the first element in the Selection, -// making all other nodes in the Selection children of the given node. The node -// is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllNode(n *html.Node) *Selection { - if s.Size() == 0 { - return s - } - - wrap := cloneNode(n) - - first := s.Nodes[0] - if first.Parent != nil { - first.Parent.InsertBefore(wrap, first) - first.Parent.RemoveChild(first) - } - - for c := getFirstChildEl(wrap); c != nil; c = getFirstChildEl(wrap) { - wrap = c - } - - newSingleSelection(wrap, s.document).AppendSelection(s) - - return s -} - -// WrapInner wraps an HTML structure, matched by the given selector, around the -// content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInner(selector string) *Selection { - return s.WrapInnerMatcher(compileMatcher(selector)) -} - -// WrapInnerMatcher wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerMatcher(m Matcher) *Selection { - return s.wrapInnerNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapInnerSelection wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerSelection(sel *Selection) *Selection { - return s.wrapInnerNodes(sel.Nodes...) -} - -// WrapInnerHtml wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerHtml(html string) *Selection { - return s.wrapInnerNodes(parseHtml(html)...) -} - -// WrapInnerNode wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerNode(n *html.Node) *Selection { - return s.wrapInnerNodes(n) -} - -func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection { - if len(ns) == 0 { - return s - } - - s.Each(func(i int, s *Selection) { - contents := s.Contents() - - if contents.Size() > 0 { - contents.wrapAllNodes(ns...) - } else { - s.AppendNodes(cloneNode(ns[0])) - } - }) - - return s -} - -func parseHtml(h string) []*html.Node { - // Errors are only returned when the io.Reader returns any error besides - // EOF, but strings.Reader never will - nodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode}) - if err != nil { - panic("goquery: failed to parse HTML: " + err.Error()) - } - return nodes -} - -func setHtmlNodes(s *Selection, ns ...*html.Node) *Selection { - for _, n := range s.Nodes { - for c := n.FirstChild; c != nil; c = n.FirstChild { - n.RemoveChild(c) - } - for _, c := range ns { - n.AppendChild(cloneNode(c)) - } - } - return s -} - -// Get the first child that is an ElementNode -func getFirstChildEl(n *html.Node) *html.Node { - c := n.FirstChild - for c != nil && c.Type != html.ElementNode { - c = c.NextSibling - } - return c -} - -// Deep copy a slice of nodes. -func cloneNodes(ns []*html.Node) []*html.Node { - cns := make([]*html.Node, 0, len(ns)) - - for _, n := range ns { - cns = append(cns, cloneNode(n)) - } - - return cns -} - -// Deep copy a node. The new node has clones of all the original node's -// children but none of its parents or siblings. -func cloneNode(n *html.Node) *html.Node { - nn := &html.Node{ - Type: n.Type, - DataAtom: n.DataAtom, - Data: n.Data, - Attr: make([]html.Attribute, len(n.Attr)), - } - - copy(nn.Attr, n.Attr) - for c := n.FirstChild; c != nil; c = c.NextSibling { - nn.AppendChild(cloneNode(c)) - } - - return nn -} - -func (s *Selection) manipulateNodes(ns []*html.Node, reverse bool, - f func(sn *html.Node, n *html.Node)) *Selection { - - lasti := s.Size() - 1 - - // net.Html doesn't provide document fragments for insertion, so to get - // things in the correct order with After() and Prepend(), the callback - // needs to be called on the reverse of the nodes. - if reverse { - for i, j := 0, len(ns)-1; i < j; i, j = i+1, j-1 { - ns[i], ns[j] = ns[j], ns[i] - } - } - - for i, sn := range s.Nodes { - for _, n := range ns { - if i != lasti { - f(sn, cloneNode(n)) - } else { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - f(sn, n) - } - } - } - - return s -} diff --git a/vendor/github.com/PuerkitoBio/goquery/property.go b/vendor/github.com/PuerkitoBio/goquery/property.go deleted file mode 100644 index 411126db..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/property.go +++ /dev/null @@ -1,275 +0,0 @@ -package goquery - -import ( - "bytes" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -var rxClassTrim = regexp.MustCompile("[\t\r\n]") - -// Attr gets the specified attribute's value for the first element in the -// Selection. To get the value for each element individually, use a looping -// construct such as Each or Map method. -func (s *Selection) Attr(attrName string) (val string, exists bool) { - if len(s.Nodes) == 0 { - return - } - return getAttributeValue(attrName, s.Nodes[0]) -} - -// AttrOr works like Attr but returns default value if attribute is not present. -func (s *Selection) AttrOr(attrName, defaultValue string) string { - if len(s.Nodes) == 0 { - return defaultValue - } - - val, exists := getAttributeValue(attrName, s.Nodes[0]) - if !exists { - return defaultValue - } - - return val -} - -// RemoveAttr removes the named attribute from each element in the set of matched elements. -func (s *Selection) RemoveAttr(attrName string) *Selection { - for _, n := range s.Nodes { - removeAttr(n, attrName) - } - - return s -} - -// SetAttr sets the given attribute on each element in the set of matched elements. -func (s *Selection) SetAttr(attrName, val string) *Selection { - for _, n := range s.Nodes { - attr := getAttributePtr(attrName, n) - if attr == nil { - n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val}) - } else { - attr.Val = val - } - } - - return s -} - -// Text gets the combined text contents of each element in the set of matched -// elements, including their descendants. -func (s *Selection) Text() string { - var buf bytes.Buffer - - // Slightly optimized vs calling Each: no single selection object created - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.TextNode { - // Keep newlines and spaces, like jQuery - buf.WriteString(n.Data) - } - if n.FirstChild != nil { - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - } - for _, n := range s.Nodes { - f(n) - } - - return buf.String() -} - -// Size is an alias for Length. -func (s *Selection) Size() int { - return s.Length() -} - -// Length returns the number of elements in the Selection object. -func (s *Selection) Length() int { - return len(s.Nodes) -} - -// Html gets the HTML contents of the first element in the set of matched -// elements. It includes text and comment nodes. -func (s *Selection) Html() (ret string, e error) { - // Since there is no .innerHtml, the HTML content must be re-created from - // the nodes using html.Render. - var buf bytes.Buffer - - if len(s.Nodes) > 0 { - for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling { - e = html.Render(&buf, c) - if e != nil { - return - } - } - ret = buf.String() - } - - return -} - -// AddClass adds the given class(es) to each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) AddClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - for _, n := range s.Nodes { - curClasses, attr := getClassesAndAttr(n, true) - for _, newClass := range tcls { - if !strings.Contains(curClasses, " "+newClass+" ") { - curClasses += newClass + " " - } - } - - setClasses(n, attr, curClasses) - } - - return s -} - -// HasClass determines whether any of the matched elements are assigned the -// given class. -func (s *Selection) HasClass(class string) bool { - class = " " + class + " " - for _, n := range s.Nodes { - classes, _ := getClassesAndAttr(n, false) - if strings.Contains(classes, class) { - return true - } - } - return false -} - -// RemoveClass removes the given class(es) from each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -// If no class name is provided, all classes are removed. -func (s *Selection) RemoveClass(class ...string) *Selection { - var rclasses []string - - classStr := strings.TrimSpace(strings.Join(class, " ")) - remove := classStr == "" - - if !remove { - rclasses = getClassesSlice(classStr) - } - - for _, n := range s.Nodes { - if remove { - removeAttr(n, "class") - } else { - classes, attr := getClassesAndAttr(n, true) - for _, rcl := range rclasses { - classes = strings.Replace(classes, " "+rcl+" ", " ", -1) - } - - setClasses(n, attr, classes) - } - } - - return s -} - -// ToggleClass adds or removes the given class(es) for each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) ToggleClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - - for _, n := range s.Nodes { - classes, attr := getClassesAndAttr(n, true) - for _, tcl := range tcls { - if strings.Contains(classes, " "+tcl+" ") { - classes = strings.Replace(classes, " "+tcl+" ", " ", -1) - } else { - classes += tcl + " " - } - } - - setClasses(n, attr, classes) - } - - return s -} - -func getAttributePtr(attrName string, n *html.Node) *html.Attribute { - if n == nil { - return nil - } - - for i, a := range n.Attr { - if a.Key == attrName { - return &n.Attr[i] - } - } - return nil -} - -// Private function to get the specified attribute's value from a node. -func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { - if a := getAttributePtr(attrName, n); a != nil { - val = a.Val - exists = true - } - return -} - -// Get and normalize the "class" attribute from the node. -func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { - // Applies only to element nodes - if n.Type == html.ElementNode { - attr = getAttributePtr("class", n) - if attr == nil && create { - n.Attr = append(n.Attr, html.Attribute{ - Key: "class", - Val: "", - }) - attr = &n.Attr[len(n.Attr)-1] - } - } - - if attr == nil { - classes = " " - } else { - classes = rxClassTrim.ReplaceAllString(" "+attr.Val+" ", " ") - } - - return -} - -func getClassesSlice(classes string) []string { - return strings.Split(rxClassTrim.ReplaceAllString(" "+classes+" ", " "), " ") -} - -func removeAttr(n *html.Node, attrName string) { - for i, a := range n.Attr { - if a.Key == attrName { - n.Attr[i], n.Attr[len(n.Attr)-1], n.Attr = - n.Attr[len(n.Attr)-1], html.Attribute{}, n.Attr[:len(n.Attr)-1] - return - } - } -} - -func setClasses(n *html.Node, attr *html.Attribute, classes string) { - classes = strings.TrimSpace(classes) - if classes == "" { - removeAttr(n, "class") - return - } - - attr.Val = classes -} diff --git a/vendor/github.com/PuerkitoBio/goquery/query.go b/vendor/github.com/PuerkitoBio/goquery/query.go deleted file mode 100644 index fe86bf0b..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/query.go +++ /dev/null @@ -1,49 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Is checks the current matched set of elements against a selector and -// returns true if at least one of these elements matches. -func (s *Selection) Is(selector string) bool { - return s.IsMatcher(compileMatcher(selector)) -} - -// IsMatcher checks the current matched set of elements against a matcher and -// returns true if at least one of these elements matches. -func (s *Selection) IsMatcher(m Matcher) bool { - if len(s.Nodes) > 0 { - if len(s.Nodes) == 1 { - return m.Match(s.Nodes[0]) - } - return len(m.Filter(s.Nodes)) > 0 - } - - return false -} - -// IsFunction checks the current matched set of elements against a predicate and -// returns true if at least one of these elements matches. -func (s *Selection) IsFunction(f func(int, *Selection) bool) bool { - return s.FilterFunction(f).Length() > 0 -} - -// IsSelection checks the current matched set of elements against a Selection object -// and returns true if at least one of these elements matches. -func (s *Selection) IsSelection(sel *Selection) bool { - return s.FilterSelection(sel).Length() > 0 -} - -// IsNodes checks the current matched set of elements against the specified nodes -// and returns true if at least one of these elements matches. -func (s *Selection) IsNodes(nodes ...*html.Node) bool { - return s.FilterNodes(nodes...).Length() > 0 -} - -// Contains returns true if the specified Node is within, -// at any depth, one of the nodes in the Selection object. -// It is NOT inclusive, to behave like jQuery's implementation, and -// unlike Javascript's .contains, so if the contained -// node is itself in the selection, it returns false. -func (s *Selection) Contains(n *html.Node) bool { - return sliceContains(s.Nodes, n) -} diff --git a/vendor/github.com/PuerkitoBio/goquery/traversal.go b/vendor/github.com/PuerkitoBio/goquery/traversal.go deleted file mode 100644 index 5fa5315a..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/traversal.go +++ /dev/null @@ -1,698 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -type siblingType int - -// Sibling type, used internally when iterating over children at the same -// level (siblings) to specify which nodes are requested. -const ( - siblingPrevUntil siblingType = iota - 3 - siblingPrevAll - siblingPrev - siblingAll - siblingNext - siblingNextAll - siblingNextUntil - siblingAllIncludingNonElements -) - -// Find gets the descendants of each element in the current set of matched -// elements, filtered by a selector. It returns a new Selection object -// containing these matched elements. -func (s *Selection) Find(selector string) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector))) -} - -// FindMatcher gets the descendants of each element in the current set of matched -// elements, filtered by the matcher. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindMatcher(m Matcher) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, m)) -} - -// FindSelection gets the descendants of each element in the current -// Selection, filtered by a Selection. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.FindNodes(sel.Nodes...) -} - -// FindNodes gets the descendants of each element in the current -// Selection, filtered by some nodes. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindNodes(nodes ...*html.Node) *Selection { - return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if sliceContains(s.Nodes, n) { - return []*html.Node{n} - } - return nil - })) -} - -// Contents gets the children of each element in the Selection, -// including text and comment nodes. It returns a new Selection object -// containing these elements. -func (s *Selection) Contents() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements)) -} - -// ContentsFiltered gets the children of each element in the Selection, -// filtered by the specified selector. It returns a new Selection -// object containing these elements. Since selectors only act on Element nodes, -// this function is an alias to ChildrenFiltered unless the selector is empty, -// in which case it is an alias to Contents. -func (s *Selection) ContentsFiltered(selector string) *Selection { - if selector != "" { - return s.ChildrenFiltered(selector) - } - return s.Contents() -} - -// ContentsMatcher gets the children of each element in the Selection, -// filtered by the specified matcher. It returns a new Selection -// object containing these elements. Since matchers only act on Element nodes, -// this function is an alias to ChildrenMatcher. -func (s *Selection) ContentsMatcher(m Matcher) *Selection { - return s.ChildrenMatcher(m) -} - -// Children gets the child elements of each element in the Selection. -// It returns a new Selection object containing these elements. -func (s *Selection) Children() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAll)) -} - -// ChildrenFiltered gets the child elements of each element in the Selection, -// filtered by the specified selector. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenFiltered(selector string) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector)) -} - -// ChildrenMatcher gets the child elements of each element in the Selection, -// filtered by the specified matcher. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenMatcher(m Matcher) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m) -} - -// Parent gets the parent of each element in the Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) Parent() *Selection { - return pushStack(s, getParentNodes(s.Nodes)) -} - -// ParentFiltered gets the parent of each element in the Selection filtered by a -// selector. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentFiltered(selector string) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector)) -} - -// ParentMatcher gets the parent of each element in the Selection filtered by a -// matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), m) -} - -// Closest gets the first element that matches the selector by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) Closest(selector string) *Selection { - cs := compileMatcher(selector) - return s.ClosestMatcher(cs) -} - -// ClosestMatcher gets the first element that matches the matcher by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestMatcher(m Matcher) *Selection { - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if m.Match(n) { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestNodes gets the first element that matches one of the nodes by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if set[n] { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestSelection gets the first element that matches one of the nodes in the -// Selection by testing the element itself and traversing up through its ancestors -// in the DOM tree. -func (s *Selection) ClosestSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.ClosestNodes(sel.Nodes...) -} - -// Parents gets the ancestors of each element in the current Selection. It -// returns a new Selection object with the matched elements. -func (s *Selection) Parents() *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nil)) -} - -// ParentsFiltered gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsFiltered(selector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector)) -} - -// ParentsMatcher gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m) -} - -// ParentsUntil gets the ancestors of each element in the Selection, up to but -// not including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntil(selector string) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil)) -} - -// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but -// not including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, m, nil)) -} - -// ParentsUntilSelection gets the ancestors of each element in the Selection, -// up to but not including the elements in the specified Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.Parents() - } - return s.ParentsUntilNodes(sel.Nodes...) -} - -// ParentsUntilNodes gets the ancestors of each element in the Selection, -// up to but not including the specified nodes. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nodes)) -} - -// ParentsFilteredUntil is like ParentsUntil, with the option to filter the -// results based on a selector string. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the -// results based on a matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter) -} - -// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.ParentsMatcher(filter) - } - return s.ParentsMatcherUntilNodes(filter, sel.Nodes...) -} - -// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector)) -} - -// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter) -} - -// Siblings gets the siblings of each element in the Selection. It returns -// a new Selection object containing the matched elements. -func (s *Selection) Siblings() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil)) -} - -// SiblingsFiltered gets the siblings of each element in the Selection -// filtered by a selector. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector)) -} - -// SiblingsMatcher gets the siblings of each element in the Selection -// filtered by a matcher. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m) -} - -// Next gets the immediately following sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Next() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil)) -} - -// NextFiltered gets the immediately following sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector)) -} - -// NextMatcher gets the immediately following sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m) -} - -// NextAll gets all the following siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) NextAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil)) -} - -// NextAllFiltered gets all the following siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector)) -} - -// NextAllMatcher gets all the following siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m) -} - -// Prev gets the immediately preceding sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Prev() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil)) -} - -// PrevFiltered gets the immediately preceding sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector)) -} - -// PrevMatcher gets the immediately preceding sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m) -} - -// PrevAll gets all the preceding siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) PrevAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil)) -} - -// PrevAllFiltered gets all the preceding siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector)) -} - -// PrevAllMatcher gets all the preceding siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m) -} - -// NextUntil gets all following siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(selector), nil)) -} - -// NextUntilMatcher gets all following siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - m, nil)) -} - -// NextUntilSelection gets all following siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.NextAll() - } - return s.NextUntilNodes(sel.Nodes...) -} - -// NextUntilNodes gets all following siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes)) -} - -// PrevUntil gets all preceding siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(selector), nil)) -} - -// PrevUntilMatcher gets all preceding siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - m, nil)) -} - -// PrevUntilSelection gets all preceding siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.PrevAll() - } - return s.PrevUntilNodes(sel.Nodes...) -} - -// PrevUntilNodes gets all preceding siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes)) -} - -// NextFilteredUntil is like NextUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - until, nil), filter) -} - -// NextFilteredUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.NextMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// NextMatcherUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.NextMatcher(filter) - } - return s.NextMatcherUntilNodes(filter, sel.Nodes...) -} - -// NextFilteredUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// NextMatcherUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), filter) -} - -// PrevFilteredUntil is like PrevUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// PrevFilteredUntilMatcher is like PrevUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - until, nil), filter) -} - -// PrevFilteredUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.PrevMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// PrevMatcherUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.PrevMatcher(filter) - } - return s.PrevMatcherUntilNodes(filter, sel.Nodes...) -} - -// PrevFilteredUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// PrevMatcherUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), filter) -} - -// Filter and push filters the nodes based on a matcher, and pushes the results -// on the stack, with the srcSel as previous selection. -func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection { - // Create a temporary Selection with the specified nodes to filter using winnow - sel := &Selection{nodes, srcSel.document, nil} - // Filter based on matcher and push on stack - return pushStack(srcSel, winnow(sel, m, true)) -} - -// Internal implementation of Find that return raw nodes. -func findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node { - // Map nodes to find the matches within the children of each node - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - // Go down one level, becausejQuery's Find selects only within descendants - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.ElementNode { - result = append(result, m.MatchAll(c)...) - } - } - return - }) -} - -// Internal implementation to get all parent nodes, stopping at the specified -// node (or nil if no stop). -func getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - for p := n.Parent; p != nil; p = p.Parent { - sel := newSingleSelection(p, nil) - if stopm != nil { - if sel.IsMatcher(stopm) { - break - } - } else if len(stopNodes) > 0 { - if sel.IsNodes(stopNodes...) { - break - } - } - if p.Type == html.ElementNode { - result = append(result, p) - } - } - return - }) -} - -// Internal implementation of sibling nodes that return a raw slice of matches. -func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNodes []*html.Node) []*html.Node { - var f func(*html.Node) bool - - // If the requested siblings are ...Until, create the test function to - // determine if the until condition is reached (returns true if it is) - if st == siblingNextUntil || st == siblingPrevUntil { - f = func(n *html.Node) bool { - if untilm != nil { - // Matcher-based condition - sel := newSingleSelection(n, nil) - return sel.IsMatcher(untilm) - } else if len(untilNodes) > 0 { - // Nodes-based condition - sel := newSingleSelection(n, nil) - return sel.IsNodes(untilNodes...) - } - return false - } - } - - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n.Parent, st, n, f) - }) -} - -// Gets the children nodes of each node in the specified slice of nodes, -// based on the sibling type request. -func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n, st, nil, nil) - }) -} - -// Gets the children of the specified parent, based on the requested sibling -// type, skipping a specified node if required. -func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node, - untilFunc func(*html.Node) bool) (result []*html.Node) { - - // Create the iterator function - var iter = func(cur *html.Node) (ret *html.Node) { - // Based on the sibling type requested, iterate the right way - for { - switch st { - case siblingAll, siblingAllIncludingNonElements: - if cur == nil { - // First iteration, start with first child of parent - // Skip node if required - if ret = parent.FirstChild; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } else { - // Skip node if required - if ret = cur.NextSibling; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } - case siblingPrev, siblingPrevAll, siblingPrevUntil: - if cur == nil { - // Start with previous sibling of the skip node - ret = skipNode.PrevSibling - } else { - ret = cur.PrevSibling - } - case siblingNext, siblingNextAll, siblingNextUntil: - if cur == nil { - // Start with next sibling of the skip node - ret = skipNode.NextSibling - } else { - ret = cur.NextSibling - } - default: - panic("Invalid sibling type.") - } - if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements { - return - } - // Not a valid node, try again from this one - cur = ret - } - } - - for c := iter(nil); c != nil; c = iter(c) { - // If this is an ...Until case, test before append (returns true - // if the until condition is reached) - if st == siblingNextUntil || st == siblingPrevUntil { - if untilFunc(c) { - return - } - } - result = append(result, c) - if st == siblingNext || st == siblingPrev { - // Only one node was requested (immediate next or previous), so exit - return - } - } - return -} - -// Internal implementation of parent nodes that return a raw slice of Nodes. -func getParentNodes(nodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if n.Parent != nil && n.Parent.Type == html.ElementNode { - return []*html.Node{n.Parent} - } - return nil - }) -} - -// Internal map function used by many traversing methods. Takes the source nodes -// to iterate on and the mapping function that returns an array of nodes. -// Returns an array of nodes mapped by calling the callback function once for -// each node in the source nodes. -func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) { - set := make(map[*html.Node]bool) - for i, n := range nodes { - if vals := f(i, n); len(vals) > 0 { - result = appendWithoutDuplicates(result, vals, set) - } - } - return result -} diff --git a/vendor/github.com/PuerkitoBio/goquery/type.go b/vendor/github.com/PuerkitoBio/goquery/type.go deleted file mode 100644 index 6ad51dbc..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/type.go +++ /dev/null @@ -1,141 +0,0 @@ -package goquery - -import ( - "errors" - "io" - "net/http" - "net/url" - - "github.com/andybalholm/cascadia" - - "golang.org/x/net/html" -) - -// Document represents an HTML document to be manipulated. Unlike jQuery, which -// is loaded as part of a DOM document, and thus acts upon its containing -// document, GoQuery doesn't know which HTML document to act upon. So it needs -// to be told, and that's what the Document class is for. It holds the root -// document node to manipulate, and can make selections on this document. -type Document struct { - *Selection - Url *url.URL - rootNode *html.Node -} - -// NewDocumentFromNode is a Document constructor that takes a root html Node -// as argument. -func NewDocumentFromNode(root *html.Node) *Document { - return newDocument(root, nil) -} - -// NewDocument is a Document constructor that takes a string URL as argument. -// It loads the specified document, parses it, and stores the root Document -// node, ready to be manipulated. -// -// Deprecated: Use the net/http standard library package to make the request -// and validate the response before calling goquery.NewDocumentFromReader -// with the response's body. -func NewDocument(url string) (*Document, error) { - // Load the URL - res, e := http.Get(url) - if e != nil { - return nil, e - } - return NewDocumentFromResponse(res) -} - -// NewDocumentFromReader returns a Document from an io.Reader. -// It returns an error as second value if the reader's data cannot be parsed -// as html. It does not check if the reader is also an io.Closer, the -// provided reader is never closed by this call. It is the responsibility -// of the caller to close it if required. -func NewDocumentFromReader(r io.Reader) (*Document, error) { - root, e := html.Parse(r) - if e != nil { - return nil, e - } - return newDocument(root, nil), nil -} - -// NewDocumentFromResponse is another Document constructor that takes an http response as argument. -// It loads the specified response's document, parses it, and stores the root Document -// node, ready to be manipulated. The response's body is closed on return. -// -// Deprecated: Use goquery.NewDocumentFromReader with the response's body. -func NewDocumentFromResponse(res *http.Response) (*Document, error) { - if res == nil { - return nil, errors.New("Response is nil") - } - defer res.Body.Close() - if res.Request == nil { - return nil, errors.New("Response.Request is nil") - } - - // Parse the HTML into nodes - root, e := html.Parse(res.Body) - if e != nil { - return nil, e - } - - // Create and fill the document - return newDocument(root, res.Request.URL), nil -} - -// CloneDocument creates a deep-clone of a document. -func CloneDocument(doc *Document) *Document { - return newDocument(cloneNode(doc.rootNode), doc.Url) -} - -// Private constructor, make sure all fields are correctly filled. -func newDocument(root *html.Node, url *url.URL) *Document { - // Create and fill the document - d := &Document{nil, url, root} - d.Selection = newSingleSelection(root, d) - return d -} - -// Selection represents a collection of nodes matching some criteria. The -// initial Selection can be created by using Document.Find, and then -// manipulated using the jQuery-like chainable syntax and methods. -type Selection struct { - Nodes []*html.Node - document *Document - prevSel *Selection -} - -// Helper constructor to create an empty selection -func newEmptySelection(doc *Document) *Selection { - return &Selection{nil, doc, nil} -} - -// Helper constructor to create a selection of only one node -func newSingleSelection(node *html.Node, doc *Document) *Selection { - return &Selection{[]*html.Node{node}, doc, nil} -} - -// Matcher is an interface that defines the methods to match -// HTML nodes against a compiled selector string. Cascadia's -// Selector implements this interface. -type Matcher interface { - Match(*html.Node) bool - MatchAll(*html.Node) []*html.Node - Filter([]*html.Node) []*html.Node -} - -// compileMatcher compiles the selector string s and returns -// the corresponding Matcher. If s is an invalid selector string, -// it returns a Matcher that fails all matches. -func compileMatcher(s string) Matcher { - cs, err := cascadia.Compile(s) - if err != nil { - return invalidMatcher{} - } - return cs -} - -// invalidMatcher is a Matcher that always fails to match. -type invalidMatcher struct{} - -func (invalidMatcher) Match(n *html.Node) bool { return false } -func (invalidMatcher) MatchAll(n *html.Node) []*html.Node { return nil } -func (invalidMatcher) Filter(ns []*html.Node) []*html.Node { return nil } diff --git a/vendor/github.com/PuerkitoBio/goquery/utilities.go b/vendor/github.com/PuerkitoBio/goquery/utilities.go deleted file mode 100644 index b4c061a4..00000000 --- a/vendor/github.com/PuerkitoBio/goquery/utilities.go +++ /dev/null @@ -1,161 +0,0 @@ -package goquery - -import ( - "bytes" - - "golang.org/x/net/html" -) - -// used to determine if a set (map[*html.Node]bool) should be used -// instead of iterating over a slice. The set uses more memory and -// is slower than slice iteration for small N. -const minNodesForSet = 1000 - -var nodeNames = []string{ - html.ErrorNode: "#error", - html.TextNode: "#text", - html.DocumentNode: "#document", - html.CommentNode: "#comment", -} - -// NodeName returns the node name of the first element in the selection. -// It tries to behave in a similar way as the DOM's nodeName property -// (https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName). -// -// Go's net/html package defines the following node types, listed with -// the corresponding returned value from this function: -// -// ErrorNode : #error -// TextNode : #text -// DocumentNode : #document -// ElementNode : the element's tag name -// CommentNode : #comment -// DoctypeNode : the name of the document type -// -func NodeName(s *Selection) string { - if s.Length() == 0 { - return "" - } - switch n := s.Get(0); n.Type { - case html.ElementNode, html.DoctypeNode: - return n.Data - default: - if n.Type >= 0 && int(n.Type) < len(nodeNames) { - return nodeNames[n.Type] - } - return "" - } -} - -// OuterHtml returns the outer HTML rendering of the first item in -// the selection - that is, the HTML including the first element's -// tag and attributes. -// -// Unlike InnerHtml, this is a function and not a method on the Selection, -// because this is not a jQuery method (in javascript-land, this is -// a property provided by the DOM). -func OuterHtml(s *Selection) (string, error) { - var buf bytes.Buffer - - if s.Length() == 0 { - return "", nil - } - n := s.Get(0) - if err := html.Render(&buf, n); err != nil { - return "", err - } - return buf.String(), nil -} - -// Loop through all container nodes to search for the target node. -func sliceContains(container []*html.Node, contained *html.Node) bool { - for _, n := range container { - if nodeContains(n, contained) { - return true - } - } - - return false -} - -// Checks if the contained node is within the container node. -func nodeContains(container *html.Node, contained *html.Node) bool { - // Check if the parent of the contained node is the container node, traversing - // upward until the top is reached, or the container is found. - for contained = contained.Parent; contained != nil; contained = contained.Parent { - if container == contained { - return true - } - } - return false -} - -// Checks if the target node is in the slice of nodes. -func isInSlice(slice []*html.Node, node *html.Node) bool { - return indexInSlice(slice, node) > -1 -} - -// Returns the index of the target node in the slice, or -1. -func indexInSlice(slice []*html.Node, node *html.Node) int { - if node != nil { - for i, n := range slice { - if n == node { - return i - } - } - } - return -1 -} - -// Appends the new nodes to the target slice, making sure no duplicate is added. -// There is no check to the original state of the target slice, so it may still -// contain duplicates. The target slice is returned because append() may create -// a new underlying array. If targetSet is nil, a local set is created with the -// target if len(target) + len(nodes) is greater than minNodesForSet. -func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet map[*html.Node]bool) []*html.Node { - // if there are not that many nodes, don't use the map, faster to just use nested loops - // (unless a non-nil targetSet is passed, in which case the caller knows better). - if targetSet == nil && len(target)+len(nodes) < minNodesForSet { - for _, n := range nodes { - if !isInSlice(target, n) { - target = append(target, n) - } - } - return target - } - - // if a targetSet is passed, then assume it is reliable, otherwise create one - // and initialize it with the current target contents. - if targetSet == nil { - targetSet = make(map[*html.Node]bool, len(target)) - for _, n := range target { - targetSet[n] = true - } - } - for _, n := range nodes { - if !targetSet[n] { - target = append(target, n) - targetSet[n] = true - } - } - - return target -} - -// Loop through a selection, returning only those nodes that pass the predicate -// function. -func grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) { - for i, n := range sel.Nodes { - if predicate(i, newSingleSelection(n, sel.document)) { - result = append(result, n) - } - } - return result -} - -// Creates a new Selection object based on the specified nodes, and keeps the -// source Selection object on the stack (linked list). -func pushStack(fromSel *Selection, nodes []*html.Node) *Selection { - result := &Selection{nodes, fromSel.document, fromSel} - return result -} diff --git a/vendor/github.com/StackExchange/wmi/LICENSE b/vendor/github.com/StackExchange/wmi/LICENSE deleted file mode 100644 index ae80b672..00000000 --- a/vendor/github.com/StackExchange/wmi/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Stack Exchange - -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. diff --git a/vendor/github.com/StackExchange/wmi/README.md b/vendor/github.com/StackExchange/wmi/README.md deleted file mode 100644 index 426d1a46..00000000 --- a/vendor/github.com/StackExchange/wmi/README.md +++ /dev/null @@ -1,6 +0,0 @@ -wmi -=== - -Package wmi provides a WQL interface to Windows WMI. - -Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. diff --git a/vendor/github.com/StackExchange/wmi/swbemservices.go b/vendor/github.com/StackExchange/wmi/swbemservices.go deleted file mode 100644 index 3ff87563..00000000 --- a/vendor/github.com/StackExchange/wmi/swbemservices.go +++ /dev/null @@ -1,260 +0,0 @@ -// +build windows - -package wmi - -import ( - "fmt" - "reflect" - "runtime" - "sync" - - "github.com/go-ole/go-ole" - "github.com/go-ole/go-ole/oleutil" -) - -// SWbemServices is used to access wmi. See https://msdn.microsoft.com/en-us/library/aa393719(v=vs.85).aspx -type SWbemServices struct { - //TODO: track namespace. Not sure if we can re connect to a different namespace using the same instance - cWMIClient *Client //This could also be an embedded struct, but then we would need to branch on Client vs SWbemServices in the Query method - sWbemLocatorIUnknown *ole.IUnknown - sWbemLocatorIDispatch *ole.IDispatch - queries chan *queryRequest - closeError chan error - lQueryorClose sync.Mutex -} - -type queryRequest struct { - query string - dst interface{} - args []interface{} - finished chan error -} - -// InitializeSWbemServices will return a new SWbemServices object that can be used to query WMI -func InitializeSWbemServices(c *Client, connectServerArgs ...interface{}) (*SWbemServices, error) { - //fmt.Println("InitializeSWbemServices: Starting") - //TODO: implement connectServerArgs as optional argument for init with connectServer call - s := new(SWbemServices) - s.cWMIClient = c - s.queries = make(chan *queryRequest) - initError := make(chan error) - go s.process(initError) - - err, ok := <-initError - if ok { - return nil, err //Send error to caller - } - //fmt.Println("InitializeSWbemServices: Finished") - return s, nil -} - -// Close will clear and release all of the SWbemServices resources -func (s *SWbemServices) Close() error { - s.lQueryorClose.Lock() - if s == nil || s.sWbemLocatorIDispatch == nil { - s.lQueryorClose.Unlock() - return fmt.Errorf("SWbemServices is not Initialized") - } - if s.queries == nil { - s.lQueryorClose.Unlock() - return fmt.Errorf("SWbemServices has been closed") - } - //fmt.Println("Close: sending close request") - var result error - ce := make(chan error) - s.closeError = ce //Race condition if multiple callers to close. May need to lock here - close(s.queries) //Tell background to shut things down - s.lQueryorClose.Unlock() - err, ok := <-ce - if ok { - result = err - } - //fmt.Println("Close: finished") - return result -} - -func (s *SWbemServices) process(initError chan error) { - //fmt.Println("process: starting background thread initialization") - //All OLE/WMI calls must happen on the same initialized thead, so lock this goroutine - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) - if err != nil { - oleCode := err.(*ole.OleError).Code() - if oleCode != ole.S_OK && oleCode != S_FALSE { - initError <- fmt.Errorf("ole.CoInitializeEx error: %v", err) - return - } - } - defer ole.CoUninitialize() - - unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") - if err != nil { - initError <- fmt.Errorf("CreateObject SWbemLocator error: %v", err) - return - } else if unknown == nil { - initError <- ErrNilCreateObject - return - } - defer unknown.Release() - s.sWbemLocatorIUnknown = unknown - - dispatch, err := s.sWbemLocatorIUnknown.QueryInterface(ole.IID_IDispatch) - if err != nil { - initError <- fmt.Errorf("SWbemLocator QueryInterface error: %v", err) - return - } - defer dispatch.Release() - s.sWbemLocatorIDispatch = dispatch - - // we can't do the ConnectServer call outside the loop unless we find a way to track and re-init the connectServerArgs - //fmt.Println("process: initialized. closing initError") - close(initError) - //fmt.Println("process: waiting for queries") - for q := range s.queries { - //fmt.Printf("process: new query: len(query)=%d\n", len(q.query)) - errQuery := s.queryBackground(q) - //fmt.Println("process: s.queryBackground finished") - if errQuery != nil { - q.finished <- errQuery - } - close(q.finished) - } - //fmt.Println("process: queries channel closed") - s.queries = nil //set channel to nil so we know it is closed - //TODO: I think the Release/Clear calls can panic if things are in a bad state. - //TODO: May need to recover from panics and send error to method caller instead. - close(s.closeError) -} - -// Query runs the WQL query using a SWbemServices instance and appends the values to dst. -// -// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in -// the query must have the same name in dst. Supported types are all signed and -// unsigned integers, time.Time, string, bool, or a pointer to one of those. -// Array types are not supported. -// -// By default, the local machine and default namespace are used. These can be -// changed using connectServerArgs. See -// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. -func (s *SWbemServices) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { - s.lQueryorClose.Lock() - if s == nil || s.sWbemLocatorIDispatch == nil { - s.lQueryorClose.Unlock() - return fmt.Errorf("SWbemServices is not Initialized") - } - if s.queries == nil { - s.lQueryorClose.Unlock() - return fmt.Errorf("SWbemServices has been closed") - } - - //fmt.Println("Query: Sending query request") - qr := queryRequest{ - query: query, - dst: dst, - args: connectServerArgs, - finished: make(chan error), - } - s.queries <- &qr - s.lQueryorClose.Unlock() - err, ok := <-qr.finished - if ok { - //fmt.Println("Query: Finished with error") - return err //Send error to caller - } - //fmt.Println("Query: Finished") - return nil -} - -func (s *SWbemServices) queryBackground(q *queryRequest) error { - if s == nil || s.sWbemLocatorIDispatch == nil { - return fmt.Errorf("SWbemServices is not Initialized") - } - wmi := s.sWbemLocatorIDispatch //Should just rename in the code, but this will help as we break things apart - //fmt.Println("queryBackground: Starting") - - dv := reflect.ValueOf(q.dst) - if dv.Kind() != reflect.Ptr || dv.IsNil() { - return ErrInvalidEntityType - } - dv = dv.Elem() - mat, elemType := checkMultiArg(dv) - if mat == multiArgTypeInvalid { - return ErrInvalidEntityType - } - - // service is a SWbemServices - serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", q.args...) - if err != nil { - return err - } - service := serviceRaw.ToIDispatch() - defer serviceRaw.Clear() - - // result is a SWBemObjectSet - resultRaw, err := oleutil.CallMethod(service, "ExecQuery", q.query) - if err != nil { - return err - } - result := resultRaw.ToIDispatch() - defer resultRaw.Clear() - - count, err := oleInt64(result, "Count") - if err != nil { - return err - } - - enumProperty, err := result.GetProperty("_NewEnum") - if err != nil { - return err - } - defer enumProperty.Clear() - - enum, err := enumProperty.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) - if err != nil { - return err - } - if enum == nil { - return fmt.Errorf("can't get IEnumVARIANT, enum is nil") - } - defer enum.Release() - - // Initialize a slice with Count capacity - dv.Set(reflect.MakeSlice(dv.Type(), 0, int(count))) - - var errFieldMismatch error - for itemRaw, length, err := enum.Next(1); length > 0; itemRaw, length, err = enum.Next(1) { - if err != nil { - return err - } - - err := func() error { - // item is a SWbemObject, but really a Win32_Process - item := itemRaw.ToIDispatch() - defer item.Release() - - ev := reflect.New(elemType) - if err = s.cWMIClient.loadEntity(ev.Interface(), item); err != nil { - if _, ok := err.(*ErrFieldMismatch); ok { - // We continue loading entities even in the face of field mismatch errors. - // If we encounter any other error, that other error is returned. Otherwise, - // an ErrFieldMismatch is returned. - errFieldMismatch = err - } else { - return err - } - } - if mat != multiArgTypeStructPtr { - ev = ev.Elem() - } - dv.Set(reflect.Append(dv, ev)) - return nil - }() - if err != nil { - return err - } - } - //fmt.Println("queryBackground: Finished") - return errFieldMismatch -} diff --git a/vendor/github.com/StackExchange/wmi/wmi.go b/vendor/github.com/StackExchange/wmi/wmi.go deleted file mode 100644 index eab18cbf..00000000 --- a/vendor/github.com/StackExchange/wmi/wmi.go +++ /dev/null @@ -1,501 +0,0 @@ -// +build windows - -/* -Package wmi provides a WQL interface for WMI on Windows. - -Example code to print names of running processes: - - type Win32_Process struct { - Name string - } - - func main() { - var dst []Win32_Process - q := wmi.CreateQuery(&dst, "") - err := wmi.Query(q, &dst) - if err != nil { - log.Fatal(err) - } - for i, v := range dst { - println(i, v.Name) - } - } - -*/ -package wmi - -import ( - "bytes" - "errors" - "fmt" - "log" - "os" - "reflect" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "github.com/go-ole/go-ole" - "github.com/go-ole/go-ole/oleutil" -) - -var l = log.New(os.Stdout, "", log.LstdFlags) - -var ( - ErrInvalidEntityType = errors.New("wmi: invalid entity type") - // ErrNilCreateObject is the error returned if CreateObject returns nil even - // if the error was nil. - ErrNilCreateObject = errors.New("wmi: create object returned nil") - lock sync.Mutex -) - -// S_FALSE is returned by CoInitializeEx if it was already called on this thread. -const S_FALSE = 0x00000001 - -// QueryNamespace invokes Query with the given namespace on the local machine. -func QueryNamespace(query string, dst interface{}, namespace string) error { - return Query(query, dst, nil, namespace) -} - -// Query runs the WQL query and appends the values to dst. -// -// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in -// the query must have the same name in dst. Supported types are all signed and -// unsigned integers, time.Time, string, bool, or a pointer to one of those. -// Array types are not supported. -// -// By default, the local machine and default namespace are used. These can be -// changed using connectServerArgs. See -// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. -// -// Query is a wrapper around DefaultClient.Query. -func Query(query string, dst interface{}, connectServerArgs ...interface{}) error { - if DefaultClient.SWbemServicesClient == nil { - return DefaultClient.Query(query, dst, connectServerArgs...) - } - return DefaultClient.SWbemServicesClient.Query(query, dst, connectServerArgs...) -} - -// A Client is an WMI query client. -// -// Its zero value (DefaultClient) is a usable client. -type Client struct { - // NonePtrZero specifies if nil values for fields which aren't pointers - // should be returned as the field types zero value. - // - // Setting this to true allows stucts without pointer fields to be used - // without the risk failure should a nil value returned from WMI. - NonePtrZero bool - - // PtrNil specifies if nil values for pointer fields should be returned - // as nil. - // - // Setting this to true will set pointer fields to nil where WMI - // returned nil, otherwise the types zero value will be returned. - PtrNil bool - - // AllowMissingFields specifies that struct fields not present in the - // query result should not result in an error. - // - // Setting this to true allows custom queries to be used with full - // struct definitions instead of having to define multiple structs. - AllowMissingFields bool - - // SWbemServiceClient is an optional SWbemServices object that can be - // initialized and then reused across multiple queries. If it is null - // then the method will initialize a new temporary client each time. - SWbemServicesClient *SWbemServices -} - -// DefaultClient is the default Client and is used by Query, QueryNamespace -var DefaultClient = &Client{} - -// Query runs the WQL query and appends the values to dst. -// -// dst must have type *[]S or *[]*S, for some struct type S. Fields selected in -// the query must have the same name in dst. Supported types are all signed and -// unsigned integers, time.Time, string, bool, or a pointer to one of those. -// Array types are not supported. -// -// By default, the local machine and default namespace are used. These can be -// changed using connectServerArgs. See -// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. -func (c *Client) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { - dv := reflect.ValueOf(dst) - if dv.Kind() != reflect.Ptr || dv.IsNil() { - return ErrInvalidEntityType - } - dv = dv.Elem() - mat, elemType := checkMultiArg(dv) - if mat == multiArgTypeInvalid { - return ErrInvalidEntityType - } - - lock.Lock() - defer lock.Unlock() - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) - if err != nil { - oleCode := err.(*ole.OleError).Code() - if oleCode != ole.S_OK && oleCode != S_FALSE { - return err - } - } - defer ole.CoUninitialize() - - unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") - if err != nil { - return err - } else if unknown == nil { - return ErrNilCreateObject - } - defer unknown.Release() - - wmi, err := unknown.QueryInterface(ole.IID_IDispatch) - if err != nil { - return err - } - defer wmi.Release() - - // service is a SWbemServices - serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) - if err != nil { - return err - } - service := serviceRaw.ToIDispatch() - defer serviceRaw.Clear() - - // result is a SWBemObjectSet - resultRaw, err := oleutil.CallMethod(service, "ExecQuery", query) - if err != nil { - return err - } - result := resultRaw.ToIDispatch() - defer resultRaw.Clear() - - count, err := oleInt64(result, "Count") - if err != nil { - return err - } - - enumProperty, err := result.GetProperty("_NewEnum") - if err != nil { - return err - } - defer enumProperty.Clear() - - enum, err := enumProperty.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) - if err != nil { - return err - } - if enum == nil { - return fmt.Errorf("can't get IEnumVARIANT, enum is nil") - } - defer enum.Release() - - // Initialize a slice with Count capacity - dv.Set(reflect.MakeSlice(dv.Type(), 0, int(count))) - - var errFieldMismatch error - for itemRaw, length, err := enum.Next(1); length > 0; itemRaw, length, err = enum.Next(1) { - if err != nil { - return err - } - - err := func() error { - // item is a SWbemObject, but really a Win32_Process - item := itemRaw.ToIDispatch() - defer item.Release() - - ev := reflect.New(elemType) - if err = c.loadEntity(ev.Interface(), item); err != nil { - if _, ok := err.(*ErrFieldMismatch); ok { - // We continue loading entities even in the face of field mismatch errors. - // If we encounter any other error, that other error is returned. Otherwise, - // an ErrFieldMismatch is returned. - errFieldMismatch = err - } else { - return err - } - } - if mat != multiArgTypeStructPtr { - ev = ev.Elem() - } - dv.Set(reflect.Append(dv, ev)) - return nil - }() - if err != nil { - return err - } - } - return errFieldMismatch -} - -// ErrFieldMismatch is returned when a field is to be loaded into a different -// type than the one it was stored from, or when a field is missing or -// unexported in the destination struct. -// StructType is the type of the struct pointed to by the destination argument. -type ErrFieldMismatch struct { - StructType reflect.Type - FieldName string - Reason string -} - -func (e *ErrFieldMismatch) Error() string { - return fmt.Sprintf("wmi: cannot load field %q into a %q: %s", - e.FieldName, e.StructType, e.Reason) -} - -var timeType = reflect.TypeOf(time.Time{}) - -// loadEntity loads a SWbemObject into a struct pointer. -func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismatch error) { - v := reflect.ValueOf(dst).Elem() - for i := 0; i < v.NumField(); i++ { - f := v.Field(i) - of := f - isPtr := f.Kind() == reflect.Ptr - if isPtr { - ptr := reflect.New(f.Type().Elem()) - f.Set(ptr) - f = f.Elem() - } - n := v.Type().Field(i).Name - if !f.CanSet() { - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "CanSet() is false", - } - } - prop, err := oleutil.GetProperty(src, n) - if err != nil { - if !c.AllowMissingFields { - errFieldMismatch = &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "no such struct field", - } - } - continue - } - defer prop.Clear() - - if prop.VT == 0x1 { //VT_NULL - continue - } - - switch val := prop.Value().(type) { - case int8, int16, int32, int64, int: - v := reflect.ValueOf(val).Int() - switch f.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - f.SetInt(v) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - f.SetUint(uint64(v)) - default: - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "not an integer class", - } - } - case uint8, uint16, uint32, uint64: - v := reflect.ValueOf(val).Uint() - switch f.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - f.SetInt(int64(v)) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - f.SetUint(v) - default: - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "not an integer class", - } - } - case string: - switch f.Kind() { - case reflect.String: - f.SetString(val) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - iv, err := strconv.ParseInt(val, 10, 64) - if err != nil { - return err - } - f.SetInt(iv) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - uv, err := strconv.ParseUint(val, 10, 64) - if err != nil { - return err - } - f.SetUint(uv) - case reflect.Struct: - switch f.Type() { - case timeType: - if len(val) == 25 { - mins, err := strconv.Atoi(val[22:]) - if err != nil { - return err - } - val = val[:22] + fmt.Sprintf("%02d%02d", mins/60, mins%60) - } - t, err := time.Parse("20060102150405.000000-0700", val) - if err != nil { - return err - } - f.Set(reflect.ValueOf(t)) - } - } - case bool: - switch f.Kind() { - case reflect.Bool: - f.SetBool(val) - default: - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "not a bool", - } - } - case float32: - switch f.Kind() { - case reflect.Float32: - f.SetFloat(float64(val)) - default: - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: "not a Float32", - } - } - default: - if f.Kind() == reflect.Slice { - switch f.Type().Elem().Kind() { - case reflect.String: - safeArray := prop.ToArray() - if safeArray != nil { - arr := safeArray.ToValueArray() - fArr := reflect.MakeSlice(f.Type(), len(arr), len(arr)) - for i, v := range arr { - s := fArr.Index(i) - s.SetString(v.(string)) - } - f.Set(fArr) - } - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - safeArray := prop.ToArray() - if safeArray != nil { - arr := safeArray.ToValueArray() - fArr := reflect.MakeSlice(f.Type(), len(arr), len(arr)) - for i, v := range arr { - s := fArr.Index(i) - s.SetUint(reflect.ValueOf(v).Uint()) - } - f.Set(fArr) - } - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - safeArray := prop.ToArray() - if safeArray != nil { - arr := safeArray.ToValueArray() - fArr := reflect.MakeSlice(f.Type(), len(arr), len(arr)) - for i, v := range arr { - s := fArr.Index(i) - s.SetInt(reflect.ValueOf(v).Int()) - } - f.Set(fArr) - } - default: - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: fmt.Sprintf("unsupported slice type (%T)", val), - } - } - } else { - typeof := reflect.TypeOf(val) - if typeof == nil && (isPtr || c.NonePtrZero) { - if (isPtr && c.PtrNil) || (!isPtr && c.NonePtrZero) { - of.Set(reflect.Zero(of.Type())) - } - break - } - return &ErrFieldMismatch{ - StructType: of.Type(), - FieldName: n, - Reason: fmt.Sprintf("unsupported type (%T)", val), - } - } - } - } - return errFieldMismatch -} - -type multiArgType int - -const ( - multiArgTypeInvalid multiArgType = iota - multiArgTypeStruct - multiArgTypeStructPtr -) - -// checkMultiArg checks that v has type []S, []*S for some struct type S. -// -// It returns what category the slice's elements are, and the reflect.Type -// that represents S. -func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Type) { - if v.Kind() != reflect.Slice { - return multiArgTypeInvalid, nil - } - elemType = v.Type().Elem() - switch elemType.Kind() { - case reflect.Struct: - return multiArgTypeStruct, elemType - case reflect.Ptr: - elemType = elemType.Elem() - if elemType.Kind() == reflect.Struct { - return multiArgTypeStructPtr, elemType - } - } - return multiArgTypeInvalid, nil -} - -func oleInt64(item *ole.IDispatch, prop string) (int64, error) { - v, err := oleutil.GetProperty(item, prop) - if err != nil { - return 0, err - } - defer v.Clear() - - i := int64(v.Val) - return i, nil -} - -// CreateQuery returns a WQL query string that queries all columns of src. where -// is an optional string that is appended to the query, to be used with WHERE -// clauses. In such a case, the "WHERE" string should appear at the beginning. -func CreateQuery(src interface{}, where string) string { - var b bytes.Buffer - b.WriteString("SELECT ") - s := reflect.Indirect(reflect.ValueOf(src)) - t := s.Type() - if s.Kind() == reflect.Slice { - t = t.Elem() - } - if t.Kind() != reflect.Struct { - return "" - } - var fields []string - for i := 0; i < t.NumField(); i++ { - fields = append(fields, t.Field(i).Name) - } - b.WriteString(strings.Join(fields, ", ")) - b.WriteString(" FROM ") - b.WriteString(t.Name()) - b.WriteString(" " + where) - return b.String() -} diff --git a/vendor/github.com/VictorAvelar/devto-api-go/LICENSE b/vendor/github.com/VictorAvelar/devto-api-go/LICENSE deleted file mode 100644 index a174a6c0..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Victor Hugo Avelar Ossorio - -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. diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/articles.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/articles.go deleted file mode 100644 index 9469e472..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/articles.go +++ /dev/null @@ -1,227 +0,0 @@ -package devto - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "strings" - - "github.com/google/go-querystring/query" -) - -// ArticlesResource implements the APIResource interface -// for devto articles. -type ArticlesResource struct { - API *Client -} - -// List will return the articles uploaded to devto, the result -// can be narrowed down, filtered or enhanced using query -// parameters as specified on the documentation. -// See: https://docs.dev.to/api/#tag/articles/paths/~1articles/get -func (ar *ArticlesResource) List(ctx context.Context, opt ArticleListOptions) ([]ListedArticle, error) { - q, err := query.Values(opt) - if err != nil { - return nil, err - } - req, err := ar.API.NewRequest(http.MethodGet, fmt.Sprintf("api/articles?%s", q.Encode()), nil) - if err != nil { - return nil, err - } - - res, err := ar.API.HTTPClient.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - if nonSuccessfulResponse(res) { - return nil, unmarshalErrorResponse(res) - } - var articles []ListedArticle - if err := json.NewDecoder(res.Body).Decode(&articles); err != nil { - return nil, err - } - return articles, nil -} - -// ListForTag is a convenience method for retrieving articles -// for a particular tag, calling the base List method. -func (ar *ArticlesResource) ListForTag(ctx context.Context, tag string, page int) ([]ListedArticle, error) { - return ar.List(ctx, ArticleListOptions{Tags: tag, Page: page}) -} - -// ListForUser is a convenience method for retrieving articles -// written by a particular user, calling the base List method. -func (ar *ArticlesResource) ListForUser(ctx context.Context, username string, page int) ([]ListedArticle, error) { - return ar.List(ctx, ArticleListOptions{Username: username, Page: page}) -} - -// ListMyPublishedArticles lists all published articles -// written by the user authenticated with this client, -// erroring if the caller is not authenticated. Articles in -// the response will be listed in reverse chronological order -// by their publication times. -// -// If opts is nil, then no query parameters will be sent; the -// page number will be 1 and the page size will be 30 -// articles. -func (ar *ArticlesResource) ListMyPublishedArticles(ctx context.Context, opts *MyArticlesOptions) ([]ListedArticle, error) { - return ar.listMyArticles(ctx, "api/articles/me/published", opts) -} - -// ListMyUnpublishedArticles lists all unpublished articles -// written by the user authenticated with this client, -// erroring if the caller is not authenticated. Articles in -// the response will be listed in reverse chronological order -// by their creation times. -// -// If opts is nil, then no query parameters will be sent; the -// page number will be 1 and the page size will be 30 -// articles. -func (ar *ArticlesResource) ListMyUnpublishedArticles(ctx context.Context, opts *MyArticlesOptions) ([]ListedArticle, error) { - return ar.listMyArticles(ctx, "api/articles/me/unpublished", opts) -} - -// ListAllMyArticles lists all articles written by the user -// authenticated with this client, erroring if the caller is -// not authenticated. Articles in the response will be listed -// in reverse chronological order by their creation times, -// with unpublished articles listed before published articles. -// -// If opts is nil, then no query parameters will be sent; the -// page number will be 1 and the page size will be 30 -// articles. -func (ar *ArticlesResource) ListAllMyArticles(ctx context.Context, opts *MyArticlesOptions) ([]ListedArticle, error) { - return ar.listMyArticles(ctx, "api/articles/me/all", opts) -} - -// listMyArticles serves for handling roundtrips to the -// /api/articles/me/* endpoints, requesting articles from the -// endpoint passed in, and returning a list of articles. -func (ar *ArticlesResource) listMyArticles( - ctx context.Context, - endpoint string, - opts *MyArticlesOptions, -) ([]ListedArticle, error) { - if ar.API.Config.InsecureOnly { - return nil, ErrProtectedEndpoint - } - - req, err := ar.API.NewRequest(http.MethodGet, endpoint, nil) - if err != nil { - return nil, err - } - req.Header.Add(APIKeyHeader, ar.API.Config.APIKey) - - if opts != nil { - q, err := query.Values(opts) - if err != nil { - return nil, err - } - req.URL.RawQuery = q.Encode() - } - - res, err := ar.API.HTTPClient.Do(req) - if err != nil { - return nil, err - } - defer res.Body.Close() - - if nonSuccessfulResponse(res) { - return nil, unmarshalErrorResponse(res) - } - var articles []ListedArticle - if err := json.NewDecoder(res.Body).Decode(&articles); err != nil { - return nil, err - } - return articles, nil -} - -// Find will retrieve an Article matching the ID passed. -func (ar *ArticlesResource) Find(ctx context.Context, id uint32) (Article, error) { - req, err := ar.API.NewRequest(http.MethodGet, fmt.Sprintf("api/articles/%d", id), nil) - if err != nil { - return Article{}, err - } - - res, err := ar.API.HTTPClient.Do(req) - if err != nil { - return Article{}, err - } - defer res.Body.Close() - - if nonSuccessfulResponse(res) { - return Article{}, unmarshalErrorResponse(res) - } - var art Article - if err := json.NewDecoder(res.Body).Decode(&art); err != nil { - return Article{}, err - } - return art, nil -} - -// New will create a new article on dev.to -func (ar *ArticlesResource) New(ctx context.Context, u ArticleUpdate) (Article, error) { - if ar.API.Config.InsecureOnly { - return Article{}, ErrProtectedEndpoint - } - cont, err := json.Marshal(&u) - if err != nil { - return Article{}, err - } - req, err := ar.API.NewRequest(http.MethodPost, "api/articles", strings.NewReader(string(cont))) - if err != nil { - return Article{}, err - } - req.Header.Add(APIKeyHeader, ar.API.Config.APIKey) - res, err := ar.API.HTTPClient.Do(req) - if err != nil { - return Article{}, err - } - defer res.Body.Close() - - if nonSuccessfulResponse(res) { - return Article{}, unmarshalErrorResponse(res) - } - - var a Article - if err := json.NewDecoder(res.Body).Decode(&a); err != nil { - return Article{}, err - } - return a, nil -} - -// Update will mutate the resource by id, and all the changes -// performed to the Article will be applied, thus validation -// on the API side. -func (ar *ArticlesResource) Update(ctx context.Context, u ArticleUpdate, id uint32) (Article, error) { - if ar.API.Config.InsecureOnly { - return Article{}, ErrProtectedEndpoint - } - cont, err := json.Marshal(&u) - if err != nil { - return Article{}, err - } - req, err := ar.API.NewRequest(http.MethodPut, fmt.Sprintf("api/articles/%d", id), strings.NewReader(string(cont))) - if err != nil { - return Article{}, err - } - req.Header.Add(APIKeyHeader, ar.API.Config.APIKey) - res, err := ar.API.HTTPClient.Do(req) - if err != nil { - return Article{}, err - } - defer res.Body.Close() - - if nonSuccessfulResponse(res) { - return Article{}, unmarshalErrorResponse(res) - } - - var a Article - if err := json.NewDecoder(res.Body).Decode(&a); err != nil { - return Article{}, err - } - return a, nil -} diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/config.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/config.go deleted file mode 100644 index 1ca1ed44..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/config.go +++ /dev/null @@ -1,33 +0,0 @@ -package devto - -import "errors" - -// Configuration errors -var ( - ErrMissingRequiredParameter = errors.New("a required parameter is missing") -) - -// Config contains the elements required to initialize a -// devto client. -type Config struct { - APIKey string - InsecureOnly bool -} - -// NewConfig build a devto configuration instance with the -// required parameters. -// -// It takes a boolean (p) as first parameter to indicate if -// you need access to endpoints which require authentication, -// and a API key as second parameter, if p is set to true and -// you don't provide an API key, it will return an error. -func NewConfig(p bool, k string) (c *Config, err error) { - if p == true && k == "" { - return nil, ErrMissingRequiredParameter - } - - return &Config{ - InsecureOnly: !p, - APIKey: k, - }, nil -} diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/devto.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/devto.go deleted file mode 100644 index 3d7a1744..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/devto.go +++ /dev/null @@ -1,84 +0,0 @@ -package devto - -import ( - "context" - "errors" - "io" - "net/http" - "net/url" -) - -//Configuration constants -const ( - BaseURL string = "https://dev.to" - APIVersion string = "0.5.1" - APIKeyHeader string = "api-key" -) - -// devto client errors -var ( - ErrMissingConfig = errors.New("missing configuration") - ErrProtectedEndpoint = errors.New("to use this resource you need to provide an authentication method") -) - -type httpClient interface { - Do(req *http.Request) (res *http.Response, err error) -} - -// Client is the main data structure for performing actions -// against dev.to API -type Client struct { - Context context.Context - BaseURL *url.URL - HTTPClient httpClient - Config *Config - Articles *ArticlesResource -} - -// NewClient takes a context, a configuration pointer and optionally a -// base http client (bc) to build an Client instance. -func NewClient(ctx context.Context, conf *Config, bc httpClient, bu string) (dev *Client, err error) { - if bc == nil { - bc = http.DefaultClient - } - - if ctx == nil { - ctx = context.Background() - } - - if conf == nil { - return nil, ErrMissingConfig - } - - if bu == "" { - bu = BaseURL - } - - u, err := url.Parse(bu) - if err != nil { - return nil, err - } - - c := &Client{ - Context: ctx, - BaseURL: u, - HTTPClient: bc, - Config: conf, - } - c.Articles = &ArticlesResource{API: c} - return c, nil -} - -// NewRequest build the request relative to the client BaseURL -func (c *Client) NewRequest(method string, uri string, body io.Reader) (*http.Request, error) { - u, err := url.Parse(uri) - if err != nil { - return nil, err - } - fu := c.BaseURL.ResolveReference(u).String() - req, err := http.NewRequest(method, fu, body) - if err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/doc.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/doc.go deleted file mode 100644 index 5dd0a63b..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package devto is a wrapper around dev.to REST API -// -// Where programmers share ideas and help each other grow. -// It is an online community for sharing and discovering great ideas, -// having debates, and making friends. Anyone can share articles, -// questions, discussions, etc. as long as they have the rights to the -// words they are sharing. Cross-posting from your own blog is welcome. -// -// See: https://docs.dev.to/api -package devto diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/types.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/types.go deleted file mode 100644 index 0a9b6894..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/types.go +++ /dev/null @@ -1,230 +0,0 @@ -package devto - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" - "time" -) - -// User contains information about a devto account -type User struct { - Name string `json:"name,omitempty"` - Username string `json:"username,omitempty"` - TwitterUsername string `json:"twitter_username,omitempty"` - GithubUsername string `json:"github_username,omitempty"` - WebsiteURL *WebURL `json:"website_url,omitempty"` - ProfileImage *WebURL `json:"profile_image,omitempty"` - ProfileImage90 *WebURL `json:"profile_image_90,omitempty"` -} - -// Organization describes a company or group that -// publishes content to devto. -type Organization struct { - Name string `json:"name,omitempty"` - Username string `json:"username,omitempty"` - Slug string `json:"slug,omitempty"` - ProfileImage *WebURL `json:"profile_image,omitempty"` - ProfileImage90 *WebURL `json:"profile_image_90,omitempty"` -} - -// FlareTag represents an article's flare tag, if the article -// has one. -type FlareTag struct { - Name string `json:"name"` - BGColorHex string `json:"bg_color_hex"` - TextColorHex string `json:"text_color_hex"` -} - -// Tags are a group of topics related to an article -type Tags []string - -// This deserialization logic is so that if a listed article -// originates from the /articles endpoint instead of -// /articles/me/*, its Published field is returned as true, -// since /articles exclusively returns articles that have been -// published. -type listedArticleJSON struct { - TypeOf string `json:"type_of,omitempty"` - ID uint32 `json:"id,omitempty"` - Title string `json:"title,omitempty"` - Description string `json:"description,omitempty"` - CoverImage *WebURL `json:"cover_image,omitempty"` - PublishedAt *time.Time `json:"published_at,omitempty"` - PublishedTimestamp string `json:"published_timestamp,omitempty"` - TagList Tags `json:"tag_list,omitempty"` - Slug string `json:"slug,omitempty"` - Path string `json:"path,omitempty"` - URL *WebURL `json:"url,omitempty"` - CanonicalURL *WebURL `json:"canonical_url,omitempty"` - CommentsCount uint `json:"comments_count,omitempty"` - PositiveReactionsCount uint `json:"positive_reactions_count,omitempty"` - User User `json:"user,omitempty"` - Organization *Organization `json:"organization,omitempty"` - FlareTag *FlareTag `json:"flare_tag,omitempty"` - BodyMarkdown string `json:"body_markdown,omitempty"` - Published *bool `json:"published,omitempty"` -} - -func (j *listedArticleJSON) listedArticle() ListedArticle { - a := ListedArticle{ - TypeOf: j.TypeOf, - ID: j.ID, - Title: j.Title, - Description: j.Description, - CoverImage: j.CoverImage, - PublishedAt: j.PublishedAt, - PublishedTimestamp: j.PublishedTimestamp, - TagList: j.TagList, - Slug: j.Slug, - Path: j.Path, - URL: j.URL, - CanonicalURL: j.CanonicalURL, - CommentsCount: j.CommentsCount, - PositiveReactionsCount: j.PositiveReactionsCount, - User: j.User, - Organization: j.Organization, - FlareTag: j.FlareTag, - BodyMarkdown: j.BodyMarkdown, - } - - if j.Published != nil { - a.Published = *j.Published - } else { - // "published" currently is included in the API - // response for dev.to's /articles/me/* endpoints, - // but not in /articles, so we are setting this - // to true since /articles only returns articles - // that are published. - a.Published = true - } - return a -} - -// ListedArticle represents an article returned from one of -// the list articles endpoints (/articles, /articles/me/*). -type ListedArticle struct { - TypeOf string `json:"type_of,omitempty"` - ID uint32 `json:"id,omitempty"` - Title string `json:"title,omitempty"` - Description string `json:"description,omitempty"` - CoverImage *WebURL `json:"cover_image,omitempty"` - PublishedAt *time.Time `json:"published_at,omitempty"` - PublishedTimestamp string `json:"published_timestamp,omitempty"` - TagList Tags `json:"tag_list,omitempty"` - Slug string `json:"slug,omitempty"` - Path string `json:"path,omitempty"` - URL *WebURL `json:"url,omitempty"` - CanonicalURL *WebURL `json:"canonical_url,omitempty"` - CommentsCount uint `json:"comments_count,omitempty"` - PositiveReactionsCount uint `json:"positive_reactions_count,omitempty"` - User User `json:"user,omitempty"` - Organization *Organization `json:"organization,omitempty"` - FlareTag *FlareTag `json:"flare_tag,omitempty"` - // Only present in "/articles/me/*" endpoints - BodyMarkdown string `json:"body_markdown,omitempty"` - Published bool `json:"published,omitempty"` -} - -// UnmarshalJSON implements the JSON Unmarshaler interface. -func (a *ListedArticle) UnmarshalJSON(b []byte) error { - var j listedArticleJSON - if err := json.Unmarshal(b, &j); err != nil { - return err - } - - *a = j.listedArticle() - return nil -} - -// Article contains all the information related to a single -// information resource from devto. -type Article struct { - TypeOf string `json:"type_of,omitempty"` - ID uint32 `json:"id,omitempty"` - Title string `json:"title,omitempty"` - Description string `json:"description,omitempty"` - CoverImage *WebURL `json:"cover_image,omitempty"` - SocialImage *WebURL `json:"social_image,omitempty"` - ReadablePublishDate string `json:"readable_publish_date"` - Published bool `json:"published,omitempty"` - PublishedAt *time.Time `json:"published_at,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - EditedAt *time.Time `json:"edited_at,omitempty"` - CrossPostedAt *time.Time `json:"crossposted_at,omitempty"` - LastCommentAt *time.Time `json:"last_comment_at,omitempty"` - TagList string `json:"tag_list,omitempty"` - Tags Tags `json:"tags,omitempty"` - Slug string `json:"slug,omitempty"` - Path *WebURL `json:"path,omitempty"` - URL *WebURL `json:"url,omitempty"` - CanonicalURL *WebURL `json:"canonical_url,omitempty"` - CommentsCount uint `json:"comments_count,omitempty"` - PositiveReactionsCount uint `json:"positive_reactions_count,omitempty"` - User User `json:"user,omitempty"` - BodyHTML string `json:"body_html,omitempty"` - BodyMarkdown string `json:"body_markdown,omitempty"` -} - -// ArticleUpdate represents an update to an article; it is -// used as the payload in POST and PUT requests for writing -// articles. -type ArticleUpdate struct { - Title string `json:"title"` - BodyMarkdown string `json:"body_markdown"` - Published bool `json:"published"` - Series *string `json:"series"` - MainImage string `json:"main_image,omitempty"` - CanonicalURL string `json:"canonical_url,omitempty"` - Description string `json:"description,omitempty"` - Tags []string `json:"tags,omitempty"` - OrganizationID int32 `json:"organization_id,omitempty"` -} - -// ArticleListOptions holds the query values to pass as -// query string parameter to the Articles List action. -type ArticleListOptions struct { - Tags string `url:"tag,omitempty"` - Username string `url:"username,omitempty"` - State string `url:"state,omitempty"` - Top string `url:"top,omitempty"` - Page int `url:"page,omitempty"` -} - -// MyArticlesOptions defines pagination options used as query -// params in the dev.to "list my articles" endpoints. -type MyArticlesOptions struct { - Page int `url:"page,omitempty"` - PerPage int `url:"per_page,omitempty"` -} - -// WebURL is a class embed to override default unmarshal -// behavior. -type WebURL struct { - *url.URL -} - -// UnmarshalJSON overrides the default unmarshal behaviour -// for URL -func (s *WebURL) UnmarshalJSON(b []byte) error { - c := string(b) - c = strings.Trim(c, "\"") - uri, err := url.Parse(c) - if err != nil { - return err - } - s.URL = uri - return nil -} - -// ErrorResponse is an error returned from a dev.to API -// endpoint. -type ErrorResponse struct { - ErrorMessage string `json:"error"` - Status int `json:"status"` -} - -func (e *ErrorResponse) Error() string { - return fmt.Sprintf(`%d error: "%s"`, e.Status, e.ErrorMessage) -} diff --git a/vendor/github.com/VictorAvelar/devto-api-go/devto/utilities.go b/vendor/github.com/VictorAvelar/devto-api-go/devto/utilities.go deleted file mode 100644 index e7b72201..00000000 --- a/vendor/github.com/VictorAvelar/devto-api-go/devto/utilities.go +++ /dev/null @@ -1,38 +0,0 @@ -package devto - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" -) - -// nonSuccessfulResponse indicates that the status code for -// the HTTP response passed in was not one of the "success" -// (2XX) status codes -func nonSuccessfulResponse(res *http.Response) bool { return res.StatusCode/100 != 2 } - -// attempt to deserialize the error response; if it succeeds, -// the error will be an ErrorResponse, otherwise it will be -// an error indicating that the error response could not be -// deserialized. -func unmarshalErrorResponse(res *http.Response) error { - var e ErrorResponse - if err := json.NewDecoder(res.Body).Decode(&e); err != nil { - return fmt.Errorf( - `unexpected error deserializing %d response: "%v"`, - res.StatusCode, - err, - ) - } - return &e -} - -func decodeResponse(r *http.Response) []byte { - c, err := ioutil.ReadAll(r.Body) - if err != nil { - return []byte("") - } - defer r.Body.Close() - return c -} diff --git a/vendor/github.com/adlio/trello/.gitignore b/vendor/github.com/adlio/trello/.gitignore deleted file mode 100644 index 431d6df1..00000000 --- a/vendor/github.com/adlio/trello/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -coverage.sh -coverage.out -coverage.html diff --git a/vendor/github.com/adlio/trello/.travis.yml b/vendor/github.com/adlio/trello/.travis.yml deleted file mode 100644 index ff8ee3e3..00000000 --- a/vendor/github.com/adlio/trello/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: go -sudo: false -go: -- 1.7 -- 1.8 -- 1.9 -- '1.10' -- 1.11.x -- master - -install: -- go get github.com/pkg/errors -# golint is no longer available for go versions 1.7 and 1.8 -- | - INSTALLED_GO_VERSION=`go version | sed 's/go version go\(.*\) .*/\1/'` - echo $INSTALLED_GO_VERSION - if [ "$INSTALLED_GO_VERSION" != "1.7" ] && [ "$INSTALLED_GO_VERSION" != "1.8" ]; then - go get golang.org/x/lint/golint - fi - -before_script: -- | - which golint; - if [ $? == 0 ]; then - golint ./... - fi - go vet - -script: -- go test -v -race -coverprofile=coverage.txt -covermode=atomic - -after_success: -- bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/adlio/trello/LICENSE b/vendor/github.com/adlio/trello/LICENSE deleted file mode 100644 index 50bcc92a..00000000 --- a/vendor/github.com/adlio/trello/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Aaron Longwell - -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. diff --git a/vendor/github.com/adlio/trello/README.md b/vendor/github.com/adlio/trello/README.md deleted file mode 100644 index 08bbbf9b..00000000 --- a/vendor/github.com/adlio/trello/README.md +++ /dev/null @@ -1,250 +0,0 @@ -Go Trello API -================ - -[![Trello Logo](https://raw.githubusercontent.com/adlio/trello/master/trello-logo.png)](https://www.trello.com) - -[![GoDoc](https://godoc.org/github.com/adlio/trello?status.svg)](http://godoc.org/github.com/adlio/trello) -[![Build Status](https://travis-ci.org/adlio/trello.svg)](https://travis-ci.org/adlio/trello) -[![Coverage Status](https://coveralls.io/repos/github/adlio/trello/badge.svg?branch=master)](https://coveralls.io/github/adlio/trello?branch=master) - -A #golang package to access the [Trello API](https://developers.trello.com/v1.0/reference). Nearly 100% of the -read-only surface area of the API is covered, as is creation and modification of Cards. -Low-level infrastructure for features to modify Lists and Boards are easy to add... just not -done yet. - -Pull requests are welcome for missing features. - -My current development focus is documentation, especially enhancing this README.md with more -example use cases. - -## Installation - -The Go Trello API has been Tested compatible with Go 1.7 on up. Its only dependency is -the `github.com/pkg/errors` package. It otherwise relies only on the Go standard library. - -``` -go get github.com/adlio/trello -``` - -## Basic Usage - -All interaction starts with a `trello.Client`. Create one with your appKey and token: - -```Go -client := trello.NewClient(appKey, token) -``` - -All API requests accept a trello.Arguments object. This object is a simple -`map[string]string`, converted to query string arguments in the API call. -Trello has sane defaults on API calls. We have a `trello.Defaults()` utility function -which can be used when you desire the default Trello arguments. Internally, -`trello.Defaults()` is an empty map, which translates to an empty query string. - -```Go -board, err := client.GetBoard("bOaRdID", trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Client Longevity - -When getting Lists from Boards or Cards from Lists, the original `trello.Client` pointer -is carried along in returned child objects. It's important to realize that this enables -you to make additional API calls via functions invoked on the objects you receive: - -```Go -client := trello.NewClient(appKey, token) -board, err := client.GetBoard("ID", trello.Defaults()) - -// GetLists makes an API call to /boards/:id/lists using credentials from `client` -lists, err := board.GetLists(trello.Defaults()) - -for _, list := range lists { - // GetCards makes an API call to /lists/:id/cards using credentials from `client` - cards, err := list.GetCards(trello.Defaults()) -} -``` - -## Get Trello Boards for a User - -Boards can be retrieved directly by their ID (see example above), or by asking -for all boards for a member: - -```Go -member, err := client.GetMember("usernameOrId", trello.Defaults()) -if err != nil { - // Handle error -} - -boards, err := member.GetBoards(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Get Trello Lists on a Board - -```Go -board, err := client.GetBoard("bOaRdID", trello.Defaults()) -if err != nil { - // Handle error -} - -lists, err := board.GetLists(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Get Trello Cards on a Board - -```Go -board, err := client.GetBoard("bOaRdID", trello.Defaults()) -if err != nil { - // Handle error -} - -cards, err := board.GetCards(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Get Trello Cards on a List - -```Go -list, err := client.GetList("lIsTID", trello.Defaults()) -if err != nil { - // Handle error -} - -cards, err := list.GetCards(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Creating and deleting a Board - -A board can be created or deleted on the `Board` struct for the user whose credentials are being used. - -```Go - board := trello.NewBoard("My bucket list") - - // POST - err := client.CreateBoard(&board, trello.Defaults()) - - // DELETE - err := board.Delete(trello.Defaults()) - if err != nil { - fmt.Println(err) - } -} -``` - -## Creating a Card - -The API provides several mechanisms for creating new cards. - -### Creating Cards from Scratch on the Client - -This approach requires the most input data on the card: - -```Go -card := trello.Card{ - Name: "Card Name", - Desc: "Card description", - Pos: 12345.678, - IDList: "iDOfaLiSt", - IDLabels: []string{"labelID1", "labelID2"}, -} -err := client.CreateCard(card, trello.Defaults()) -``` - - -### Creating Cards On a List - -```Go -list, err := client.GetList("lIsTID", trello.Defaults()) -list.AddCard(&trello.Card{ Name: "Card Name", Desc: "Card description" }, trello.Defaults()) -``` - -### Creating a Card by Copying Another Card - -```Go -err := card.CopyToList("listIdNUmber", trello.Defaults()) -``` - -## Get Actions on a Board - -```Go -board, err := client.GetBoard("bOaRdID", trello.Defaults()) -if err != nil { - // Handle error -} - -actions, err := board.GetActions(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Get Actions on a Card - -```Go -card, err := client.GetCard("cArDID", trello.Defaults()) -if err != nil { - // Handle error -} - -actions, err := card.GetActions(trello.Defaults()) -if err != nil { - // Handle error -} -``` - -## Rearrange Cards Within a List - -```Go -err := card.MoveToTopOfList() -err = card.MoveToBottomOfList() -err = card.SetPos(12345.6789) -``` - - -## Moving a Card to Another List - -```Go -err := card.MoveToList("listIdNUmber", trello.Defaults()) -``` - - -## Card Ancestry - -Trello provides ancestry tracking when cards are created as copies of other cards. This package -provides functions for working with this data: - -```Go - -// ancestors will hold a slice of *trello.Cards, with the first -// being the card's parent, and the last being parent's parent's parent... -ancestors, err := card.GetAncestorCards(trello.Defaults()) - -// GetOriginatingCard() is an alias for the last element in the slice -// of ancestor cards. -ultimateParentCard, err := card.GetOriginatingCard(trello.Defaults()) - -``` - -## Debug Logging - -If you'd like to see all API calls logged, you can attach a `.Logger` (implementing `Debugf(string, ...interface{})`) -to your client. The interface for the logger mimics logrus. Example usage: - -```Go -logger := logrus.New() -logger.SetLevel(logrus.DebugLevel) -client := trello.NewClient(appKey, token) -client.Logger = logger -``` diff --git a/vendor/github.com/adlio/trello/TODO.txt b/vendor/github.com/adlio/trello/TODO.txt deleted file mode 100644 index c363ff9d..00000000 --- a/vendor/github.com/adlio/trello/TODO.txt +++ /dev/null @@ -1,5 +0,0 @@ -- Create List -- Delete Card -- Archive Card -- Reorder Cards in List - diff --git a/vendor/github.com/adlio/trello/action-collection.go b/vendor/github.com/adlio/trello/action-collection.go deleted file mode 100644 index 3e605a5a..00000000 --- a/vendor/github.com/adlio/trello/action-collection.go +++ /dev/null @@ -1,62 +0,0 @@ -package trello - -import ( - "sort" -) - -// ActionCollection is an alias of []*Action, which sorts by the Action's ID. -// Which is the same as sorting by the Action's time of occurrence -type ActionCollection []*Action - -func (c ActionCollection) Len() int { return len(c) } -func (c ActionCollection) Swap(i, j int) { c[i], c[j] = c[j], c[i] } -func (c ActionCollection) Less(i, j int) bool { return c[i].ID < c[j].ID } - -// FirstCardCreateAction returns first card-create action -func (c ActionCollection) FirstCardCreateAction() *Action { - sort.Sort(c) - for _, action := range c { - if action.DidCreateCard() { - return action - } - } - return nil -} - -// ContainsCardCreation returns true if collection contains a card-create action -func (c ActionCollection) ContainsCardCreation() bool { - return c.FirstCardCreateAction() != nil -} - -// FilterToCardCreationActions returns this collection's card-create actions -func (c ActionCollection) FilterToCardCreationActions() ActionCollection { - newSlice := make(ActionCollection, 0, len(c)) - for _, action := range c { - if action.DidCreateCard() { - newSlice = append(newSlice, action) - } - } - return newSlice -} - -// FilterToListChangeActions returns card-change-list actions -func (c ActionCollection) FilterToListChangeActions() ActionCollection { - newSlice := make(ActionCollection, 0, len(c)) - for _, action := range c { - if action.DidChangeListForCard() { - newSlice = append(newSlice, action) - } - } - return newSlice -} - -// FilterToCardMembershipChangeActions returns the collection's card-change, archive and unarchive actions -func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection { - newSlice := make(ActionCollection, 0, len(c)) - for _, action := range c { - if action.DidChangeCardMembership() || action.DidArchiveCard() || action.DidUnarchiveCard() { - newSlice = append(newSlice, action) - } - } - return newSlice -} diff --git a/vendor/github.com/adlio/trello/action.go b/vendor/github.com/adlio/trello/action.go deleted file mode 100644 index 99e1c0dc..00000000 --- a/vendor/github.com/adlio/trello/action.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" - "time" -) - -// Action represents Trello API actions -// Actions are immutable event traces generated whenever an action occurs in Trello. -// See https://developers.trello.com/reference/#actions. -type Action struct { - ID string `json:"id"` - IDMemberCreator string `json:"idMemberCreator"` - Type string `json:"type"` - Date time.Time `json:"date"` - Data *ActionData `json:"data,omitempty"` - MemberCreator *Member `json:"memberCreator,omitempty"` - Member *Member `json:"member,omitempty"` -} - -// ActionData represent the nested data of actions -type ActionData struct { - Text string `json:"text,omitempty"` - List *List `json:"list,omitempty"` - Card *ActionDataCard `json:"card,omitempty"` - CardSource *ActionDataCard `json:"cardSource,omitempty"` - Board *Board `json:"board,omitempty"` - Old *ActionDataCard `json:"old,omitempty"` - ListBefore *List `json:"listBefore,omitempty"` - ListAfter *List `json:"listAfter,omitempty"` - DateLastEdited time.Time `json:"dateLastEdited"` - - CheckItem *CheckItem `json:"checkItem"` - Checklist *Checklist `json:"checklist"` -} - -// ActionDataCard represent the nested 'card' data attribute of actions -type ActionDataCard struct { - ID string `json:"id"` - Name string `json:"name"` - IDShort int `json:"idShort"` - ShortLink string `json:"shortLink"` - Pos float64 `json:"pos"` - Closed bool `json:"closed"` -} - -// GetActions make a GET call for a board's actions -func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error) { - path := fmt.Sprintf("boards/%s/actions", b.ID) - err = b.client.Get(path, args, &actions) - return -} - -// GetActions makes a GET call for a list's actions -func (l *List) GetActions(args Arguments) (actions ActionCollection, err error) { - path := fmt.Sprintf("lists/%s/actions", l.ID) - err = l.client.Get(path, args, &actions) - return -} - -// GetActions makes a GET for a card's actions -func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error) { - path := fmt.Sprintf("cards/%s/actions", c.ID) - err = c.client.Get(path, args, &actions) - return -} - -// GetListChangeActions retrieves a slice of Actions which resulted in changes -// to the card's active List. This includes the createCard and copyCard action (which -// place the card in its first list), and the updateCard:closed action (which remove it -// from its last list). -// -// This function is just an alias for: -// card.GetActions(Arguments{"filter": "createCard,copyCard,updateCard:idList,updateCard:closed", "limit": "1000"}) -// -func (c *Card) GetListChangeActions() (actions ActionCollection, err error) { - return c.GetActions(Arguments{"filter": "createCard,copyCard,updateCard:idList,updateCard:closed"}) -} - -// GetMembershipChangeActions makes a GET call for a card's membership-change actions -func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error) { - // We include updateCard:closed as if the member is implicitly removed from the card when it's closed. - // This allows us to "close out" the duration length. - return c.GetActions(Arguments{"filter": "addMemberToCard,removeMemberFromCard,updateCard:closed"}) -} - -// DidCreateCard returns true if this action created a card, false otherwise. -func (a *Action) DidCreateCard() bool { - switch a.Type { - case "createCard", "emailCard", "copyCard", "convertToCardFromCheckItem": - return true - case "moveCardToBoard": - return true // Unsure about this one - default: - return false - } -} - -// DidArchiveCard returns true if the card was updated -func (a *Action) DidArchiveCard() bool { - return (a.Type == "updateCard") && a.Data != nil && a.Data.Card != nil && a.Data.Card.Closed -} - -// DidUnarchiveCard returns true if the card was unarchived -func (a *Action) DidUnarchiveCard() bool { - return (a.Type == "updateCard") && a.Data != nil && a.Data.Old != nil && a.Data.Old.Closed -} - -// DidChangeListForCard returns true if this action created the card (in which case it -// caused it to enter its first list), archived the card (in which case it caused it to -// leave its last List), or was an updateCard action involving a change to the list. This -// is supporting functionality for ListDuration. -// -func (a *Action) DidChangeListForCard() bool { - if a.DidCreateCard() { - return true - } - if a.DidArchiveCard() { - return true - } - if a.DidUnarchiveCard() { - return true - } - if a.Type == "updateCard" { - if a.Data != nil && a.Data.ListAfter != nil { - return true - } - } - return false -} - -// DidChangeCardMembership returns true if card's membership was changed -func (a *Action) DidChangeCardMembership() bool { - switch a.Type { - case "addMemberToCard": - return true - case "removeMemberFromCard": - return true - default: - return false - } -} - -// ListAfterAction calculates which List the card ended up in after this action -// completed. Returns nil when the action resulted in the card being archived (in -// which case we consider it to not be in a list anymore), or when the action isn't -// related to a list at all (in which case this is a nonsensical question to ask). -// -func ListAfterAction(a *Action) *List { - switch a.Type { - case "createCard", "copyCard", "emailCard", "convertToCardFromCheckItem": - return a.Data.List - case "updateCard": - if a.DidArchiveCard() { - return nil - } else if a.DidUnarchiveCard() { - return a.Data.List - } - if a.Data.ListAfter != nil { - return a.Data.ListAfter - } - } - return nil -} diff --git a/vendor/github.com/adlio/trello/arguments.go b/vendor/github.com/adlio/trello/arguments.go deleted file mode 100644 index ba5428a5..00000000 --- a/vendor/github.com/adlio/trello/arguments.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "net/url" -) - -// Arguments are used for passing URL parameters to the client for making API calls. -type Arguments map[string]string - -// Defaults is a constructor for default Arguments. -func Defaults() Arguments { - return make(Arguments) -} - -// ToURLValues returns the argument's URL value representation. -func (args Arguments) ToURLValues() url.Values { - v := url.Values{} - for key, value := range args { - v.Set(key, value) - } - return v -} diff --git a/vendor/github.com/adlio/trello/attachment.go b/vendor/github.com/adlio/trello/attachment.go deleted file mode 100644 index b4e3e8d1..00000000 --- a/vendor/github.com/adlio/trello/attachment.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -// Attachment represent the attachments of cards. This is a nested resource of Card. -// https://developers.trello.com/reference/#attachments -type Attachment struct { - ID string `json:"id"` - Name string `json:"name"` - Pos float32 `json:"pos"` - Bytes int `json:"int"` - Date string `json:"date"` - EdgeColor string `json:"edgeColor"` - IDMember string `json:"idMember"` - IsUpload bool `json:"isUpload"` - MimeType string `json:"mimeType"` - Previews []AttachmentPreview `json:"previews"` - URL string `json:"url"` -} - -// AttachmentPreview is a nested attribute of Attachment. -type AttachmentPreview struct { - ID string `json:"_id"` - URL string `json:"url"` - Width int `json:"width"` - Height int `json:"height"` - Bytes int `json:"bytes"` - Scaled bool `json:"scaled"` -} diff --git a/vendor/github.com/adlio/trello/board.go b/vendor/github.com/adlio/trello/board.go deleted file mode 100644 index 66a4067e..00000000 --- a/vendor/github.com/adlio/trello/board.go +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" - "time" -) - -// Board represents a Trello Board. -// https://developers.trello.com/reference/#boardsid -type Board struct { - client *Client - ID string `json:"id"` - Name string `json:"name"` - Desc string `json:"desc"` - Closed bool `json:"closed"` - IDOrganization string `json:"idOrganization"` - Pinned bool `json:"pinned"` - Starred bool `json:"starred"` - URL string `json:"url"` - ShortURL string `json:"shortUrl"` - Prefs struct { - PermissionLevel string `json:"permissionLevel"` - Voting string `json:"voting"` - Comments string `json:"comments"` - Invitations string `json:"invitations"` - SelfJoin bool `json:"selfjoin"` - CardCovers bool `json:"cardCovers"` - CardAging string `json:"cardAging"` - CalendarFeedEnabled bool `json:"calendarFeedEnabled"` - Background string `json:"background"` - BackgroundColor string `json:"backgroundColor"` - BackgroundImage string `json:"backgroundImage"` - BackgroundImageScaled []BackgroundImage `json:"backgroundImageScaled"` - BackgroundTile bool `json:"backgroundTile"` - BackgroundBrightness string `json:"backgroundBrightness"` - CanBePublic bool `json:"canBePublic"` - CanBeOrg bool `json:"canBeOrg"` - CanBePrivate bool `json:"canBePrivate"` - CanInvite bool `json:"canInvite"` - } `json:"prefs"` - Subscribed bool `json:"subscribed"` - LabelNames struct { - Black string `json:"black,omitempty"` - Blue string `json:"blue,omitempty"` - Green string `json:"green,omitempty"` - Lime string `json:"lime,omitempty"` - Orange string `json:"orange,omitempty"` - Pink string `json:"pink,omitempty"` - Purple string `json:"purple,omitempty"` - Red string `json:"red,omitempty"` - Sky string `json:"sky,omitempty"` - Yellow string `json:"yellow,omitempty"` - } `json:"labelNames"` - Lists []*List `json:"lists"` - Actions []*Action `json:"actions"` - Organization Organization `json:"organization"` -} - -// NewBoard is a constructor that sets the default values -// for Prefs.SelfJoin and Prefs.CardCovers also set by the API. -func NewBoard(name string) Board { - b := Board{Name: name} - - // default values in line with API POST - b.Prefs.SelfJoin = true - b.Prefs.CardCovers = true - - return b -} - -// BackgroundImage is a nested resource of Board. -type BackgroundImage struct { - Width int `json:"width"` - Height int `json:"height"` - URL string `json:"url"` -} - -// CreatedAt returns a board's created-at attribute as time.Time. -func (b *Board) CreatedAt() time.Time { - t, _ := IDToTime(b.ID) - return t -} - -// CreateBoard creates a board remote. -// Attribute currently supported as exra argument: defaultLists, powerUps. -// Attributes currently known to be unsupported: idBoardSource, keepFromSource. -// -// API Docs: https://developers.trello.com/reference/#boardsid -func (c *Client) CreateBoard(board *Board, extraArgs Arguments) error { - path := "boards" - args := Arguments{ - "desc": board.Desc, - "name": board.Name, - "prefs_selfJoin": fmt.Sprintf("%t", board.Prefs.SelfJoin), - "prefs_cardCovers": fmt.Sprintf("%t", board.Prefs.CardCovers), - "idOrganization": board.IDOrganization, - } - - if board.Prefs.Voting != "" { - args["prefs_voting"] = board.Prefs.Voting - } - if board.Prefs.PermissionLevel != "" { - args["prefs_permissionLevel"] = board.Prefs.PermissionLevel - } - if board.Prefs.Comments != "" { - args["prefs_comments"] = board.Prefs.Comments - } - if board.Prefs.Invitations != "" { - args["prefs_invitations"] = board.Prefs.Invitations - } - if board.Prefs.Background != "" { - args["prefs_background"] = board.Prefs.Background - } - if board.Prefs.CardAging != "" { - args["prefs_cardAging"] = board.Prefs.CardAging - } - - // Expects "true" or "false" - if defaultLists, ok := extraArgs["defaultLists"]; ok { - args["defaultLists"] = defaultLists - } - // Expects one of "all", "calendar", "cardAging", "recap", or "voting". - if powerUps, ok := extraArgs["powerUps"]; ok { - args["powerUps"] = powerUps - } - - err := c.Post(path, args, &board) - if err == nil { - board.client = c - } - return err -} - -// Update PUTs the supported board attributes remote and updates -// the struct from the returned values. -func (b *Board) Update(extraArgs Arguments) error { - return b.client.PutBoard(b, extraArgs) -} - -// Delete makes a DELETE call for the receiver Board. -func (b *Board) Delete(extraArgs Arguments) error { - path := fmt.Sprintf("boards/%s", b.ID) - return b.client.Delete(path, Arguments{}, b) -} - -// GetBoard retrieves a Trello board by its ID. -func (c *Client) GetBoard(boardID string, args Arguments) (board *Board, err error) { - path := fmt.Sprintf("boards/%s", boardID) - err = c.Get(path, args, &board) - if board != nil { - board.client = c - } - return -} - -// GetMyBoards returns a slice of all boards associated with the credentials set on the client. -func (c *Client) GetMyBoards(args Arguments) (boards []*Board, err error) { - path := "members/me/boards" - err = c.Get(path, args, &boards) - for i := range boards { - boards[i].client = c - } - return -} - -// GetBoards returns a slice of all public boards of the receiver Member. -func (m *Member) GetBoards(args Arguments) (boards []*Board, err error) { - path := fmt.Sprintf("members/%s/boards", m.ID) - err = m.client.Get(path, args, &boards) - for i := range boards { - boards[i].client = m.client - - for j := range boards[i].Lists { - boards[i].Lists[j].client = m.client - } - } - return -} - -// PutBoard PUTs a board remote. Extra arguments are currently unsupported. -// -// API Docs: https://developers.trello.com/reference#idnext -func (c *Client) PutBoard(board *Board, extraArgs Arguments) error { - path := fmt.Sprintf("boards/%s", board.ID) - args := Arguments{ - "desc": board.Desc, - "name": board.Name, - "prefs/selfJoin": fmt.Sprintf("%t", board.Prefs.SelfJoin), - "prefs/cardCovers": fmt.Sprintf("%t", board.Prefs.CardCovers), - "idOrganization": board.IDOrganization, - } - - if board.Prefs.Voting != "" { - args["prefs/voting"] = board.Prefs.Voting - } - if board.Prefs.PermissionLevel != "" { - args["prefs/permissionLevel"] = board.Prefs.PermissionLevel - } - if board.Prefs.Comments != "" { - args["prefs/comments"] = board.Prefs.Comments - } - if board.Prefs.Invitations != "" { - args["prefs/invitations"] = board.Prefs.Invitations - } - if board.Prefs.Background != "" { - args["prefs/background"] = board.Prefs.Background - } - if board.Prefs.CardAging != "" { - args["prefs/cardAging"] = board.Prefs.CardAging - } - - err := c.Put(path, args, &board) - if err == nil { - board.client = c - } - return err -} diff --git a/vendor/github.com/adlio/trello/card.go b/vendor/github.com/adlio/trello/card.go deleted file mode 100644 index a6fa0c8f..00000000 --- a/vendor/github.com/adlio/trello/card.go +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" - "strconv" - "strings" - "time" - - "github.com/pkg/errors" -) - -// Card represents the card resource. -// https://developers.trello.com/reference/#card-object -type Card struct { - client *Client - - // Key metadata - ID string `json:"id"` - IDShort int `json:"idShort"` - Name string `json:"name"` - Pos float64 `json:"pos"` - Email string `json:"email"` - ShortLink string `json:"shortLink"` - ShortURL string `json:"shortUrl"` - URL string `json:"url"` - Desc string `json:"desc"` - Due *time.Time `json:"due"` - DueComplete bool `json:"dueComplete"` - Closed bool `json:"closed"` - Subscribed bool `json:"subscribed"` - DateLastActivity *time.Time `json:"dateLastActivity"` - - // Board - Board *Board - IDBoard string `json:"idBoard"` - - // List - List *List - IDList string `json:"idList"` - - // Badges - Badges struct { - Votes int `json:"votes"` - ViewingMemberVoted bool `json:"viewingMemberVoted"` - Subscribed bool `json:"subscribed"` - Fogbugz string `json:"fogbugz,omitempty"` - CheckItems int `json:"checkItems"` - CheckItemsChecked int `json:"checkItemsChecked"` - Comments int `json:"comments"` - Attachments int `json:"attachments"` - Description bool `json:"description"` - Due *time.Time `json:"due,omitempty"` - } `json:"badges"` - - // Actions - Actions ActionCollection `json:"actions,omitempty"` - - // Checklists - IDCheckLists []string `json:"idCheckLists"` - Checklists []*Checklist `json:"checklists,omitempty"` - CheckItemStates []*CheckItemState `json:"checkItemStates,omitempty"` - - // Members - IDMembers []string `json:"idMembers,omitempty"` - IDMembersVoted []string `json:"idMembersVoted,omitempty"` - Members []*Member `json:"members,omitempty"` - - // Attachments - IDAttachmentCover string `json:"idAttachmentCover"` - ManualCoverAttachment bool `json:"manualCoverAttachment"` - Attachments []*Attachment `json:"attachments,omitempty"` - - // Labels - IDLabels []string `json:"idLabels,omitempty"` - Labels []*Label `json:"labels,omitempty"` - - // Custom Fields - CustomFieldItems []*CustomFieldItem `json:"customFieldItems,omitempty"` - - customFieldMap *map[string]interface{} -} - -// CreatedAt returns the receiver card's created-at attribute as time.Time. -func (c *Card) CreatedAt() time.Time { - t, _ := IDToTime(c.ID) - return t -} - - -// CustomFields returns the card's custom fields. -func (c *Card) CustomFields(boardCustomFields []*CustomField) map[string]interface{} { - - cfm := c.customFieldMap - - if cfm == nil { - cfm = &(map[string]interface{}{}) - - // bcfNames[CustomFieldItem ID] = Custom Field Name - bcfNames := map[string]string{} - - // bcfOptionsMap[CustomField ID][ID of the option] = Value of the option - bcfOptionsMap := map[string]map[string]interface{}{} - - for _, bcf := range boardCustomFields { - bcfNames[bcf.ID] = bcf.Name - - //Options for Dropbox field - for _, cf := range bcf.Options { - // create 2nd level map when not available yet - map2, ok := bcfOptionsMap[cf.IDCustomField] - if !ok { - map2 = map[string]interface{}{} - bcfOptionsMap[bcf.ID] = map2 - } - - bcfOptionsMap[bcf.ID][cf.ID] = cf.Value.Text - } - } - - for _, cf := range c.CustomFieldItems { - if name, ok := bcfNames[cf.IDCustomField]; ok { - if cf.Value.Get() != nil { - (*cfm)[name] = cf.Value.Get() - } else { // Dropbox - // create 2nd level map when not available yet - map2, ok := bcfOptionsMap[cf.IDCustomField] - if !ok { - continue - } - value, ok := map2[cf.IDValue] - - if ok { - (*cfm)[name] = value - } - } - } - } - } - return *cfm -} - -// MoveToList moves a card to a list given by listID. -func (c *Card) MoveToList(listID string, args Arguments) error { - path := fmt.Sprintf("cards/%s", c.ID) - args["idList"] = listID - return c.client.Put(path, args, &c) -} - -// SetPos sets a card's new position. -func (c *Card) SetPos(newPos float64) error { - path := fmt.Sprintf("cards/%s", c.ID) - return c.client.Put(path, Arguments{"pos": fmt.Sprintf("%f", newPos)}, c) -} - -// RemoveMember receives the id of a member and removes the corresponding member from the card. -func (c *Card) RemoveMember(memberID string) error { - path := fmt.Sprintf("cards/%s/idMembers/%s", c.ID, memberID) - return c.client.Delete(path, Defaults(), nil) -} - -// AddMemberID receives a member id and adds the corresponding member to the card. -// Returns a list of the card's members or an error. -func (c *Card) AddMemberID(memberID string) (member []*Member, err error) { - path := fmt.Sprintf("cards/%s/idMembers", c.ID) - err = c.client.Post(path, Arguments{"value": memberID}, &member) - return member, err -} - -// RemoveIDLabel removes a label id from the card. -func (c *Card) RemoveIDLabel(labelID string, label *Label) error { - path := fmt.Sprintf("cards/%s/idLabels/%s", c.ID, labelID) - return c.client.Delete(path, Defaults(), label) - -} - -// AddIDLabel receives a label id and adds the corresponding label or returns an error. -func (c *Card) AddIDLabel(labelID string) error { - path := fmt.Sprintf("cards/%s/idLabels", c.ID) - err := c.client.Post(path, Arguments{"value": labelID}, &c.IDLabels) - return err -} - -// MoveToTopOfList moves the card to the top of it's list. -func (c *Card) MoveToTopOfList() error { - path := fmt.Sprintf("cards/%s", c.ID) - return c.client.Put(path, Arguments{"pos": "top"}, c) -} - -// MoveToBottomOfList moves the card to the bottom of its list. -func (c *Card) MoveToBottomOfList() error { - path := fmt.Sprintf("cards/%s", c.ID) - return c.client.Put(path, Arguments{"pos": "bottom"}, c) -} - -// Update UPDATEs the card's attributes. -func (c *Card) Update(args Arguments) error { - path := fmt.Sprintf("cards/%s", c.ID) - return c.client.Put(path, args, c) -} - -// CreateCard takes a Card and Arguments and POSTs the card. -func (c *Client) CreateCard(card *Card, extraArgs Arguments) error { - path := "cards" - args := Arguments{ - "name": card.Name, - "desc": card.Desc, - "pos": strconv.FormatFloat(card.Pos, 'g', -1, 64), - "idList": card.IDList, - "idMembers": strings.Join(card.IDMembers, ","), - "idLabels": strings.Join(card.IDLabels, ","), - } - if card.Due != nil { - args["due"] = card.Due.Format(time.RFC3339) - } - // Allow overriding the creation position with 'top' or 'botttom' - if pos, ok := extraArgs["pos"]; ok { - args["pos"] = pos - } - err := c.Post(path, args, &card) - if err == nil { - card.client = c - } - return err -} - -// AddCard takes a Card and Arguments and adds the card to the receiver list. -func (l *List) AddCard(card *Card, extraArgs Arguments) error { - path := fmt.Sprintf("lists/%s/cards", l.ID) - args := Arguments{ - "name": card.Name, - "desc": card.Desc, - "idMembers": strings.Join(card.IDMembers, ","), - "idLabels": strings.Join(card.IDLabels, ","), - } - if card.Due != nil { - args["due"] = card.Due.Format(time.RFC3339) - } - // Allow overwriting the creation position with 'top' or 'bottom' - if pos, ok := extraArgs["pos"]; ok { - args["pos"] = pos - } - err := l.client.Post(path, args, &card) - if err == nil { - card.client = l.client - } else { - err = errors.Wrapf(err, "Error adding card to list %s", l.ID) - } - return err -} - -// CopyToList takes a list id and Arguments and returns the matching Card. -// The following Arguments are supported. -// -// Arguments["keepFromSource"] = "all" -// Arguments["keepFromSource"] = "none" -// Arguments["keepFromSource"] = "attachments,checklists,comments" -func (c *Card) CopyToList(listID string, args Arguments) (*Card, error) { - path := "cards" - args["idList"] = listID - args["idCardSource"] = c.ID - newCard := Card{} - err := c.client.Post(path, args, &newCard) - if err == nil { - newCard.client = c.client - } else { - err = errors.Wrapf(err, "Error copying card '%s' to list '%s'.", c.ID, listID) - } - return &newCard, err -} - -// AddComment takes a comment string and Arguments and adds the comment to the card. -func (c *Card) AddComment(comment string, args Arguments) (*Action, error) { - path := fmt.Sprintf("cards/%s/actions/comments", c.ID) - args["text"] = comment - action := Action{} - err := c.client.Post(path, args, &action) - if err != nil { - err = errors.Wrapf(err, "Error commenting on card %s", c.ID) - } - return &action, err -} - -// AddURLAttachment takes an Attachment and adds it to the card. -func (c *Card) AddURLAttachment(attachment *Attachment) error { - path := fmt.Sprintf("cards/%s/attachments", c.ID) - args := Arguments{ - "url": attachment.URL, - "name": attachment.Name, - } - err := c.client.Post(path, args, &attachment) - if err != nil { - err = errors.Wrapf(err, "Error adding attachment to card %s", c.ID) - } - return err - -} - -// GetParentCard retrieves the originating Card if the Card was created -// from a copy of another Card. Returns an error only when a low-level failure occurred. -// If this Card has no parent, a nil card and nil error are returned. In other words, the -// non-existence of a parent is not treated as an error. -func (c *Card) GetParentCard(args Arguments) (*Card, error) { - - // Hopefully the card came pre-loaded with Actions including the card creation - action := c.Actions.FirstCardCreateAction() - - if action == nil { - // No luck. Go get copyCard actions for this card. - c.client.log("Creation action wasn't supplied before GetParentCard() on '%s'. Getting copyCard actions.", c.ID) - actions, err := c.GetActions(Arguments{"filter": "copyCard"}) - if err != nil { - err = errors.Wrapf(err, "GetParentCard() failed to GetActions() for card '%s'", c.ID) - return nil, err - } - action = actions.FirstCardCreateAction() - } - - if action != nil && action.Data != nil && action.Data.CardSource != nil { - card, err := c.client.GetCard(action.Data.CardSource.ID, args) - return card, err - } - - return nil, nil -} - -// GetAncestorCards takes Arguments, GETs the card's ancestors and returns them as a slice. -func (c *Card) GetAncestorCards(args Arguments) (ancestors []*Card, err error) { - - // Get the first parent - parent, err := c.GetParentCard(args) - if IsNotFound(err) || IsPermissionDenied(err) { - c.client.log("[trello] Can't get details about the parent of card '%s' due to lack of permissions or card deleted.", c.ID) - return ancestors, nil - } - - for parent != nil { - ancestors = append(ancestors, parent) - parent, err = parent.GetParentCard(args) - if IsNotFound(err) || IsPermissionDenied(err) { - c.client.log("[trello] Can't get details about the parent of card '%s' due to lack of permissions or card deleted.", c.ID) - return ancestors, nil - } else if err != nil { - return ancestors, err - } - } - - return ancestors, err -} - -// GetOriginatingCard takes Arguments, GETs ancestors and returns most recent ancestor card of the Card. -func (c *Card) GetOriginatingCard(args Arguments) (*Card, error) { - ancestors, err := c.GetAncestorCards(args) - if err != nil { - return c, err - } - if len(ancestors) > 0 { - return ancestors[len(ancestors)-1], nil - } - - return c, nil -} - -// CreatorMember returns the member of the card who created it or and error. -// The creator is the member who is associated with the card's first action. -func (c *Card) CreatorMember() (*Member, error) { - var actions ActionCollection - var err error - - if len(c.Actions) == 0 { - c.Actions, err = c.GetActions(Arguments{"filter": "all", "limit": "1000", "memberCreator_fields": "all"}) - if err != nil { - err = errors.Wrapf(err, "GetActions() call failed.") - return nil, err - } - } - actions = c.Actions.FilterToCardCreationActions() - - if len(actions) > 0 { - return actions[0].MemberCreator, nil - } - return nil, errors.Errorf("No card creation actions on Card %s with a .MemberCreator", c.ID) -} - -// CreatorMemberID returns as string the id of the member who created the card or an error. -// The creator is the member who is associated with the card's first action. -func (c *Card) CreatorMemberID() (string, error) { - - var actions ActionCollection - var err error - - if len(c.Actions) == 0 { - c.client.log("[trello] CreatorMemberID() called on card '%s' without any Card.Actions. Fetching fresh.", c.ID) - c.Actions, err = c.GetActions(Defaults()) - if err != nil { - err = errors.Wrapf(err, "GetActions() call failed.") - } - } - actions = c.Actions.FilterToCardCreationActions() - - if len(actions) > 0 { - if actions[0].IDMemberCreator != "" { - return actions[0].IDMemberCreator, err - } - } - - return "", errors.Wrapf(err, "No Actions on card '%s' could be used to find its creator.", c.ID) -} - -// ContainsCopyOfCard accepts a card id and Arguments and returns true -// if the receiver Board contains a Card with the id. -func (b *Board) ContainsCopyOfCard(cardID string, args Arguments) (bool, error) { - args["filter"] = "copyCard" - actions, err := b.GetActions(args) - if err != nil { - err := errors.Wrapf(err, "GetCards() failed inside ContainsCopyOf() for board '%s' and card '%s'.", b.ID, cardID) - return false, err - } - for _, action := range actions { - if action.Data != nil && action.Data.CardSource != nil && action.Data.CardSource.ID == cardID { - return true, nil - } - } - return false, nil -} - -// GetCard receives a card id and Arguments and returns the card if found -// with the credentials given for the receiver Client. Returns an error -// otherwise. -func (c *Client) GetCard(cardID string, args Arguments) (card *Card, err error) { - path := fmt.Sprintf("cards/%s", cardID) - err = c.Get(path, args, &card) - if card != nil { - card.client = c - } - return card, err -} - -// GetCards takes Arguments and retrieves all Cards on a Board as slice or returns error. -func (b *Board) GetCards(args Arguments) (cards []*Card, err error) { - path := fmt.Sprintf("boards/%s/cards", b.ID) - - err = b.client.Get(path, args, &cards) - - // Naive implementation would return here. To make sure we get all - // cards, we begin - if len(cards) > 0 { - moreCards := true - for moreCards == true { - nextCardBatch := make([]*Card, 0) - args["before"] = earliestCardID(cards) - err = b.client.Get(path, args, &nextCardBatch) - if len(nextCardBatch) > 0 { - cards = append(cards, nextCardBatch...) - } else { - moreCards = false - } - } - } - - for i := range cards { - cards[i].client = b.client - } - - return -} - -// GetCards retrieves all Cards in a List or an error if something goes wrong. -func (l *List) GetCards(args Arguments) (cards []*Card, err error) { - path := fmt.Sprintf("lists/%s/cards", l.ID) - err = l.client.Get(path, args, &cards) - for i := range cards { - cards[i].client = l.client - } - return -} - -func earliestCardID(cards []*Card) string { - if len(cards) == 0 { - return "" - } - earliest := cards[0].ID - for _, card := range cards { - if card.ID < earliest { - earliest = card.ID - } - } - return earliest -} diff --git a/vendor/github.com/adlio/trello/checklist.go b/vendor/github.com/adlio/trello/checklist.go deleted file mode 100644 index 25be5212..00000000 --- a/vendor/github.com/adlio/trello/checklist.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -// Checklist represents Trello card's checklists. -// A card can have one zero or more checklists. -// https://developers.trello.com/reference/#checklist-object -type Checklist struct { - ID string `json:"id"` - Name string `json:"name"` - IDBoard string `json:"idBoard,omitempty"` - IDCard string `json:"idCard,omitempty"` - Pos float64 `json:"pos,omitempty"` - CheckItems []CheckItem `json:"checkItems,omitempty"` - client *Client -} - -// CheckItem is a nested resource representing an item in Checklist. -type CheckItem struct { - ID string `json:"id"` - Name string `json:"name"` - State string `json:"state"` - IDChecklist string `json:"idChecklist,omitempty"` - Pos float64 `json:"pos,omitempty"` -} - -// CheckItemState represents a CheckItem when it appears in CheckItemStates on a Card. -type CheckItemState struct { - IDCheckItem string `json:"idCheckItem"` - State string `json:"state"` -} - -// CreateChecklist creates a checklist. -// Attribute currently supported as extra argument: pos. -// Attributes currently known to be unsupported: idChecklistSource. -// -// API Docs: https://developers.trello.com/reference#cardsidchecklists-1 -func (c *Client) CreateChecklist(card *Card, name string, extraArgs Arguments) (checklist *Checklist, err error) { - path := "cards/" + card.ID + "/checklists" - args := Arguments{ - "name": name, - "pos": "bottom", - } - - if pos, ok := extraArgs["pos"]; ok{ - args["pos"] = pos - } - - checklist = &Checklist{} - err = c.Post(path, args, &checklist) - if err == nil { - checklist.client = c - checklist.IDCard = card.ID - card.Checklists = append(card.Checklists, checklist) - } - return -} - -// CreateCheckItem creates a checkitem inside the checklist. -// Attribute currently supported as extra argument: pos. -// Attributes currently known to be unsupported: checked. -// -// API Docs: https://developers.trello.com/reference#checklistsidcheckitems -func (cl *Checklist) CreateCheckItem(name string, extraArgs Arguments) (item *CheckItem, err error) { - return cl.client.CreateCheckItem(cl, name, extraArgs) -} - -// CreateCheckItem creates a checkitem inside the given checklist. -// Attribute currently supported as extra argument: pos. -// Attributes currently known to be unsupported: checked. -// -// API Docs: https://developers.trello.com/reference#checklistsidcheckitems -func (c *Client) CreateCheckItem(checklist *Checklist, name string, extraArgs Arguments) (item *CheckItem, err error) { - path := "checklists/" + checklist.ID + "/checkItems" - args := Arguments { - "name": name, - "pos": "bottom", - "checked": "false", - } - - if pos, ok := extraArgs["pos"]; ok{ - args["pos"] = pos - } - if checked, ok := extraArgs["checked"]; ok { - args["checked"] = checked - } - - item = &CheckItem{} - err = c.Post(path, args, item) - if err == nil { - checklist.CheckItems = append(checklist.CheckItems, *item) - } - return -} diff --git a/vendor/github.com/adlio/trello/client.go b/vendor/github.com/adlio/trello/client.go deleted file mode 100644 index 42068717..00000000 --- a/vendor/github.com/adlio/trello/client.go +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "time" - - "github.com/pkg/errors" -) - -// DefaultBaseURL is the default API base url used by Client to send requests to Trello. -const DefaultBaseURL = "https://api.trello.com/1" - -// Client is the central object for making API calls. It wraps a http client, -// context, logger and identity configuration (Key and Token) of the Trello member. -type Client struct { - Client *http.Client - Logger logger - BaseURL string - Key string - Token string - throttle <-chan time.Time - testMode bool - ctx context.Context -} - -type logger interface { - Debugf(string, ...interface{}) -} - -// NewClient is a constructor for the Client. It takes the key and token credentials -// of a Trello member to authenticate and authorise requests with. -func NewClient(key, token string) *Client { - return &Client{ - Client: http.DefaultClient, - BaseURL: DefaultBaseURL, - Key: key, - Token: token, - throttle: time.Tick(time.Second / 8), // Actually 10/second, but we're extra cautious - testMode: false, - ctx: context.Background(), - } -} - -// WithContext takes a context.Context, sets it as context on the client and returns -// a Client pointer. -func (c *Client) WithContext(ctx context.Context) *Client { - newC := *c - newC.ctx = ctx - return &newC -} - -// Throttle starts receiving throttles from throttle channel each ticker period. -func (c *Client) Throttle() { - if !c.testMode { - <-c.throttle - } -} - -// Get takes a path, Arguments, and a target interface (e.g. Board or Card). -// It runs a GET request on the Trello API endpoint and the path and uses the -// Arguments as URL parameters. Then it returns either the target interface -// updated from the response or an error. -func (c *Client) Get(path string, args Arguments, target interface{}) error { - - // Trello prohibits more than 10 seconds/second per token - c.Throttle() - - params := args.ToURLValues() - c.log("[trello] GET %s?%s", path, params.Encode()) - - if c.Key != "" { - params.Set("key", c.Key) - } - - if c.Token != "" { - params.Set("token", c.Token) - } - - url := fmt.Sprintf("%s/%s", c.BaseURL, path) - urlWithParams := fmt.Sprintf("%s?%s", url, params.Encode()) - - req, err := http.NewRequest("GET", urlWithParams, nil) - if err != nil { - return errors.Wrapf(err, "Invalid GET request %s", url) - } - req = req.WithContext(c.ctx) - - return c.do(req, url, target) -} - -// Put takes a path, Arguments, and a target interface (e.g. Board or Card). -// It runs a PUT request on the Trello API endpoint with the path and uses -// the Arguments as URL parameters. Then it returns either the target interface -// updated from the response or an error. -func (c *Client) Put(path string, args Arguments, target interface{}) error { - - // Trello prohibits more than 10 seconds/second per token - c.Throttle() - - params := args.ToURLValues() - c.log("[trello] PUT %s?%s", path, params.Encode()) - - if c.Key != "" { - params.Set("key", c.Key) - } - - if c.Token != "" { - params.Set("token", c.Token) - } - - url := fmt.Sprintf("%s/%s", c.BaseURL, path) - urlWithParams := fmt.Sprintf("%s?%s", url, params.Encode()) - - req, err := http.NewRequest("PUT", urlWithParams, nil) - if err != nil { - return errors.Wrapf(err, "Invalid PUT request %s", url) - } - - return c.do(req, url, target) -} - -// Post takes a path, Arguments, and a target interface (e.g. Board or Card). -// It runs a POST request on the Trello API endpoint with the path and uses -// the Arguments as URL parameters. Then it returns either the target interface -// updated from the response or an error. -func (c *Client) Post(path string, args Arguments, target interface{}) error { - - // Trello prohibits more than 10 seconds/second per token - c.Throttle() - - params := args.ToURLValues() - c.log("[trello] POST %s?%s", path, params.Encode()) - - if c.Key != "" { - params.Set("key", c.Key) - } - - if c.Token != "" { - params.Set("token", c.Token) - } - - url := fmt.Sprintf("%s/%s", c.BaseURL, path) - urlWithParams := fmt.Sprintf("%s?%s", url, params.Encode()) - - req, err := http.NewRequest("POST", urlWithParams, nil) - if err != nil { - return errors.Wrapf(err, "Invalid POST request %s", url) - } - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - return c.do(req, url, target) -} - -// Delete takes a path, Arguments, and a target interface (e.g. Board or Card). -// It runs a DELETE request on the Trello API endpoint with the path and uses -// the Arguments as URL parameters. Then it returns either the target interface -// updated from the response or an error. -func (c *Client) Delete(path string, args Arguments, target interface{}) error { - - c.Throttle() - - params := args.ToURLValues() - c.log("[trello] DELETE %s?%s", path, params.Encode()) - - if c.Key != "" { - params.Set("key", c.Key) - } - - if c.Token != "" { - params.Set("token", c.Token) - } - - url := fmt.Sprintf("%s/%s", c.BaseURL, path) - urlWithParams := fmt.Sprintf("%s?%s", url, params.Encode()) - - req, err := http.NewRequest("DELETE", urlWithParams, nil) - if err != nil { - return errors.Wrapf(err, "Invalid DELETE request %s", url) - } - - return c.do(req, url, target) -} - -func (c *Client) log(format string, args ...interface{}) { - if c.Logger != nil { - c.Logger.Debugf(format, args...) - } -} - -func (c *Client) do(req *http.Request, url string, target interface{}) error { - resp, err := c.Client.Do(req) - if err != nil { - return errors.Wrapf(err, "HTTP request failure on %s", url) - } - defer resp.Body.Close() - if resp.StatusCode < 200 || resp.StatusCode > 299 { - return makeHTTPClientError(url, resp) - } - - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - return errors.Wrapf(err, "HTTP Read error on response for %s", url) - } - err = json.Unmarshal(b, target) - if err != nil { - return errors.Wrapf(err, "JSON decode failed on %s:\n%s", url, string(b)) - } - return nil -} diff --git a/vendor/github.com/adlio/trello/custom-fields.go b/vendor/github.com/adlio/trello/custom-fields.go deleted file mode 100644 index e4971ffe..00000000 --- a/vendor/github.com/adlio/trello/custom-fields.go +++ /dev/null @@ -1,148 +0,0 @@ -package trello - -import ( - "database/sql/driver" - "encoding/json" - "fmt" - "strconv" - "time" -) - -// CustomFieldItem represents the custom field items of Trello a trello card. -type CustomFieldItem struct { - ID string `json:"id,omitempty"` - Value CustomFieldValue `json:"value,omitempty"` - IDValue string `json:"idValue,omitempty"` - IDCustomField string `json:"idCustomField,omitempty"` - IDModel string `json:"idModel,omitempty"` - IDModelType string `json:"modelType,omitempty"` -} -type CustomFieldValue struct { - val interface{} -} -type cfval struct { - Text string `json:"text,omitempty"` - Number string `json:"number,omitempty"` - Date string `json:"date,omitempty"` - Checked string `json:"checked,omitempty"` -} - -func NewCustomFieldValue(val interface{}) CustomFieldValue { - return CustomFieldValue{val: val} -} - -const timeFmt = "2006-01-02T15:04:05Z" - -func (v CustomFieldValue) Get() interface{} { - return v.val -} -func (v CustomFieldValue) String() string { - return fmt.Sprintf("%s", v.val) -} -func (v CustomFieldValue) MarshalJSON() ([]byte, error) { - val := v.val - - switchVal: - switch v := val.(type) { - case driver.Valuer: - var err error - val, err = v.Value() - if err != nil { - return nil, err - } - goto switchVal - case string: - return json.Marshal(cfval{Text: v}) - case int, int64: - return json.Marshal(cfval{Number: fmt.Sprintf("%d", v)}) - case float64: - return json.Marshal(cfval{Number: fmt.Sprintf("%f", v)}) - case bool: - if v { - return json.Marshal(cfval{Checked: "true"}) - } else { - return json.Marshal(cfval{Checked: "false"}) - } - case time.Time: - return json.Marshal(cfval{Date: v.Format(timeFmt)}) - default: - return nil, fmt.Errorf("unsupported type") - } -} -func (v *CustomFieldValue) UnmarshalJSON(b []byte) error { - cfval := cfval{} - err := json.Unmarshal(b, &cfval) - if err != nil { - return err - } - if cfval.Text != "" { - v.val = cfval.Text - } - if cfval.Date != "" { - v.val, err = time.Parse(timeFmt, cfval.Date) - if err != nil { - return err - } - } - if cfval.Checked != "" { - v.val = cfval.Checked == "true" - } - if cfval.Number != "" { - v.val, err = strconv.Atoi(cfval.Number) - if err != nil { - v.val, err = strconv.ParseFloat(cfval.Number, 64) - if err != nil { - v.val, err = strconv.ParseFloat(cfval.Number, 32) - if err != nil { - v.val, err = strconv.ParseInt(cfval.Number, 10, 64) - if err != nil { - return fmt.Errorf("cannot convert %s to number", cfval.Number) - } - } - } - } - } - return nil -} - -// CustomField represents Trello's custom fields: "extra bits of structured data -// attached to cards when our users need a bit more than what Trello provides." -// https://developers.trello.com/reference/#custom-fields -type CustomField struct { - ID string `json:"id"` - IDModel string `json:"idModel"` - IDModelType string `json:"modelType,omitempty"` - FieldGroup string `json:"fieldGroup"` - Name string `json:"name"` - Pos int `json:"pos"` - Display struct { - CardFront bool `json:"cardfront"` - } `json:"display"` - Type string `json:"type"` - Options []*CustomFieldOption `json:"options"` -} - -// CustomFieldOption are nested resources of CustomFields -type CustomFieldOption struct { - ID string `json:"id"` - IDCustomField string `json:"idCustomField"` - Value struct { - Text string `json:"text"` - } `json:"value"` - Color string `json:"color,omitempty"` - Pos int `json:"pos"` -} - -// GetCustomField takes a field id string and Arguments and returns the matching custom Field. -func (c *Client) GetCustomField(fieldID string, args Arguments) (customField *CustomField, err error) { - path := fmt.Sprintf("customFields/%s", fieldID) - err = c.Get(path, args, &customField) - return -} - -// GetCustomFields returns a slice of all receiver board's custom fields. -func (b *Board) GetCustomFields(args Arguments) (customFields []*CustomField, err error) { - path := fmt.Sprintf("boards/%s/customFields", b.ID) - err = b.client.Get(path, args, &customFields) - return -} diff --git a/vendor/github.com/adlio/trello/errors.go b/vendor/github.com/adlio/trello/errors.go deleted file mode 100644 index cfaceb35..00000000 --- a/vendor/github.com/adlio/trello/errors.go +++ /dev/null @@ -1,59 +0,0 @@ -package trello - -import ( - "fmt" - "io/ioutil" - "net/http" -) - -type notFoundError interface { - IsNotFound() bool -} - -type rateLimitError interface { - IsRateLimit() bool -} - -type permissionDeniedError interface { - IsPermissionDenied() bool -} - -type httpClientError struct { - msg string - code int -} - -func makeHTTPClientError(url string, resp *http.Response) error { - - body, _ := ioutil.ReadAll(resp.Body) - msg := fmt.Sprintf("HTTP request failure on %s:\n%d: %s", url, resp.StatusCode, string(body)) - - return &httpClientError{ - msg: msg, - code: resp.StatusCode, - } -} - -func (e *httpClientError) Error() string { return e.msg } -func (e *httpClientError) IsRateLimit() bool { return e.code == 429 } -func (e *httpClientError) IsNotFound() bool { return e.code == 404 } -func (e *httpClientError) IsPermissionDenied() bool { return e.code == 401 } - -// IsRateLimit takes an error and returns true exactly if the error is a rate-limit error. -func IsRateLimit(err error) bool { - re, ok := err.(rateLimitError) - return ok && re.IsRateLimit() -} - -// IsNotFound takes an error and returns true exactly if the error is a not-found error. -func IsNotFound(err error) bool { - nf, ok := err.(notFoundError) - return ok && nf.IsNotFound() -} - -// IsPermissionDenied takes an error and returns true exactly if the error is a -// permission-denied error. -func IsPermissionDenied(err error) bool { - pd, ok := err.(permissionDeniedError) - return ok && pd.IsPermissionDenied() -} diff --git a/vendor/github.com/adlio/trello/go.mod b/vendor/github.com/adlio/trello/go.mod deleted file mode 100644 index b88317fd..00000000 --- a/vendor/github.com/adlio/trello/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/adlio/trello - -go 1.12 - -require github.com/pkg/errors v0.8.1 diff --git a/vendor/github.com/adlio/trello/go.sum b/vendor/github.com/adlio/trello/go.sum deleted file mode 100644 index f29ab350..00000000 --- a/vendor/github.com/adlio/trello/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/vendor/github.com/adlio/trello/label.go b/vendor/github.com/adlio/trello/label.go deleted file mode 100644 index 594dcd98..00000000 --- a/vendor/github.com/adlio/trello/label.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import "fmt" - -// Label represents a Trello label. -// Labels are defined per board, and can be applied to the cards on that board. -// https://developers.trello.com/reference/#label-object -type Label struct { - ID string `json:"id"` - IDBoard string `json:"idBoard"` - Name string `json:"name"` - Color string `json:"color"` - Uses int `json:"uses"` -} - -// GetLabel takes a label id and Arguments and returns the matching label (per Trello member) -// or an error. -func (c *Client) GetLabel(labelID string, args Arguments) (label *Label, err error) { - path := fmt.Sprintf("labels/%s", labelID) - err = c.Get(path, args, &label) - return -} - -// GetLabels takes Arguments and returns a slice containing all labels of the receiver board or an error. -func (b *Board) GetLabels(args Arguments) (labels []*Label, err error) { - path := fmt.Sprintf("boards/%s/labels", b.ID) - err = b.client.Get(path, args, &labels) - return -} diff --git a/vendor/github.com/adlio/trello/list-duration-sort.go b/vendor/github.com/adlio/trello/list-duration-sort.go deleted file mode 100644 index 34f2a7b7..00000000 --- a/vendor/github.com/adlio/trello/list-duration-sort.go +++ /dev/null @@ -1,16 +0,0 @@ -package trello - -// ByFirstEntered is a slice of ListDurations -type ByFirstEntered []*ListDuration - -// ByFirstEntered returns the length of the receiver. -func (durs ByFirstEntered) Len() int { return len(durs) } - -// Less takes two indexes i and j and returns true exactly if the ListDuration -// at i was entered before j. -func (durs ByFirstEntered) Less(i, j int) bool { - return durs[i].FirstEntered.Before(durs[j].FirstEntered) -} - -// Swap takes two indexes i and j and swaps the ListDurations at the indexes. -func (durs ByFirstEntered) Swap(i, j int) { durs[i], durs[j] = durs[j], durs[i] } diff --git a/vendor/github.com/adlio/trello/list-duration.go b/vendor/github.com/adlio/trello/list-duration.go deleted file mode 100644 index 47172ade..00000000 --- a/vendor/github.com/adlio/trello/list-duration.go +++ /dev/null @@ -1,87 +0,0 @@ -package trello - -import ( - "sort" - "time" - - "github.com/pkg/errors" -) - -// ListDuration represents the time a Card has been or was in list. -type ListDuration struct { - ListID string - ListName string - Duration time.Duration - FirstEntered time.Time - TimesInList int -} - -// AddDuration takes a duration and adds it to the ListDuration's Duration. -// Also increments TimesInList. -func (l *ListDuration) AddDuration(d time.Duration) { - l.Duration = l.Duration + d - l.TimesInList++ -} - -// GetListDurations analyses a Card's actions to figure out how long it was in each List. -// It returns a slice of the ListDurations, one Duration per list, or an error. -func (c *Card) GetListDurations() (durations []*ListDuration, err error) { - - var actions ActionCollection - if len(c.Actions) == 0 { - // Get all actions which affected the Card's List - c.client.log("[trello] GetListDurations() called on card '%s' without any Card.Actions. Fetching fresh.", c.ID) - actions, err = c.GetListChangeActions() - if err != nil { - err = errors.Wrap(err, "GetListChangeActions() call failed.") - return - } - } else { - actions = c.Actions.FilterToListChangeActions() - } - - return actions.GetListDurations() -} - -// GetListDurations returns a slice of ListDurations based on the receiver Actions. -func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error) { - sort.Sort(actions) - - var prevTime time.Time - var prevList *List - - durs := make(map[string]*ListDuration) - for _, action := range actions { - if action.DidChangeListForCard() { - if prevList != nil { - duration := action.Date.Sub(prevTime) - _, durExists := durs[prevList.ID] - if !durExists { - durs[prevList.ID] = &ListDuration{ListID: prevList.ID, ListName: prevList.Name, Duration: duration, TimesInList: 1, FirstEntered: prevTime} - } else { - durs[prevList.ID].AddDuration(duration) - } - } - prevList = ListAfterAction(action) - prevTime = action.Date - } - } - - if prevList != nil { - duration := time.Now().Sub(prevTime) - _, durExists := durs[prevList.ID] - if !durExists { - durs[prevList.ID] = &ListDuration{ListID: prevList.ID, ListName: prevList.Name, Duration: duration, TimesInList: 1, FirstEntered: prevTime} - } else { - durs[prevList.ID].AddDuration(duration) - } - } - - durations = make([]*ListDuration, 0, len(durs)) - for _, ld := range durs { - durations = append(durations, ld) - } - sort.Sort(ByFirstEntered(durations)) - - return durations, nil -} diff --git a/vendor/github.com/adlio/trello/list.go b/vendor/github.com/adlio/trello/list.go deleted file mode 100644 index 70d950c1..00000000 --- a/vendor/github.com/adlio/trello/list.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" - "time" -) - -// List represents Trello lists. -// https://developers.trello.com/reference/#list-object -type List struct { - client *Client - ID string `json:"id"` - Name string `json:"name"` - IDBoard string `json:"idBoard,omitempty"` - Closed bool `json:"closed"` - Pos float32 `json:"pos,omitempty"` - Subscribed bool `json:"subscribed"` - Board *Board `json:"board,omitempty"` - Cards []*Card `json:"cards,omitempty"` -} - -// CreatedAt returns the time.Time from the list's id. -func (l *List) CreatedAt() time.Time { - t, _ := IDToTime(l.ID) - return t -} - -// GetList takes a list's id and Arguments and returns the matching list. -func (c *Client) GetList(listID string, args Arguments) (list *List, err error) { - path := fmt.Sprintf("lists/%s", listID) - err = c.Get(path, args, &list) - if list != nil { - list.client = c - for i := range list.Cards { - list.Cards[i].client = c - } - } - return -} - -// GetLists takes Arguments and returns the lists of the receiver Board. -func (b *Board) GetLists(args Arguments) (lists []*List, err error) { - path := fmt.Sprintf("boards/%s/lists", b.ID) - err = b.client.Get(path, args, &lists) - for i := range lists { - lists[i].client = b.client - for j := range lists[i].Cards { - lists[i].Cards[j].client = b.client - } - } - return -} - -// CreateList creates a list. -// Attribute currently supported as extra argument: pos. -// Attributes currently known to be unsupported: idListSource. -// -// API Docs: https://developers.trello.com/reference/#lists-1 -func (c *Client) CreateList(onBoard *Board, name string, extraArgs Arguments) (list *List, err error) { - path := "lists" - args := Arguments{ - "name": name, - "pos": "top", - "idBoard": onBoard.ID, - } - - if pos, ok := extraArgs["pos"]; ok { - args["pos"] = pos - } - - list = &List{} - err = c.Post(path, args, &list) - if err == nil { - list.client = c - } - return -} - -// CreateList creates a list. -// Attribute currently supported as extra argument: pos. -// Attributes currently known to be unsupported: idListSource. -// -// API Docs: https://developers.trello.com/reference/#lists-1 -func (b *Board) CreateList(name string, extraArgs Arguments) (list *List, err error) { - return b.client.CreateList(b, name, extraArgs) -} - -// Update UPDATEs the list's attributes. -// API Docs: https://developers.trello.com/reference/#listsid-1 -func (l *List) Update(args Arguments) error { - path := fmt.Sprintf("lists/%s", l.ID) - return l.client.Put(path, args, l) -} diff --git a/vendor/github.com/adlio/trello/member-duration.go b/vendor/github.com/adlio/trello/member-duration.go deleted file mode 100644 index 9377798f..00000000 --- a/vendor/github.com/adlio/trello/member-duration.go +++ /dev/null @@ -1,122 +0,0 @@ -package trello - -import ( - "sort" - "time" - - "github.com/pkg/errors" -) - -// MemberDuration is used to track the periods of time which a user (member) is attached to a card. -type MemberDuration struct { - MemberID string - MemberName string - FirstAdded time.Time - Duration time.Duration - active bool - lastAdded time.Time -} - -// ByLongestDuration is a slice of *MemberDuration -type ByLongestDuration []*MemberDuration - -// Len returns the length of the ByLongestDuration slice. -func (d ByLongestDuration) Len() int { return len(d) } - -// Less takes two indexes i and j and returns true exactly if the Duration -// at i is larger than the Duration at j. -func (d ByLongestDuration) Less(i, j int) bool { return d[i].Duration > d[j].Duration } -func (d ByLongestDuration) Swap(i, j int) { d[i], d[j] = d[j], d[i] } - -func (d *MemberDuration) addAsOf(t time.Time) { - d.active = true - if d.FirstAdded.IsZero() { - d.FirstAdded = t - } - d.startTimerAsOf(t) -} - -func (d *MemberDuration) startTimerAsOf(t time.Time) { - if d.active { - d.lastAdded = t - } -} - -func (d *MemberDuration) removeAsOf(t time.Time) { - d.stopTimerAsOf(t) - d.active = false - d.lastAdded = time.Time{} -} - -func (d *MemberDuration) stopTimerAsOf(t time.Time) { - if d.active { - d.Duration = d.Duration + t.Sub(d.lastAdded) - } -} - -// GetMemberDurations returns a slice containing all durations of a card. -func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error) { - var actions ActionCollection - if len(c.Actions) == 0 { - c.client.log("[trello] GetMemberDurations() called on card '%s' without any Card.Actions. Fetching fresh.", c.ID) - actions, err = c.GetMembershipChangeActions() - if err != nil { - err = errors.Wrap(err, "GetMembershipChangeActions() call failed.") - return - } - } else { - actions = c.Actions.FilterToCardMembershipChangeActions() - } - - return actions.GetMemberDurations() -} - -// GetMemberDurations is similar to GetListDurations. It returns a slice of MemberDuration objects, -// which describes the length of time each member was attached to this card. Durations are -// calculated such that being added to a card starts a timer for that member, and being removed -// starts it again (so that if a person is added and removed multiple times, the duration -// captures only the times which they were attached). Archiving the card also stops the timer. -func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error) { - sort.Sort(actions) - durs := make(map[string]*MemberDuration) - for _, action := range actions { - if action.DidChangeCardMembership() { - _, durExists := durs[action.Member.ID] - if !durExists { - switch action.Type { - case "addMemberToCard": - durs[action.Member.ID] = &MemberDuration{MemberID: action.Member.ID, MemberName: action.Member.FullName} - durs[action.Member.ID].addAsOf(action.Date) - case "removeMemberFromCard": - // Surprisingly, this is possible. If a card was copied, and members were preserved, those - // members exist on the card without a corresponding addMemberToCard action. - t, _ := IDToTime(action.Data.Card.ID) - durs[action.Member.ID] = &MemberDuration{MemberID: action.Member.ID, MemberName: action.Member.FullName, lastAdded: t} - durs[action.Member.ID].removeAsOf(action.Date) - } - } else { - switch action.Type { - case "addMemberToCard": - durs[action.Member.ID].addAsOf(action.Date) - case "removeMemberFromCard": - durs[action.Member.ID].removeAsOf(action.Date) - } - } - } else if action.DidArchiveCard() { - for id := range durs { - durs[id].stopTimerAsOf(action.Date) - } - } else if action.DidUnarchiveCard() { - for id := range durs { - durs[id].startTimerAsOf(action.Date) - } - } - } - - durations = make([]*MemberDuration, 0, len(durs)) - for _, md := range durs { - durations = append(durations, md) - } - // sort.Sort(ByLongestDuration(durations)) - return durations, nil -} diff --git a/vendor/github.com/adlio/trello/member.go b/vendor/github.com/adlio/trello/member.go deleted file mode 100644 index 613c7483..00000000 --- a/vendor/github.com/adlio/trello/member.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" -) - -// Member represents a Trello member. -// https://developers.trello.com/reference/#member-object -type Member struct { - client *Client - ID string `json:"id"` - Username string `json:"username"` - FullName string `json:"fullName"` - Initials string `json:"initials"` - AvatarHash string `json:"avatarHash"` - Email string `json:"email"` -} - -// GetMember takes a member id and Arguments and returns a Member or an error. -func (c *Client) GetMember(memberID string, args Arguments) (member *Member, err error) { - path := fmt.Sprintf("members/%s", memberID) - err = c.Get(path, args, &member) - if err == nil { - member.client = c - } - return -} - -// GetMembers takes Arguments and returns a slice of all members of the organization or an error. -func (o *Organization) GetMembers(args Arguments) (members []*Member, err error) { - path := fmt.Sprintf("organizations/%s/members", o.ID) - err = o.client.Get(path, args, &members) - for i := range members { - members[i].client = o.client - } - return -} - -// GetMembers takes Arguments and returns a slice of all members of the Board or an error. -func (b *Board) GetMembers(args Arguments) (members []*Member, err error) { - path := fmt.Sprintf("boards/%s/members", b.ID) - err = b.client.Get(path, args, &members) - for i := range members { - members[i].client = b.client - } - return -} - -// GetMembers takes Arguments and returns a slice of all members of the Card or an error. -func (c *Card) GetMembers(args Arguments) (members []*Member, err error) { - path := fmt.Sprintf("cards/%s/members", c.ID) - err = c.client.Get(path, args, &members) - for i := range members { - members[i].client = c.client - } - return -} diff --git a/vendor/github.com/adlio/trello/notification.go b/vendor/github.com/adlio/trello/notification.go deleted file mode 100644 index d2ae4b2a..00000000 --- a/vendor/github.com/adlio/trello/notification.go +++ /dev/null @@ -1,53 +0,0 @@ -package trello - -import ( - "time" -) - -// Notification represents a Trello Notification. -// https://developers.trello.com/reference/#notifications -type Notification struct { - client *Client - - ID string `json:"id"` - IDAction string `json:"idAction"` - Unread bool `json:"unread"` - Type string `json:"type"` - IDMemberCreator string `json:"idMemberCreator"` - Date time.Time `json:"date"` - DateRead time.Time `json:"dataRead"` - Data NotificationData `json:"data,omitempty"` - MemberCreator *Member `json:"memberCreator,omitempty"` -} - -// NotificationData represents the 'notificaiton.data' -type NotificationData struct { - Text string `json:"text"` - Card *NotificationDataCard `json:"card,omitempty"` - Board *NotificationDataBoard `json:"board,omitempty"` -} - -// NotificationDataBoard represents the 'notification.data.board' -type NotificationDataBoard struct { - ID string `json:"id"` - ShortLink string `json:"shortLink"` - Name string `json:"name"` -} - -// NotificationDataCard represents the 'notification.data.card' -type NotificationDataCard struct { - ID string `json:"id"` - IDShort int `json:"idShort"` - Name string `json:"name"` - ShortLink string `json:"shortLink"` -} - -// GetMyNotifications returns the notifications of the authenticated user -func (c *Client) GetMyNotifications(args Arguments) (notifications []*Notification, err error) { - path := "members/me/notifications" - err = c.Get(path, args, ¬ifications) - for i := range notifications { - notifications[i].client = c - } - return -} diff --git a/vendor/github.com/adlio/trello/organization.go b/vendor/github.com/adlio/trello/organization.go deleted file mode 100644 index 4497b68a..00000000 --- a/vendor/github.com/adlio/trello/organization.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" -) - -// Organization represents a Trello organization or team, i.e. a collection of members and boards. -// https://developers.trello.com/reference/#organizations -type Organization struct { - client *Client - ID string `json:"id"` - Name string `json:"name"` - DisplayName string `json:"displayName"` - Desc string `json:"desc"` - URL string `json:"url"` - Website string `json:"website"` - Products []string `json:"products"` - PowerUps []string `json:"powerUps"` -} - -// GetOrganization takes an organization id and Arguments and either -// GETs returns an Organization, or an error. -func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error) { - path := fmt.Sprintf("organizations/%s", orgID) - err = c.Get(path, args, &organization) - if organization != nil { - organization.client = c - } - return -} diff --git a/vendor/github.com/adlio/trello/search.go b/vendor/github.com/adlio/trello/search.go deleted file mode 100644 index 55f33520..00000000 --- a/vendor/github.com/adlio/trello/search.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -// SearchResult represents a search result as collections of various -// types returned by a search, e.g. Cards or Boards. -type SearchResult struct { - Options SearchOptions `json:"options"` - Actions []*Action `json:"actions,omitempty"` - Cards []*Card `json:"cards,omitempty"` - Boards []*Board `json:"boards,omitempty"` - Members []*Member `json:"members,omitempty"` -} - -// SearchOptions contains options for search requests. -type SearchOptions struct { - Terms []SearchTerm `json:"terms"` - Modifiers []SearchModifier `json:"modifiers,omitempty"` - ModelTypes []string `json:"modelTypes,omitempty"` - Partial bool `json:"partial"` -} - -// SearchModifier is wrapper for a search string. -type SearchModifier struct { - Text string `json:"text"` -} - -// SearchTerm is a string that may be negated in a search query. -type SearchTerm struct { - Text string `json:"text"` - Negated bool `json:"negated,omitempty"` -} - -// SearchCards takes a query string and Arguments and returns a slice of Cards or an error. -func (c *Client) SearchCards(query string, args Arguments) (cards []*Card, err error) { - args["query"] = query - args["modelTypes"] = "cards" - res := SearchResult{} - err = c.Get("search", args, &res) - cards = res.Cards - return -} - -// SearchBoards takes a query string and Arguments and returns a slice of Boards or an error. -func (c *Client) SearchBoards(query string, args Arguments) (boards []*Board, err error) { - args["query"] = query - args["modelTypes"] = "boards" - res := SearchResult{} - err = c.Get("search", args, &res) - boards = res.Boards - for _, board := range boards { - board.client = c - } - return -} - -// SearchMembers takes a query string and Arguments and returns a slice of Members or an error. -func (c *Client) SearchMembers(query string, args Arguments) (members []*Member, err error) { - args["query"] = query - err = c.Get("search/members", args, &members) - return -} diff --git a/vendor/github.com/adlio/trello/token.go b/vendor/github.com/adlio/trello/token.go deleted file mode 100644 index 9f297106..00000000 --- a/vendor/github.com/adlio/trello/token.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "fmt" - "time" -) - -// Token represents Trello tokens. Tokens can be used for setting up Webhooks among other things. -// https://developers.trello.com/reference/#tokens -type Token struct { - client *Client - ID string `json:"id"` - DateCreated time.Time `json:"dateCreated"` - DateExpires *time.Time `json:"dateExpires"` - IDMember string `json:"idMember"` - Identifier string `json:"identifier"` - Permissions []Permission `json:"permissions"` -} - -// Permission represent a Token's permissions. -type Permission struct { - IDModel string `json:"idModel"` - ModelType string `json:"modelType"` - Read bool `json:"read"` - Write bool `json:"write"` -} - -// GetToken takes a token id and Arguments and GETs and returns the Token or an error. -func (c *Client) GetToken(tokenID string, args Arguments) (token *Token, err error) { - path := fmt.Sprintf("tokens/%s", tokenID) - err = c.Get(path, args, &token) - if token != nil { - token.client = c - } - return -} diff --git a/vendor/github.com/adlio/trello/trello-logo.png b/vendor/github.com/adlio/trello/trello-logo.png deleted file mode 100644 index 1aeeff35..00000000 Binary files a/vendor/github.com/adlio/trello/trello-logo.png and /dev/null differ diff --git a/vendor/github.com/adlio/trello/trello.go b/vendor/github.com/adlio/trello/trello.go deleted file mode 100644 index eff7ff96..00000000 --- a/vendor/github.com/adlio/trello/trello.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "strconv" - "time" - - "github.com/pkg/errors" -) - -// IDToTime is a convenience function. It takes a Trello ID string and -// extracts the encoded create time as time.Time or an error. -func IDToTime(id string) (t time.Time, err error) { - if id == "" { - return time.Time{}, nil - } - // The first 8 characters in the object ID are a Unix timestamp - ts, err := strconv.ParseUint(id[:8], 16, 64) - if err != nil { - err = errors.Wrapf(err, "ID '%s' failed to convert to timestamp.", id) - } else { - t = time.Unix(int64(ts), 0) - } - return -} diff --git a/vendor/github.com/adlio/trello/webhook.go b/vendor/github.com/adlio/trello/webhook.go deleted file mode 100644 index 9f32743b..00000000 --- a/vendor/github.com/adlio/trello/webhook.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright © 2016 Aaron Longwell -// -// Use of this source code is governed by an MIT licese. -// Details in the LICENSE file. - -package trello - -import ( - "encoding/json" - "fmt" - "net/http" - - "github.com/pkg/errors" -) - -// Webhook is the Go representation of a webhook registered in Trello's systems. -// Used when creating, modifying or deleting webhooks. -// https://developers.trello.com/reference/#webhook-object -// -type Webhook struct { - client *Client - ID string `json:"id,omitempty"` - IDModel string `json:"idModel"` - Description string `json:"description"` - CallbackURL string `json:"callbackURL"` - Active bool `json:"active"` -} - -// BoardWebhookRequest is the object sent by Trello to a Webhook for Board-triggered -// webhooks. -// -type BoardWebhookRequest struct { - Model *Board - Action *Action -} - -// ListWebhookRequest is the object sent by Trello to a Webhook for List-triggered -// webhooks. -// -type ListWebhookRequest struct { - Model *List - Action *Action -} - -// CardWebhookRequest is the object sent by Trello to a Webhook for Card-triggered -// webhooks. -// -type CardWebhookRequest struct { - Model *Card - Action *Action -} - -// CreateWebhook takes a Webhook, POSTs it and returns an error object. -func (c *Client) CreateWebhook(webhook *Webhook) error { - path := "webhooks" - args := Arguments{"idModel": webhook.IDModel, "description": webhook.Description, "callbackURL": webhook.CallbackURL} - err := c.Post(path, args, webhook) - if err == nil { - webhook.client = c - } - return err -} - -// Delete takes a webhook and deletes it -func (w *Webhook) Delete(args Arguments) error { - path := fmt.Sprintf("webhooks/%s", w.ID) - return w.client.Delete(path, Arguments{}, w) -} - -// GetWebhook takes a webhook id and Arguments, GETs the matching Webhook and returns it or an error. -func (c *Client) GetWebhook(webhookID string, args Arguments) (webhook *Webhook, err error) { - path := fmt.Sprintf("webhooks/%s", webhookID) - err = c.Get(path, args, &webhook) - if webhook != nil { - webhook.client = c - } - return -} - -// GetWebhooks takes Arguments and returns a list of all Webhooks for the receiver Token or an error. -func (t *Token) GetWebhooks(args Arguments) (webhooks []*Webhook, err error) { - path := fmt.Sprintf("tokens/%s/webhooks", t.client.Token) - err = t.client.Get(path, args, &webhooks) - if err == nil { - for _, webhook := range webhooks { - webhook.client = t.client - } - } - return -} - -// GetBoardWebhookRequest takes a http.Request and returns the decoded body as BoardWebhookRequest or an error. -func GetBoardWebhookRequest(r *http.Request) (whr *BoardWebhookRequest, err error) { - if r.Method == "HEAD" { - return &BoardWebhookRequest{}, nil - } - decoder := json.NewDecoder(r.Body) - err = decoder.Decode(&whr) - if err != nil { - err = errors.Wrapf(err, "GetBoardWebhookRequest() failed to decode '%s'.", r.URL) - } - return -} - -// GetListWebhookRequest takes a http.Request and returns the decoded Body as ListWebhookRequest or an error. -func GetListWebhookRequest(r *http.Request) (whr *ListWebhookRequest, err error) { - if r.Method == "HEAD" { - return &ListWebhookRequest{}, nil - } - decoder := json.NewDecoder(r.Body) - err = decoder.Decode(&whr) - if err != nil { - err = errors.Wrapf(err, "GetListWebhookRequest() failed to decode '%s'.", r.URL) - } - return -} - -// GetCardWebhookRequest takes a http.Request and returns the decoded Body as CardWebhookRequest or an error. -func GetCardWebhookRequest(r *http.Request) (whr *CardWebhookRequest, err error) { - if r.Method == "HEAD" { - return &CardWebhookRequest{}, nil - } - decoder := json.NewDecoder(r.Body) - err = decoder.Decode(&whr) - if err != nil { - err = errors.Wrapf(err, "GetCardWebhookRequest() failed to decode '%s'.", r.URL) - } - return -} diff --git a/vendor/github.com/alecthomas/chroma/.gitignore b/vendor/github.com/alecthomas/chroma/.gitignore deleted file mode 100644 index ccacd12e..00000000 --- a/vendor/github.com/alecthomas/chroma/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib -/cmd/chroma/chroma - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ - -_models/ - -_examples/ diff --git a/vendor/github.com/alecthomas/chroma/.golangci.yml b/vendor/github.com/alecthomas/chroma/.golangci.yml deleted file mode 100644 index b1e51f39..00000000 --- a/vendor/github.com/alecthomas/chroma/.golangci.yml +++ /dev/null @@ -1,55 +0,0 @@ -run: - tests: true - skip-dirs: - - _examples - -output: - print-issued-lines: false - -linters: - enable-all: true - disable: - - maligned - - megacheck - - lll - - gocyclo - - dupl - - gochecknoglobals - - funlen - - godox - - wsl - - gomnd - - gocognit - -linters-settings: - govet: - check-shadowing: true - gocyclo: - min-complexity: 10 - dupl: - threshold: 100 - goconst: - min-len: 8 - min-occurrences: 3 - -issues: - max-per-linter: 0 - max-same: 0 - exclude-use-default: false - exclude: - # Captured by errcheck. - - '^(G104|G204):' - # Very commonly not checked. - - 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked' - - 'exported method (.*\.MarshalJSON|.*\.UnmarshalJSON|.*\.EntityURN|.*\.GoString|.*\.Pos) should have comment or be unexported' - - 'composite literal uses unkeyed fields' - - 'declaration of "err" shadows declaration' - - 'should not use dot imports' - - 'Potential file inclusion via variable' - - 'should have comment or be unexported' - - 'comment on exported var .* should be of the form' - - 'at least one file in a package should have a package comment' - - 'string literal contains the Unicode' - - 'methods on the same type should have the same receiver name' - - '_TokenType_name should be _TokenTypeName' - - '`_TokenType_map` should be `_TokenTypeMap`' diff --git a/vendor/github.com/alecthomas/chroma/.goreleaser.yml b/vendor/github.com/alecthomas/chroma/.goreleaser.yml deleted file mode 100644 index e90c5113..00000000 --- a/vendor/github.com/alecthomas/chroma/.goreleaser.yml +++ /dev/null @@ -1,31 +0,0 @@ -project_name: chroma -release: - github: - owner: alecthomas - name: chroma -brew: - install: bin.install "chroma" -builds: -- goos: - - linux - - darwin - - windows - goarch: - - amd64 - - "386" - goarm: - - "6" - main: ./cmd/chroma/main.go - ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} - binary: chroma -archive: - format: tar.gz - name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ - .Arm }}{{ end }}' - files: - - COPYING - - README* -snapshot: - name_template: SNAPSHOT-{{ .Commit }} -checksum: - name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' diff --git a/vendor/github.com/alecthomas/chroma/.travis.yml b/vendor/github.com/alecthomas/chroma/.travis.yml deleted file mode 100644 index 9216ec97..00000000 --- a/vendor/github.com/alecthomas/chroma/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -sudo: false -language: go -go: - - "1.13.x" -script: - - go test -v ./... - - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.22.2 - - ./bin/golangci-lint run - - git clean -fdx . -after_success: - curl -sL https://git.io/goreleaser | bash && goreleaser - diff --git a/vendor/github.com/alecthomas/chroma/COPYING b/vendor/github.com/alecthomas/chroma/COPYING deleted file mode 100644 index 92dc39f7..00000000 --- a/vendor/github.com/alecthomas/chroma/COPYING +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2017 Alec Thomas - -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. diff --git a/vendor/github.com/alecthomas/chroma/Makefile b/vendor/github.com/alecthomas/chroma/Makefile deleted file mode 100644 index 1b8320a5..00000000 --- a/vendor/github.com/alecthomas/chroma/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.PHONY: chromad upload all - -all: README.md tokentype_string.go - -README.md: lexers/*/*.go - ./table.py - -tokentype_string.go: types.go - go generate - -chromad: - (cd ./cmd/chromad && go get github.com/GeertJohan/go.rice/rice@master && go install github.com/GeertJohan/go.rice/rice) - rm -f chromad - (export CGOENABLED=0 GOOS=linux ; cd ./cmd/chromad && go build -o ../../chromad .) - rice append -i ./cmd/chromad --exec=./chromad - -upload: chromad - scp chromad root@swapoff.org: && \ - ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart' diff --git a/vendor/github.com/alecthomas/chroma/README.md b/vendor/github.com/alecthomas/chroma/README.md deleted file mode 100644 index 490adeac..00000000 --- a/vendor/github.com/alecthomas/chroma/README.md +++ /dev/null @@ -1,267 +0,0 @@ -# Chroma — A general purpose syntax highlighter in pure Go [![Golang Documentation](https://godoc.org/github.com/alecthomas/chroma?status.svg)](https://godoc.org/github.com/alecthomas/chroma) [![Build Status](https://travis-ci.org/alecthomas/chroma.svg)](https://travis-ci.org/alecthomas/chroma) [![Gitter chat](https://badges.gitter.im/alecthomas.svg)](https://gitter.im/alecthomas/Lobby) - -> **NOTE:** As Chroma has just been released, its API is still in flux. That said, the high-level interface should not change significantly. - -Chroma takes source code and other structured text and converts it into syntax -highlighted HTML, ANSI-coloured text, etc. - -Chroma is based heavily on [Pygments](http://pygments.org/), and includes -translators for Pygments lexers and styles. - - -## Table of Contents - - - -1. [Table of Contents](#table-of-contents) -2. [Supported languages](#supported-languages) -3. [Try it](#try-it) -4. [Using the library](#using-the-library) - 1. [Quick start](#quick-start) - 2. [Identifying the language](#identifying-the-language) - 3. [Formatting the output](#formatting-the-output) - 4. [The HTML formatter](#the-html-formatter) -5. [More detail](#more-detail) - 1. [Lexers](#lexers) - 2. [Formatters](#formatters) - 3. [Styles](#styles) -6. [Command-line interface](#command-line-interface) -7. [What's missing compared to Pygments?](#whats-missing-compared-to-pygments) - - - - -## Supported languages - -Prefix | Language -:----: | -------- -A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Angular2, ANTLR, ApacheConf, APL, AppleScript, Arduino, Awk -B | Ballerina, Base Makefile, Bash, Batchfile, BlitzBasic, BNF, Brainfuck -C | C, C#, C++, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython -D | D, Dart, Diff, Django/Jinja, Docker, DTD -E | EBNF, Elixir, Elm, EmacsLisp, Erlang -F | Factor, Fish, Forth, Fortran, FSharp -G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groovy -H | Handlebars, Haskell, Haxe, HCL, Hexdump, HTML, HTTP, Hy -I | Idris, INI, Io -J | J, Java, JavaScript, JSON, Julia, Jungle -K | Kotlin -L | Lighttpd configuration file, LLVM, Lua -M | Mako, markdown, Mason, Mathematica, Matlab, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL -N | NASM, Newspeak, Nginx configuration file, Nim, Nix -O | Objective-C, OCaml, Octave, OpenSCAD, Org Mode -P | PacmanConf, Perl, PHP, Pig, PkgConfig, PL/pgSQL, plaintext, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, Protocol Buffer, Puppet, Python, Python 3 -Q | QBasic -R | R, Racket, Ragel, react, reg, reStructuredText, Rexx, Ruby, Rust -S | Sass, Scala, Scheme, Scilab, SCSS, Smalltalk, Smarty, SML, Snobol, Solidity, SPARQL, SQL, SquidConf, Swift, SYSTEMD, systemverilog -T | TableGen, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData -V | VB.net, verilog, VHDL, VimL, vue -W | WDTE -X | XML, Xorg -Y | YAML - - -_I will attempt to keep this section up to date, but an authoritative list can be -displayed with `chroma --list`._ - - -## Try it - -Try out various languages and styles on the [Chroma Playground](https://swapoff.org/chroma/playground/). - - -## Using the library - -Chroma, like Pygments, has the concepts of -[lexers](https://github.com/alecthomas/chroma/tree/master/lexers), -[formatters](https://github.com/alecthomas/chroma/tree/master/formatters) and -[styles](https://github.com/alecthomas/chroma/tree/master/styles). - -Lexers convert source text into a stream of tokens, styles specify how token -types are mapped to colours, and formatters convert tokens and styles into -formatted output. - -A package exists for each of these, containing a global `Registry` variable -with all of the registered implementations. There are also helper functions -for using the registry in each package, such as looking up lexers by name or -matching filenames, etc. - -In all cases, if a lexer, formatter or style can not be determined, `nil` will -be returned. In this situation you may want to default to the `Fallback` -value in each respective package, which provides sane defaults. - - -### Quick start - -A convenience function exists that can be used to simply format some source -text, without any effort: - -```go -err := quick.Highlight(os.Stdout, someSourceCode, "go", "html", "monokai") -``` - - -### Identifying the language - -To highlight code, you'll first have to identify what language the code is -written in. There are three primary ways to do that: - -1. Detect the language from its filename. - - ```go - lexer := lexers.Match("foo.go") - ``` - -3. Explicitly specify the language by its Chroma syntax ID (a full list is available from `lexers.Names()`). - - ```go - lexer := lexers.Get("go") - ``` - -3. Detect the language from its content. - - ```go - lexer := lexers.Analyse("package main\n\nfunc main()\n{\n}\n") - ``` - -In all cases, `nil` will be returned if the language can not be identified. - -```go -if lexer == nil { - lexer = lexers.Fallback -} -``` - -At this point, it should be noted that some lexers can be extremely chatty. To -mitigate this, you can use the coalescing lexer to coalesce runs of identical -token types into a single token: - -```go -lexer = chroma.Coalesce(lexer) -``` - - -### Formatting the output - -Once a language is identified you will need to pick a formatter and a style (theme). - -```go -style := styles.Get("swapoff") -if style == nil { - style = styles.Fallback -} -formatter := formatters.Get("html") -if formatter == nil { - formatter = formatters.Fallback -} -``` - -Then obtain an iterator over the tokens: - -```go -contents, err := ioutil.ReadAll(r) -iterator, err := lexer.Tokenise(nil, string(contents)) -``` - -And finally, format the tokens from the iterator: - -```go -err := formatter.Format(w, style, iterator) -``` - - -### The HTML formatter - -By default the `html` registered formatter generates standalone HTML with -embedded CSS. More flexibility is available through the `formatters/html` package. - -Firstly, the output generated by the formatter can be customised with the -following constructor options: - -- `Standalone()` - generate standalone HTML with embedded CSS. -- `WithClasses()` - use classes rather than inlined style attributes. -- `ClassPrefix(prefix)` - prefix each generated CSS class. -- `TabWidth(width)` - Set the rendered tab width, in characters. -- `WithLineNumbers()` - Render line numbers (style with `LineNumbers`). -- `LinkableLineNumbers()` - Make the line numbers linkable. -- `HighlightLines(ranges)` - Highlight lines in these ranges (style with `LineHighlight`). -- `LineNumbersInTable()` - Use a table for formatting line numbers and code, rather than spans. - -If `WithClasses()` is used, the corresponding CSS can be obtained from the formatter with: - -```go -formatter := html.New(html.WithClasses()) -err := formatter.WriteCSS(w, style) -``` - - -## More detail - - -### Lexers - -See the [Pygments documentation](http://pygments.org/docs/lexerdevelopment/) -for details on implementing lexers. Most concepts apply directly to Chroma, -but see existing lexer implementations for real examples. - -In many cases lexers can be automatically converted directly from Pygments by -using the included Python 3 script `pygments2chroma.py`. I use something like -the following: - -```sh -python3 ~/Projects/chroma/_tools/pygments2chroma.py \ - pygments.lexers.jvm.KotlinLexer \ - > ~/Projects/chroma/lexers/kotlin.go \ - && gofmt -s -w ~/Projects/chroma/lexers/*.go -``` - -See notes in [pygments-lexers.go](https://github.com/alecthomas/chroma/blob/master/pygments-lexers.txt) -for a list of lexers, and notes on some of the issues importing them. - - -### Formatters - -Chroma supports HTML output, as well as terminal output in 8 colour, 256 colour, and true-colour. - -A `noop` formatter is included that outputs the token text only, and a `tokens` -formatter outputs raw tokens. The latter is useful for debugging lexers. - - -### Styles - -Chroma styles use the [same syntax](http://pygments.org/docs/styles/) as Pygments. - -All Pygments styles have been converted to Chroma using the `_tools/style.py` script. - -When you work with one of [Chroma's styles](https://github.com/alecthomas/chroma/tree/master/styles), know that the `chroma.Background` token type provides the default style for tokens. It does so by defining a foreground color and background color. - -For example, this gives each token name not defined in the style a default color of `#f8f8f8` and uses `#000000` for the highlighted code block's background: - -~~~go -chroma.Background: "#f8f8f2 bg:#000000", -~~~ - -Also, token types in a style file are hierarchical. For instance, when `CommentSpecial` is not defined, Chroma uses the token style from `Comment`. So when several comment tokens use the same color, you'll only need to define `Comment` and override the one that has a different color. - -For a quick overview of the available styles and how they look, check out the [Chroma Style Gallery](https://xyproto.github.io/splash/docs/). - - -## Command-line interface - -A command-line interface to Chroma is included. It can be installed with: - -```sh -go get -u github.com/alecthomas/chroma/cmd/chroma -``` - - -## What's missing compared to Pygments? - -- Quite a few lexers, for various reasons (pull-requests welcome): - - Pygments lexers for complex languages often include custom code to - handle certain aspects, such as Perl6's ability to nest code inside - regular expressions. These require time and effort to convert. - - I mostly only converted languages I had heard of, to reduce the porting cost. -- Some more esoteric features of Pygments are omitted for simplicity. -- Though the Chroma API supports content detection, very few languages support them. - I have plans to implement a statistical analyser at some point, but not enough time. diff --git a/vendor/github.com/alecthomas/chroma/coalesce.go b/vendor/github.com/alecthomas/chroma/coalesce.go deleted file mode 100644 index f5048951..00000000 --- a/vendor/github.com/alecthomas/chroma/coalesce.go +++ /dev/null @@ -1,35 +0,0 @@ -package chroma - -// Coalesce is a Lexer interceptor that collapses runs of common types into a single token. -func Coalesce(lexer Lexer) Lexer { return &coalescer{lexer} } - -type coalescer struct{ Lexer } - -func (d *coalescer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { - var prev Token - it, err := d.Lexer.Tokenise(options, text) - if err != nil { - return nil, err - } - return func() Token { - for token := it(); token != (EOF); token = it() { - if len(token.Value) == 0 { - continue - } - if prev == EOF { - prev = token - } else { - if prev.Type == token.Type && len(prev.Value) < 8192 { - prev.Value += token.Value - } else { - out := prev - prev = token - return out - } - } - } - out := prev - prev = EOF - return out - }, nil -} diff --git a/vendor/github.com/alecthomas/chroma/colour.go b/vendor/github.com/alecthomas/chroma/colour.go deleted file mode 100644 index 15d794ce..00000000 --- a/vendor/github.com/alecthomas/chroma/colour.go +++ /dev/null @@ -1,164 +0,0 @@ -package chroma - -import ( - "fmt" - "math" - "strconv" - "strings" -) - -// ANSI2RGB maps ANSI colour names, as supported by Chroma, to hex RGB values. -var ANSI2RGB = map[string]string{ - "#ansiblack": "000000", - "#ansidarkred": "7f0000", - "#ansidarkgreen": "007f00", - "#ansibrown": "7f7fe0", - "#ansidarkblue": "00007f", - "#ansipurple": "7f007f", - "#ansiteal": "007f7f", - "#ansilightgray": "e5e5e5", - // Normal - "#ansidarkgray": "555555", - "#ansired": "ff0000", - "#ansigreen": "00ff00", - "#ansiyellow": "ffff00", - "#ansiblue": "0000ff", - "#ansifuchsia": "ff00ff", - "#ansiturquoise": "00ffff", - "#ansiwhite": "ffffff", - - // Aliases without the "ansi" prefix, because...why? - "#black": "000000", - "#darkred": "7f0000", - "#darkgreen": "007f00", - "#brown": "7f7fe0", - "#darkblue": "00007f", - "#purple": "7f007f", - "#teal": "007f7f", - "#lightgray": "e5e5e5", - // Normal - "#darkgray": "555555", - "#red": "ff0000", - "#green": "00ff00", - "#yellow": "ffff00", - "#blue": "0000ff", - "#fuchsia": "ff00ff", - "#turquoise": "00ffff", - "#white": "ffffff", -} - -// Colour represents an RGB colour. -type Colour int32 - -// NewColour creates a Colour directly from RGB values. -func NewColour(r, g, b uint8) Colour { - return ParseColour(fmt.Sprintf("%02x%02x%02x", r, g, b)) -} - -// Distance between this colour and another. -// -// This uses the approach described here (https://www.compuphase.com/cmetric.htm). -// This is not as accurate as LAB, et. al. but is *vastly* simpler and sufficient for our needs. -func (c Colour) Distance(e2 Colour) float64 { - ar, ag, ab := int64(c.Red()), int64(c.Green()), int64(c.Blue()) - br, bg, bb := int64(e2.Red()), int64(e2.Green()), int64(e2.Blue()) - rmean := (ar + br) / 2 - r := ar - br - g := ag - bg - b := ab - bb - return math.Sqrt(float64((((512 + rmean) * r * r) >> 8) + 4*g*g + (((767 - rmean) * b * b) >> 8))) -} - -// Brighten returns a copy of this colour with its brightness adjusted. -// -// If factor is negative, the colour is darkened. -// -// Uses approach described here (http://www.pvladov.com/2012/09/make-color-lighter-or-darker.html). -func (c Colour) Brighten(factor float64) Colour { - r := float64(c.Red()) - g := float64(c.Green()) - b := float64(c.Blue()) - - if factor < 0 { - factor++ - r *= factor - g *= factor - b *= factor - } else { - r = (255-r)*factor + r - g = (255-g)*factor + g - b = (255-b)*factor + b - } - return NewColour(uint8(r), uint8(g), uint8(b)) -} - -// BrightenOrDarken brightens a colour if it is < 0.5 brighteness or darkens if > 0.5 brightness. -func (c Colour) BrightenOrDarken(factor float64) Colour { - if c.Brightness() < 0.5 { - return c.Brighten(factor) - } - return c.Brighten(-factor) -} - -// Brightness of the colour (roughly) in the range 0.0 to 1.0 -func (c Colour) Brightness() float64 { - return (float64(c.Red()) + float64(c.Green()) + float64(c.Blue())) / 255.0 / 3.0 -} - -// ParseColour in the forms #rgb, #rrggbb, #ansi, or #. -// Will return an "unset" colour if invalid. -func ParseColour(colour string) Colour { - colour = normaliseColour(colour) - n, err := strconv.ParseUint(colour, 16, 32) - if err != nil { - return 0 - } - return Colour(n + 1) -} - -// MustParseColour is like ParseColour except it panics if the colour is invalid. -// -// Will panic if colour is in an invalid format. -func MustParseColour(colour string) Colour { - parsed := ParseColour(colour) - if !parsed.IsSet() { - panic(fmt.Errorf("invalid colour %q", colour)) - } - return parsed -} - -// IsSet returns true if the colour is set. -func (c Colour) IsSet() bool { return c != 0 } - -func (c Colour) String() string { return fmt.Sprintf("#%06x", int(c-1)) } -func (c Colour) GoString() string { return fmt.Sprintf("Colour(0x%06x)", int(c-1)) } - -// Red component of colour. -func (c Colour) Red() uint8 { return uint8(((c - 1) >> 16) & 0xff) } - -// Green component of colour. -func (c Colour) Green() uint8 { return uint8(((c - 1) >> 8) & 0xff) } - -// Blue component of colour. -func (c Colour) Blue() uint8 { return uint8((c - 1) & 0xff) } - -// Colours is an orderable set of colours. -type Colours []Colour - -func (c Colours) Len() int { return len(c) } -func (c Colours) Swap(i, j int) { c[i], c[j] = c[j], c[i] } -func (c Colours) Less(i, j int) bool { return c[i] < c[j] } - -// Convert colours to #rrggbb. -func normaliseColour(colour string) string { - if ansi, ok := ANSI2RGB[colour]; ok { - return ansi - } - if strings.HasPrefix(colour, "#") { - colour = colour[1:] - if len(colour) == 3 { - return colour[0:1] + colour[0:1] + colour[1:2] + colour[1:2] + colour[2:3] + colour[2:3] - } - } - return colour -} diff --git a/vendor/github.com/alecthomas/chroma/delegate.go b/vendor/github.com/alecthomas/chroma/delegate.go deleted file mode 100644 index 5cef01bd..00000000 --- a/vendor/github.com/alecthomas/chroma/delegate.go +++ /dev/null @@ -1,137 +0,0 @@ -package chroma - -import ( - "bytes" -) - -type delegatingLexer struct { - root Lexer - language Lexer -} - -// DelegatingLexer combines two lexers to handle the common case of a language embedded inside another, such as PHP -// inside HTML or PHP inside plain text. -// -// It takes two lexer as arguments: a root lexer and a language lexer. First everything is scanned using the language -// lexer, which must return "Other" for unrecognised tokens. Then all "Other" tokens are lexed using the root lexer. -// Finally, these two sets of tokens are merged. -// -// The lexers from the template lexer package use this base lexer. -func DelegatingLexer(root Lexer, language Lexer) Lexer { - return &delegatingLexer{ - root: root, - language: language, - } -} - -func (d *delegatingLexer) Config() *Config { - return d.language.Config() -} - -// An insertion is the character range where language tokens should be inserted. -type insertion struct { - start, end int - tokens []Token -} - -func (d *delegatingLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { // nolint: gocognit - tokens, err := Tokenise(Coalesce(d.language), options, text) - if err != nil { - return nil, err - } - // Compute insertions and gather "Other" tokens. - others := &bytes.Buffer{} - insertions := []*insertion{} - var insert *insertion - offset := 0 - var last Token - for _, t := range tokens { - if t.Type == Other { - if last != EOF && insert != nil && last.Type != Other { - insert.end = offset - } - others.WriteString(t.Value) - } else { - if last == EOF || last.Type == Other { - insert = &insertion{start: offset} - insertions = append(insertions, insert) - } - insert.tokens = append(insert.tokens, t) - } - last = t - offset += len(t.Value) - } - - if len(insertions) == 0 { - return d.root.Tokenise(options, text) - } - - // Lex the other tokens. - rootTokens, err := Tokenise(Coalesce(d.root), options, others.String()) - if err != nil { - return nil, err - } - - // Interleave the two sets of tokens. - var out []Token - offset = 0 // Offset into text. - tokenIndex := 0 - nextToken := func() Token { - if tokenIndex >= len(rootTokens) { - return EOF - } - t := rootTokens[tokenIndex] - tokenIndex++ - return t - } - insertionIndex := 0 - nextInsertion := func() *insertion { - if insertionIndex >= len(insertions) { - return nil - } - i := insertions[insertionIndex] - insertionIndex++ - return i - } - t := nextToken() - i := nextInsertion() - for t != EOF || i != nil { - // fmt.Printf("%d->%d:%q %d->%d:%q\n", offset, offset+len(t.Value), t.Value, i.start, i.end, Stringify(i.tokens...)) - if t == EOF || (i != nil && i.start < offset+len(t.Value)) { - var l Token - l, t = splitToken(t, i.start-offset) - if l != EOF { - out = append(out, l) - offset += len(l.Value) - } - out = append(out, i.tokens...) - offset += i.end - i.start - if t == EOF { - t = nextToken() - } - i = nextInsertion() - } else { - out = append(out, t) - offset += len(t.Value) - t = nextToken() - } - } - return Literator(out...), nil -} - -func splitToken(t Token, offset int) (l Token, r Token) { - if t == EOF { - return EOF, EOF - } - if offset == 0 { - return EOF, t - } - if offset == len(t.Value) { - return t, EOF - } - l = t.Clone() - r = t.Clone() - l.Value = l.Value[:offset] - r.Value = r.Value[offset:] - return -} diff --git a/vendor/github.com/alecthomas/chroma/doc.go b/vendor/github.com/alecthomas/chroma/doc.go deleted file mode 100644 index 4dde77c8..00000000 --- a/vendor/github.com/alecthomas/chroma/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package chroma takes source code and other structured text and converts it into syntax highlighted HTML, ANSI- -// coloured text, etc. -// -// Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles. -// -// For more information, go here: https://github.com/alecthomas/chroma -package chroma diff --git a/vendor/github.com/alecthomas/chroma/formatter.go b/vendor/github.com/alecthomas/chroma/formatter.go deleted file mode 100644 index 00dd5d8d..00000000 --- a/vendor/github.com/alecthomas/chroma/formatter.go +++ /dev/null @@ -1,43 +0,0 @@ -package chroma - -import ( - "io" -) - -// A Formatter for Chroma lexers. -type Formatter interface { - // Format returns a formatting function for tokens. - // - // If the iterator panics, the Formatter should recover. - Format(w io.Writer, style *Style, iterator Iterator) error -} - -// A FormatterFunc is a Formatter implemented as a function. -// -// Guards against iterator panics. -type FormatterFunc func(w io.Writer, style *Style, iterator Iterator) error - -func (f FormatterFunc) Format(w io.Writer, s *Style, it Iterator) (err error) { // nolint - defer func() { - if perr := recover(); perr != nil { - err = perr.(error) - } - }() - return f(w, s, it) -} - -type recoveringFormatter struct { - Formatter -} - -func (r recoveringFormatter) Format(w io.Writer, s *Style, it Iterator) (err error) { - defer func() { - if perr := recover(); perr != nil { - err = perr.(error) - } - }() - return r.Formatter.Format(w, s, it) -} - -// RecoveringFormatter wraps a formatter with panic recovery. -func RecoveringFormatter(formatter Formatter) Formatter { return recoveringFormatter{formatter} } diff --git a/vendor/github.com/alecthomas/chroma/formatters/api.go b/vendor/github.com/alecthomas/chroma/formatters/api.go deleted file mode 100644 index 6da0a24c..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/api.go +++ /dev/null @@ -1,57 +0,0 @@ -package formatters - -import ( - "io" - "sort" - - "github.com/alecthomas/chroma" - "github.com/alecthomas/chroma/formatters/html" - "github.com/alecthomas/chroma/formatters/svg" -) - -var ( - // NoOp formatter. - NoOp = Register("noop", chroma.FormatterFunc(func(w io.Writer, s *chroma.Style, iterator chroma.Iterator) error { - for t := iterator(); t != chroma.EOF; t = iterator() { - if _, err := io.WriteString(w, t.Value); err != nil { - return err - } - } - return nil - })) - // Default HTML formatter outputs self-contained HTML. - htmlFull = Register("html", html.New(html.Standalone(true), html.WithClasses(true))) // nolint - SVG = Register("svg", svg.New(svg.EmbedFont("Liberation Mono", svg.FontLiberationMono, svg.WOFF))) -) - -// Fallback formatter. -var Fallback = NoOp - -// Registry of Formatters. -var Registry = map[string]chroma.Formatter{} - -// Names of registered formatters. -func Names() []string { - out := []string{} - for name := range Registry { - out = append(out, name) - } - sort.Strings(out) - return out -} - -// Get formatter by name. -// -// If the given formatter is not found, the Fallback formatter will be returned. -func Get(name string) chroma.Formatter { - if f, ok := Registry[name]; ok { - return f - } - return Fallback -} - -// Register a named formatter. -func Register(name string, formatter chroma.Formatter) chroma.Formatter { - Registry[name] = formatter - return formatter -} diff --git a/vendor/github.com/alecthomas/chroma/formatters/html/html.go b/vendor/github.com/alecthomas/chroma/formatters/html/html.go deleted file mode 100644 index d3fef2ed..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/html/html.go +++ /dev/null @@ -1,435 +0,0 @@ -package html - -import ( - "fmt" - "html" - "io" - "sort" - "strings" - - "github.com/alecthomas/chroma" -) - -// Option sets an option of the HTML formatter. -type Option func(f *Formatter) - -// Standalone configures the HTML formatter for generating a standalone HTML document. -func Standalone(b bool) Option { return func(f *Formatter) { f.standalone = b } } - -// ClassPrefix sets the CSS class prefix. -func ClassPrefix(prefix string) Option { return func(f *Formatter) { f.prefix = prefix } } - -// WithClasses emits HTML using CSS classes, rather than inline styles. -func WithClasses(b bool) Option { return func(f *Formatter) { f.Classes = b } } - -// TabWidth sets the number of characters for a tab. Defaults to 8. -func TabWidth(width int) Option { return func(f *Formatter) { f.tabWidth = width } } - -// PreventSurroundingPre prevents the surrounding pre tags around the generated code. -func PreventSurroundingPre(b bool) Option { - return func(f *Formatter) { - if b { - f.preWrapper = nopPreWrapper - } else { - f.preWrapper = defaultPreWrapper - } - } -} - -// WithPreWrapper allows control of the surrounding pre tags. -func WithPreWrapper(wrapper PreWrapper) Option { - return func(f *Formatter) { - f.preWrapper = wrapper - } -} - -// WithLineNumbers formats output with line numbers. -func WithLineNumbers(b bool) Option { - return func(f *Formatter) { - f.lineNumbers = b - } -} - -// LineNumbersInTable will, when combined with WithLineNumbers, separate the line numbers -// and code in table td's, which make them copy-and-paste friendly. -func LineNumbersInTable(b bool) Option { - return func(f *Formatter) { - f.lineNumbersInTable = b - } -} - -// LinkableLineNumbers decorates the line numbers HTML elements with an "id" -// attribute so they can be linked. -func LinkableLineNumbers(b bool, prefix string) Option { - return func(f *Formatter) { - f.linkableLineNumbers = b - f.lineNumbersIDPrefix = prefix - } -} - -// HighlightLines higlights the given line ranges with the Highlight style. -// -// A range is the beginning and ending of a range as 1-based line numbers, inclusive. -func HighlightLines(ranges [][2]int) Option { - return func(f *Formatter) { - f.highlightRanges = ranges - sort.Sort(f.highlightRanges) - } -} - -// BaseLineNumber sets the initial number to start line numbering at. Defaults to 1. -func BaseLineNumber(n int) Option { - return func(f *Formatter) { - f.baseLineNumber = n - } -} - -// New HTML formatter. -func New(options ...Option) *Formatter { - f := &Formatter{ - baseLineNumber: 1, - preWrapper: defaultPreWrapper, - } - for _, option := range options { - option(f) - } - return f -} - -// PreWrapper defines the operations supported in WithPreWrapper. -type PreWrapper interface { - // Start is called to write a start
 element.
-	// The code flag tells whether this block surrounds
-	// highlighted code. This will be false when surrounding
-	// line numbers.
-	Start(code bool, styleAttr string) string
-
-	// End is called to write the end 
element. - End(code bool) string -} - -type preWrapper struct { - start func(code bool, styleAttr string) string - end func(code bool) string -} - -func (p preWrapper) Start(code bool, styleAttr string) string { - return p.start(code, styleAttr) -} - -func (p preWrapper) End(code bool) string { - return p.end(code) -} - -var ( - nopPreWrapper = preWrapper{ - start: func(code bool, styleAttr string) string { return "" }, - end: func(code bool) string { return "" }, - } - defaultPreWrapper = preWrapper{ - start: func(code bool, styleAttr string) string { - return fmt.Sprintf("", styleAttr) - }, - end: func(code bool) string { - return "" - }, - } -) - -// Formatter that generates HTML. -type Formatter struct { - standalone bool - prefix string - Classes bool // Exported field to detect when classes are being used - preWrapper PreWrapper - tabWidth int - lineNumbers bool - lineNumbersInTable bool - linkableLineNumbers bool - lineNumbersIDPrefix string - highlightRanges highlightRanges - baseLineNumber int -} - -type highlightRanges [][2]int - -func (h highlightRanges) Len() int { return len(h) } -func (h highlightRanges) Swap(i, j int) { h[i], h[j] = h[j], h[i] } -func (h highlightRanges) Less(i, j int) bool { return h[i][0] < h[j][0] } - -func (f *Formatter) Format(w io.Writer, style *chroma.Style, iterator chroma.Iterator) (err error) { - return f.writeHTML(w, style, iterator.Tokens()) -} - -// We deliberately don't use html/template here because it is two orders of magnitude slower (benchmarked). -// -// OTOH we need to be super careful about correct escaping... -func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.Token) (err error) { // nolint: gocyclo - css := f.styleToCSS(style) - if !f.Classes { - for t, style := range css { - css[t] = compressStyle(style) - } - } - if f.standalone { - fmt.Fprint(w, "\n") - if f.Classes { - fmt.Fprint(w, "") - } - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.Background)) - } - - wrapInTable := f.lineNumbers && f.lineNumbersInTable - - lines := chroma.SplitTokensIntoLines(tokens) - lineDigits := len(fmt.Sprintf("%d", len(lines))) - highlightIndex := 0 - - if wrapInTable { - // List line numbers in its own - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.Background)) - fmt.Fprintf(w, "", f.styleAttr(css, chroma.LineTable)) - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.LineTableTD)) - fmt.Fprintf(w, f.preWrapper.Start(false, f.styleAttr(css, chroma.Background))) - for index := range lines { - line := f.baseLineNumber + index - highlight, next := f.shouldHighlight(highlightIndex, line) - if next { - highlightIndex++ - } - if highlight { - fmt.Fprintf(w, "", f.styleAttr(css, chroma.LineHighlight)) - } - - fmt.Fprintf(w, "%*d\n", f.styleAttr(css, chroma.LineNumbersTable), f.lineIDAttribute(line), lineDigits, line) - - if highlight { - fmt.Fprintf(w, "") - } - } - fmt.Fprint(w, f.preWrapper.End(false)) - fmt.Fprint(w, "\n") - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.LineTableTD, "width:100%")) - } - - fmt.Fprintf(w, f.preWrapper.Start(true, f.styleAttr(css, chroma.Background))) - - highlightIndex = 0 - for index, tokens := range lines { - // 1-based line number. - line := f.baseLineNumber + index - highlight, next := f.shouldHighlight(highlightIndex, line) - if next { - highlightIndex++ - } - if highlight { - fmt.Fprintf(w, "", f.styleAttr(css, chroma.LineHighlight)) - } - - if f.lineNumbers && !wrapInTable { - fmt.Fprintf(w, "%*d", f.styleAttr(css, chroma.LineNumbers), f.lineIDAttribute(line), lineDigits, line) - } - - for _, token := range tokens { - html := html.EscapeString(token.String()) - attr := f.styleAttr(css, token.Type) - if attr != "" { - html = fmt.Sprintf("%s", attr, html) - } - fmt.Fprint(w, html) - } - if highlight { - fmt.Fprintf(w, "") - } - } - - fmt.Fprintf(w, f.preWrapper.End(true)) - - if wrapInTable { - fmt.Fprint(w, "\n") - fmt.Fprint(w, "\n") - } - - if f.standalone { - fmt.Fprint(w, "\n\n") - fmt.Fprint(w, "\n") - } - - return nil -} - -func (f *Formatter) lineIDAttribute(line int) string { - if !f.linkableLineNumbers { - return "" - } - return fmt.Sprintf(" id=\"%s%d\"", f.lineNumbersIDPrefix, line) -} - -func (f *Formatter) shouldHighlight(highlightIndex, line int) (bool, bool) { - next := false - for highlightIndex < len(f.highlightRanges) && line > f.highlightRanges[highlightIndex][1] { - highlightIndex++ - next = true - } - if highlightIndex < len(f.highlightRanges) { - hrange := f.highlightRanges[highlightIndex] - if line >= hrange[0] && line <= hrange[1] { - return true, next - } - } - return false, next -} - -func (f *Formatter) class(t chroma.TokenType) string { - for t != 0 { - if cls, ok := chroma.StandardTypes[t]; ok { - if cls != "" { - return f.prefix + cls - } - return "" - } - t = t.Parent() - } - if cls := chroma.StandardTypes[t]; cls != "" { - return f.prefix + cls - } - return "" -} - -func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.TokenType, extraCSS ...string) string { - if f.Classes { - cls := f.class(tt) - if cls == "" { - return "" - } - return fmt.Sprintf(` class="%s"`, cls) - } - if _, ok := styles[tt]; !ok { - tt = tt.SubCategory() - if _, ok := styles[tt]; !ok { - tt = tt.Category() - if _, ok := styles[tt]; !ok { - return "" - } - } - } - css := []string{styles[tt]} - css = append(css, extraCSS...) - return fmt.Sprintf(` style="%s"`, strings.Join(css, ";")) -} - -func (f *Formatter) tabWidthStyle() string { - if f.tabWidth != 0 && f.tabWidth != 8 { - return fmt.Sprintf("; -moz-tab-size: %[1]d; -o-tab-size: %[1]d; tab-size: %[1]d", f.tabWidth) - } - return "" -} - -// WriteCSS writes CSS style definitions (without any surrounding HTML). -func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error { - css := f.styleToCSS(style) - // Special-case background as it is mapped to the outer ".chroma" class. - if _, err := fmt.Fprintf(w, "/* %s */ .%schroma { %s }\n", chroma.Background, f.prefix, css[chroma.Background]); err != nil { - return err - } - // Special-case code column of table to expand width. - if f.lineNumbers && f.lineNumbersInTable { - if _, err := fmt.Fprintf(w, "/* %s */ .%schroma .%s:last-child { width: 100%%; }", - chroma.LineTableTD, f.prefix, f.class(chroma.LineTableTD)); err != nil { - return err - } - } - // Special-case line number highlighting when targeted. - if f.lineNumbers || f.lineNumbersInTable { - targetedLineCSS := StyleEntryToCSS(style.Get(chroma.LineHighlight)) - for _, tt := range []chroma.TokenType{chroma.LineNumbers, chroma.LineNumbersTable} { - fmt.Fprintf(w, "/* %s targeted by URL anchor */ .%schroma .%s:target { %s }\n", tt, f.prefix, f.class(tt), targetedLineCSS) - } - } - tts := []int{} - for tt := range css { - tts = append(tts, int(tt)) - } - sort.Ints(tts) - for _, ti := range tts { - tt := chroma.TokenType(ti) - if tt == chroma.Background { - continue - } - styles := css[tt] - if _, err := fmt.Fprintf(w, "/* %s */ .%schroma .%s { %s }\n", tt, f.prefix, f.class(tt), styles); err != nil { - return err - } - } - return nil -} - -func (f *Formatter) styleToCSS(style *chroma.Style) map[chroma.TokenType]string { - classes := map[chroma.TokenType]string{} - bg := style.Get(chroma.Background) - // Convert the style. - for t := range chroma.StandardTypes { - entry := style.Get(t) - if t != chroma.Background { - entry = entry.Sub(bg) - } - if entry.IsZero() { - continue - } - classes[t] = StyleEntryToCSS(entry) - } - classes[chroma.Background] += f.tabWidthStyle() - lineNumbersStyle := "margin-right: 0.4em; padding: 0 0.4em 0 0.4em;" - // All rules begin with default rules followed by user provided rules - classes[chroma.LineNumbers] = lineNumbersStyle + classes[chroma.LineNumbers] - classes[chroma.LineNumbersTable] = lineNumbersStyle + classes[chroma.LineNumbersTable] - classes[chroma.LineHighlight] = "display: block; width: 100%;" + classes[chroma.LineHighlight] - classes[chroma.LineTable] = "border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block;" + classes[chroma.LineTable] - classes[chroma.LineTableTD] = "vertical-align: top; padding: 0; margin: 0; border: 0;" + classes[chroma.LineTableTD] - return classes -} - -// StyleEntryToCSS converts a chroma.StyleEntry to CSS attributes. -func StyleEntryToCSS(e chroma.StyleEntry) string { - styles := []string{} - if e.Colour.IsSet() { - styles = append(styles, "color: "+e.Colour.String()) - } - if e.Background.IsSet() { - styles = append(styles, "background-color: "+e.Background.String()) - } - if e.Bold == chroma.Yes { - styles = append(styles, "font-weight: bold") - } - if e.Italic == chroma.Yes { - styles = append(styles, "font-style: italic") - } - if e.Underline == chroma.Yes { - styles = append(styles, "text-decoration: underline") - } - return strings.Join(styles, "; ") -} - -// Compress CSS attributes - remove spaces, transform 6-digit colours to 3. -func compressStyle(s string) string { - parts := strings.Split(s, ";") - out := []string{} - for _, p := range parts { - p = strings.Join(strings.Fields(p), " ") - p = strings.Replace(p, ": ", ":", 1) - if strings.Contains(p, "#") { - c := p[len(p)-6:] - if c[0] == c[1] && c[2] == c[3] && c[4] == c[5] { - p = p[:len(p)-6] + c[0:1] + c[2:3] + c[4:5] - } - } - out = append(out, p) - } - return strings.Join(out, ";") -} diff --git a/vendor/github.com/alecthomas/chroma/formatters/json.go b/vendor/github.com/alecthomas/chroma/formatters/json.go deleted file mode 100644 index 95df4bb6..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/json.go +++ /dev/null @@ -1,31 +0,0 @@ -package formatters - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/alecthomas/chroma" -) - -// JSON formatter outputs the raw token structures as JSON. -var JSON = Register("json", chroma.FormatterFunc(func(w io.Writer, s *chroma.Style, it chroma.Iterator) error { - fmt.Fprintln(w, "[") - i := 0 - for t := it(); t != chroma.EOF; t = it() { - if i > 0 { - fmt.Fprintln(w, ",") - } - i++ - bytes, err := json.Marshal(t) - if err != nil { - return err - } - if _, err := fmt.Fprint(w, " "+string(bytes)); err != nil { - return err - } - } - fmt.Fprintln(w) - fmt.Fprintln(w, "]") - return nil -})) diff --git a/vendor/github.com/alecthomas/chroma/formatters/svg/font_liberation_mono.go b/vendor/github.com/alecthomas/chroma/formatters/svg/font_liberation_mono.go deleted file mode 100644 index 70d692ec..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/svg/font_liberation_mono.go +++ /dev/null @@ -1,51 +0,0 @@ -// Digitized data copyright (c) 2010 Google Corporation -// with Reserved Font Arimo, Tinos and Cousine. -// Copyright (c) 2012 Red Hat, Inc. -// with Reserved Font Name Liberation. -// -// This Font Software is licensed under the SIL Open Font License, Version 1.1. -// This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL -// -// ----------------------------------------------------------- -// SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 -// ----------------------------------------------------------- -// -// PREAMBLE -// The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. -// -// The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. -// -// DEFINITIONS -// "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. -// -// "Reserved Font Name" refers to any names specified as such after the copyright statement(s). -// -// "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). -// -// "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. -// -// "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. -// -// PERMISSION & CONDITIONS -// Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: -// -// 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. -// -// 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. -// -// 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. -// -// 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. -// -// 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. -// -// TERMINATION -// This license becomes null and void if any of the above conditions are not met. -// -// DISCLAIMER -// THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. - -package svg - -// Liberation Mono as base64 encoded woff (SIL Open Font License)[https://en.wikipedia.org/wiki/Liberation_fonts] -var FontLiberationMono = `d09GRgABAAAAAqtYABIAAAAEycAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAKrPAAAABwAAAAcdooU5UdERUYAAp6sAAAAcAAAAIZxBHoIR1BPUwACoNwAAApfAAAzLnW/WuJHU1VCAAKfHAAAAb4AAALi0BntuE9TLzIAAAIQAAAAYAAAAGAAbrqGY21hcAAADmgAAARSAAAGPmw6RjVjdnQgAAAbpAAAAZ8AAAKuZwZtV2ZwZ20AABK8AAAEqQAAB7R+YbYRZ2FzcAACnpwAAAAQAAAAEAAYAAlnbHlmAAA0mAACOjQAA8hUF/4NBGhlYWQAAAGUAAAANgAAADYELjhMaGhlYQAAAcwAAAAhAAAAJAjCBstobXR4AAACcAAAC/UAACV4+gaVVWxvY2EAAB1EAAAXVAAAJXwSZmZ8bWF4cAAAAfAAAAAgAAAAIA3VBMBuYW1lAAJuzAAABTkAAAumb4o3f3Bvc3QAAnQIAAAqlAAAW+Bx9Ia5cHJlcAAAF2gAAAQ8AAAFesjzjI8AAQAAAAIAABUZ4O5fDzz1Ah8IAAAAAADIQ3qnAAAAANiiczX8Jf2ZBfEH2QAAAAgAAAABAAAAAHjaY2BkYGBb+XcmAwNr5B/VX1WsHxmAIsiAMw4AmuUGmAAAAAABAAAJXgEiAEgAWwAGAAIAEAAvAFwAAAO5AxEAAwABAAMEzQGQAAUAAAWaBTMAAAEdBZoFMwAAA2EAZgISCAUCBwQJAgIFAgQE4AAK/0AAeP8AAAABAAAAADFBU0MAQAAg/iME5/5+AAAGqQJnYAABv9/3AAAEOgVFAAAAIAAOeNqlWglwVd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YTcealeG14rwfA3PSxOSO5IjPL9cPysCYvY7y28iywdHzGL5+hbqlPid9/ZbTPAehs3O48/tTszJiVqBlBnPNquWp4Y8ZPt3bqXAkXK4qvNW305bruNZ6YuXqrLe/IQYMv4Oti7mdVoMpPowwv5HYmF0L3E6N5zEqQo4RHwblZJuXAS4JygbPAO+7m4Gq+NlzbLoxlDD9dg8djwYTqdkbaiCqZv8ACwg/od/OSq2EPZ/MfNli/GcehEwLLWEpy7Js621ruvUD+6J5F3bN/sy+Yd+0b9mf21/YX9n9FM1q8iYhB+bDQt0yjj9UDw3enwLLQ1Ns+eGUWX40ZZYfT5nlbydgWVdiXkAlOnYTt+hEOmpRr6mSzFO08wQ9FDV+YfV73FFJzP6jBO1/E1r/RoL6V92xD6t/3x3RsPoPE9S/mqD+jQT1exLU/zJB/SGmn0dXVkEzI9ttMYtZ7H35hQRaaSG1v3O1vz/Pwy2jX3nQk5XGViZpZGgkqjhW4kfXZuP4mvIWQ+ZRVTBJvQ+ZPMpXZHy0ej37nHfscAzMSZsncTXbQuQhoO/cF48kjh2H3+XLQyShL35Gd7JePls4X/K46NRs95tdswm/X+PvwhbFvmdMtNXUYfh43Hevqz1M2GN72Gy8et+j3mp57/jC1+xEdt/mkAftXb+9ayDaTrSLSD+hNxE1E7UQHSbST/P6reAZoveJLhDp979XiPRbu5tEd4juEunV0AOiQaJh6skyfY8JhbNDayaINCc1PvPQncdtb/o8dr6P8mGYLz6YprNLMglfkZROjp1x4mkP4F8BsXnys+HYHP0GzFi+5SHTDD+Px34noncX9bcXKxL+wmh0Ny4ITzO+i+0nBbeq+1+4F45z1R4KodPMvrzpfB33yMBIgr5xmWKcpF7/V9wLZb2+98h681QyyvsRzH96xNeJGOxiWB8KIdiv/u8NXMF21cya8F8Do38v6uOsETOc/+DQX8HTuq5zpNhZ5/0b9HXxHAAAAAABAAAAANWkJwgAAAAAyEN6pwAAAADYonM1` diff --git a/vendor/github.com/alecthomas/chroma/formatters/svg/svg.go b/vendor/github.com/alecthomas/chroma/formatters/svg/svg.go deleted file mode 100644 index 631fa148..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/svg/svg.go +++ /dev/null @@ -1,222 +0,0 @@ -// Package svg contains an SVG formatter. -package svg - -import ( - "encoding/base64" - "errors" - "fmt" - "io" - "io/ioutil" - "path" - "strings" - - "github.com/alecthomas/chroma" -) - -// Option sets an option of the SVG formatter. -type Option func(f *Formatter) - -// FontFamily sets the font-family. -func FontFamily(fontFamily string) Option { return func(f *Formatter) { f.fontFamily = fontFamily } } - -// EmbedFontFile embeds given font file -func EmbedFontFile(fontFamily string, fileName string) (option Option, err error) { - var format FontFormat - switch path.Ext(fileName) { - case ".woff": - format = WOFF - case ".woff2": - format = WOFF2 - case ".ttf": - format = TRUETYPE - default: - return nil, errors.New("unexpected font file suffix") - } - - var content []byte - if content, err = ioutil.ReadFile(fileName); err == nil { - option = EmbedFont(fontFamily, base64.StdEncoding.EncodeToString(content), format) - } - return -} - -// EmbedFont embeds given base64 encoded font -func EmbedFont(fontFamily string, font string, format FontFormat) Option { - return func(f *Formatter) { f.fontFamily = fontFamily; f.embeddedFont = font; f.fontFormat = format } -} - -// New SVG formatter. -func New(options ...Option) *Formatter { - f := &Formatter{fontFamily: "Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace"} - for _, option := range options { - option(f) - } - return f -} - -// Formatter that generates SVG. -type Formatter struct { - fontFamily string - embeddedFont string - fontFormat FontFormat -} - -func (f *Formatter) Format(w io.Writer, style *chroma.Style, iterator chroma.Iterator) (err error) { - f.writeSVG(w, style, iterator.Tokens()) - return err -} - -var svgEscaper = strings.NewReplacer( - `&`, "&", - `<`, "<", - `>`, ">", - `"`, """, - ` `, " ", - ` `, "    ", -) - -// EscapeString escapes special characters. -func escapeString(s string) string { - return svgEscaper.Replace(s) -} - -func (f *Formatter) writeSVG(w io.Writer, style *chroma.Style, tokens []chroma.Token) { // nolint: gocyclo - svgStyles := f.styleToSVG(style) - lines := chroma.SplitTokensIntoLines(tokens) - - fmt.Fprint(w, "\n") - fmt.Fprint(w, "\n") - fmt.Fprintf(w, "\n", 8*maxLineWidth(lines), 10+int(16.8*float64(len(lines)+1))) - - if f.embeddedFont != "" { - f.writeFontStyle(w) - } - - fmt.Fprintf(w, "\n", style.Get(chroma.Background).Background.String()) - fmt.Fprintf(w, "\n", f.fontFamily, style.Get(chroma.Text).Colour.String()) - - f.writeTokenBackgrounds(w, lines, style) - - for index, tokens := range lines { - fmt.Fprintf(w, "", 1.2*float64(index+1)) - - for _, token := range tokens { - text := escapeString(token.String()) - attr := f.styleAttr(svgStyles, token.Type) - if attr != "" { - text = fmt.Sprintf("%s", attr, text) - } - fmt.Fprint(w, text) - } - fmt.Fprint(w, "") - } - - fmt.Fprint(w, "\n\n") - fmt.Fprint(w, "\n") -} - -func maxLineWidth(lines [][]chroma.Token) int { - maxWidth := 0 - for _, tokens := range lines { - length := 0 - for _, token := range tokens { - length += len(strings.Replace(token.String(), ` `, " ", -1)) - } - if length > maxWidth { - maxWidth = length - } - } - return maxWidth -} - -// There is no background attribute for text in SVG so simply calculate the position and text -// of tokens with a background color that differs from the default and add a rectangle for each before -// adding the token. -func (f *Formatter) writeTokenBackgrounds(w io.Writer, lines [][]chroma.Token, style *chroma.Style) { - for index, tokens := range lines { - lineLength := 0 - for _, token := range tokens { - length := len(strings.Replace(token.String(), ` `, " ", -1)) - tokenBackground := style.Get(token.Type).Background - if tokenBackground.IsSet() && tokenBackground != style.Get(chroma.Background).Background { - fmt.Fprintf(w, "\n", escapeString(token.String()), lineLength, 1.2*float64(index)+0.25, length, style.Get(token.Type).Background.String()) - } - lineLength += length - } - } -} - -type FontFormat int - -// https://transfonter.org/formats -const ( - WOFF FontFormat = iota - WOFF2 - TRUETYPE -) - -var fontFormats = [...]string{ - "woff", - "woff2", - "truetype", -} - -func (f *Formatter) writeFontStyle(w io.Writer) { - fmt.Fprintf(w, ``, f.fontFamily, fontFormats[f.fontFormat], f.embeddedFont, fontFormats[f.fontFormat]) -} - -func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.TokenType) string { - if _, ok := styles[tt]; !ok { - tt = tt.SubCategory() - if _, ok := styles[tt]; !ok { - tt = tt.Category() - if _, ok := styles[tt]; !ok { - return "" - } - } - } - return styles[tt] -} - -func (f *Formatter) styleToSVG(style *chroma.Style) map[chroma.TokenType]string { - converted := map[chroma.TokenType]string{} - bg := style.Get(chroma.Background) - // Convert the style. - for t := range chroma.StandardTypes { - entry := style.Get(t) - if t != chroma.Background { - entry = entry.Sub(bg) - } - if entry.IsZero() { - continue - } - converted[t] = StyleEntryToSVG(entry) - } - return converted -} - -// StyleEntryToSVG converts a chroma.StyleEntry to SVG attributes. -func StyleEntryToSVG(e chroma.StyleEntry) string { - var styles []string - - if e.Colour.IsSet() { - styles = append(styles, "fill=\""+e.Colour.String()+"\"") - } - if e.Bold == chroma.Yes { - styles = append(styles, "font-weight=\"bold\"") - } - if e.Italic == chroma.Yes { - styles = append(styles, "font-style=\"italic\"") - } - if e.Underline == chroma.Yes { - styles = append(styles, "text-decoration=\"underline\"") - } - return strings.Join(styles, " ") -} diff --git a/vendor/github.com/alecthomas/chroma/formatters/tokens.go b/vendor/github.com/alecthomas/chroma/formatters/tokens.go deleted file mode 100644 index 91d80d14..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/tokens.go +++ /dev/null @@ -1,18 +0,0 @@ -package formatters - -import ( - "fmt" - "io" - - "github.com/alecthomas/chroma" -) - -// Tokens formatter outputs the raw token structures. -var Tokens = Register("tokens", chroma.FormatterFunc(func(w io.Writer, s *chroma.Style, it chroma.Iterator) error { - for t := it(); t != chroma.EOF; t = it() { - if _, err := fmt.Fprintln(w, t.GoString()); err != nil { - return err - } - } - return nil -})) diff --git a/vendor/github.com/alecthomas/chroma/formatters/tty_indexed.go b/vendor/github.com/alecthomas/chroma/formatters/tty_indexed.go deleted file mode 100644 index eb90ea7c..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/tty_indexed.go +++ /dev/null @@ -1,260 +0,0 @@ -package formatters - -import ( - "fmt" - "io" - "math" - - "github.com/alecthomas/chroma" -) - -type ttyTable struct { - foreground map[chroma.Colour]string - background map[chroma.Colour]string -} - -var c = chroma.MustParseColour - -var ttyTables = map[int]*ttyTable{ - 8: { - foreground: map[chroma.Colour]string{ - c("#000000"): "\033[30m", c("#7f0000"): "\033[31m", c("#007f00"): "\033[32m", c("#7f7fe0"): "\033[33m", - c("#00007f"): "\033[34m", c("#7f007f"): "\033[35m", c("#007f7f"): "\033[36m", c("#e5e5e5"): "\033[37m", - c("#555555"): "\033[90m", c("#ff0000"): "\033[91m", c("#00ff00"): "\033[92m", c("#ffff00"): "\033[93m", - c("#0000ff"): "\033[94m", c("#ff00ff"): "\033[95m", c("#00ffff"): "\033[96m", c("#ffffff"): "\033[97m", - }, - background: map[chroma.Colour]string{ - c("#000000"): "\033[40m", c("#7f0000"): "\033[41m", c("#007f00"): "\033[42m", c("#7f7fe0"): "\033[43m", - c("#00007f"): "\033[44m", c("#7f007f"): "\033[45m", c("#007f7f"): "\033[46m", c("#e5e5e5"): "\033[47m", - c("#555555"): "\033[100m", c("#ff0000"): "\033[101m", c("#00ff00"): "\033[102m", c("#ffff00"): "\033[103m", - c("#0000ff"): "\033[104m", c("#ff00ff"): "\033[105m", c("#00ffff"): "\033[106m", c("#ffffff"): "\033[107m", - }, - }, - 256: { - foreground: map[chroma.Colour]string{ - c("#000000"): "\033[38;5;0m", c("#800000"): "\033[38;5;1m", c("#008000"): "\033[38;5;2m", c("#808000"): "\033[38;5;3m", - c("#000080"): "\033[38;5;4m", c("#800080"): "\033[38;5;5m", c("#008080"): "\033[38;5;6m", c("#c0c0c0"): "\033[38;5;7m", - c("#808080"): "\033[38;5;8m", c("#ff0000"): "\033[38;5;9m", c("#00ff00"): "\033[38;5;10m", c("#ffff00"): "\033[38;5;11m", - c("#0000ff"): "\033[38;5;12m", c("#ff00ff"): "\033[38;5;13m", c("#00ffff"): "\033[38;5;14m", c("#ffffff"): "\033[38;5;15m", - c("#000000"): "\033[38;5;16m", c("#00005f"): "\033[38;5;17m", c("#000087"): "\033[38;5;18m", c("#0000af"): "\033[38;5;19m", - c("#0000d7"): "\033[38;5;20m", c("#0000ff"): "\033[38;5;21m", c("#005f00"): "\033[38;5;22m", c("#005f5f"): "\033[38;5;23m", - c("#005f87"): "\033[38;5;24m", c("#005faf"): "\033[38;5;25m", c("#005fd7"): "\033[38;5;26m", c("#005fff"): "\033[38;5;27m", - c("#008700"): "\033[38;5;28m", c("#00875f"): "\033[38;5;29m", c("#008787"): "\033[38;5;30m", c("#0087af"): "\033[38;5;31m", - c("#0087d7"): "\033[38;5;32m", c("#0087ff"): "\033[38;5;33m", c("#00af00"): "\033[38;5;34m", c("#00af5f"): "\033[38;5;35m", - c("#00af87"): "\033[38;5;36m", c("#00afaf"): "\033[38;5;37m", c("#00afd7"): "\033[38;5;38m", c("#00afff"): "\033[38;5;39m", - c("#00d700"): "\033[38;5;40m", c("#00d75f"): "\033[38;5;41m", c("#00d787"): "\033[38;5;42m", c("#00d7af"): "\033[38;5;43m", - c("#00d7d7"): "\033[38;5;44m", c("#00d7ff"): "\033[38;5;45m", c("#00ff00"): "\033[38;5;46m", c("#00ff5f"): "\033[38;5;47m", - c("#00ff87"): "\033[38;5;48m", c("#00ffaf"): "\033[38;5;49m", c("#00ffd7"): "\033[38;5;50m", c("#00ffff"): "\033[38;5;51m", - c("#5f0000"): "\033[38;5;52m", c("#5f005f"): "\033[38;5;53m", c("#5f0087"): "\033[38;5;54m", c("#5f00af"): "\033[38;5;55m", - c("#5f00d7"): "\033[38;5;56m", c("#5f00ff"): "\033[38;5;57m", c("#5f5f00"): "\033[38;5;58m", c("#5f5f5f"): "\033[38;5;59m", - c("#5f5f87"): "\033[38;5;60m", c("#5f5faf"): "\033[38;5;61m", c("#5f5fd7"): "\033[38;5;62m", c("#5f5fff"): "\033[38;5;63m", - c("#5f8700"): "\033[38;5;64m", c("#5f875f"): "\033[38;5;65m", c("#5f8787"): "\033[38;5;66m", c("#5f87af"): "\033[38;5;67m", - c("#5f87d7"): "\033[38;5;68m", c("#5f87ff"): "\033[38;5;69m", c("#5faf00"): "\033[38;5;70m", c("#5faf5f"): "\033[38;5;71m", - c("#5faf87"): "\033[38;5;72m", c("#5fafaf"): "\033[38;5;73m", c("#5fafd7"): "\033[38;5;74m", c("#5fafff"): "\033[38;5;75m", - c("#5fd700"): "\033[38;5;76m", c("#5fd75f"): "\033[38;5;77m", c("#5fd787"): "\033[38;5;78m", c("#5fd7af"): "\033[38;5;79m", - c("#5fd7d7"): "\033[38;5;80m", c("#5fd7ff"): "\033[38;5;81m", c("#5fff00"): "\033[38;5;82m", c("#5fff5f"): "\033[38;5;83m", - c("#5fff87"): "\033[38;5;84m", c("#5fffaf"): "\033[38;5;85m", c("#5fffd7"): "\033[38;5;86m", c("#5fffff"): "\033[38;5;87m", - c("#870000"): "\033[38;5;88m", c("#87005f"): "\033[38;5;89m", c("#870087"): "\033[38;5;90m", c("#8700af"): "\033[38;5;91m", - c("#8700d7"): "\033[38;5;92m", c("#8700ff"): "\033[38;5;93m", c("#875f00"): "\033[38;5;94m", c("#875f5f"): "\033[38;5;95m", - c("#875f87"): "\033[38;5;96m", c("#875faf"): "\033[38;5;97m", c("#875fd7"): "\033[38;5;98m", c("#875fff"): "\033[38;5;99m", - c("#878700"): "\033[38;5;100m", c("#87875f"): "\033[38;5;101m", c("#878787"): "\033[38;5;102m", c("#8787af"): "\033[38;5;103m", - c("#8787d7"): "\033[38;5;104m", c("#8787ff"): "\033[38;5;105m", c("#87af00"): "\033[38;5;106m", c("#87af5f"): "\033[38;5;107m", - c("#87af87"): "\033[38;5;108m", c("#87afaf"): "\033[38;5;109m", c("#87afd7"): "\033[38;5;110m", c("#87afff"): "\033[38;5;111m", - c("#87d700"): "\033[38;5;112m", c("#87d75f"): "\033[38;5;113m", c("#87d787"): "\033[38;5;114m", c("#87d7af"): "\033[38;5;115m", - c("#87d7d7"): "\033[38;5;116m", c("#87d7ff"): "\033[38;5;117m", c("#87ff00"): "\033[38;5;118m", c("#87ff5f"): "\033[38;5;119m", - c("#87ff87"): "\033[38;5;120m", c("#87ffaf"): "\033[38;5;121m", c("#87ffd7"): "\033[38;5;122m", c("#87ffff"): "\033[38;5;123m", - c("#af0000"): "\033[38;5;124m", c("#af005f"): "\033[38;5;125m", c("#af0087"): "\033[38;5;126m", c("#af00af"): "\033[38;5;127m", - c("#af00d7"): "\033[38;5;128m", c("#af00ff"): "\033[38;5;129m", c("#af5f00"): "\033[38;5;130m", c("#af5f5f"): "\033[38;5;131m", - c("#af5f87"): "\033[38;5;132m", c("#af5faf"): "\033[38;5;133m", c("#af5fd7"): "\033[38;5;134m", c("#af5fff"): "\033[38;5;135m", - c("#af8700"): "\033[38;5;136m", c("#af875f"): "\033[38;5;137m", c("#af8787"): "\033[38;5;138m", c("#af87af"): "\033[38;5;139m", - c("#af87d7"): "\033[38;5;140m", c("#af87ff"): "\033[38;5;141m", c("#afaf00"): "\033[38;5;142m", c("#afaf5f"): "\033[38;5;143m", - c("#afaf87"): "\033[38;5;144m", c("#afafaf"): "\033[38;5;145m", c("#afafd7"): "\033[38;5;146m", c("#afafff"): "\033[38;5;147m", - c("#afd700"): "\033[38;5;148m", c("#afd75f"): "\033[38;5;149m", c("#afd787"): "\033[38;5;150m", c("#afd7af"): "\033[38;5;151m", - c("#afd7d7"): "\033[38;5;152m", c("#afd7ff"): "\033[38;5;153m", c("#afff00"): "\033[38;5;154m", c("#afff5f"): "\033[38;5;155m", - c("#afff87"): "\033[38;5;156m", c("#afffaf"): "\033[38;5;157m", c("#afffd7"): "\033[38;5;158m", c("#afffff"): "\033[38;5;159m", - c("#d70000"): "\033[38;5;160m", c("#d7005f"): "\033[38;5;161m", c("#d70087"): "\033[38;5;162m", c("#d700af"): "\033[38;5;163m", - c("#d700d7"): "\033[38;5;164m", c("#d700ff"): "\033[38;5;165m", c("#d75f00"): "\033[38;5;166m", c("#d75f5f"): "\033[38;5;167m", - c("#d75f87"): "\033[38;5;168m", c("#d75faf"): "\033[38;5;169m", c("#d75fd7"): "\033[38;5;170m", c("#d75fff"): "\033[38;5;171m", - c("#d78700"): "\033[38;5;172m", c("#d7875f"): "\033[38;5;173m", c("#d78787"): "\033[38;5;174m", c("#d787af"): "\033[38;5;175m", - c("#d787d7"): "\033[38;5;176m", c("#d787ff"): "\033[38;5;177m", c("#d7af00"): "\033[38;5;178m", c("#d7af5f"): "\033[38;5;179m", - c("#d7af87"): "\033[38;5;180m", c("#d7afaf"): "\033[38;5;181m", c("#d7afd7"): "\033[38;5;182m", c("#d7afff"): "\033[38;5;183m", - c("#d7d700"): "\033[38;5;184m", c("#d7d75f"): "\033[38;5;185m", c("#d7d787"): "\033[38;5;186m", c("#d7d7af"): "\033[38;5;187m", - c("#d7d7d7"): "\033[38;5;188m", c("#d7d7ff"): "\033[38;5;189m", c("#d7ff00"): "\033[38;5;190m", c("#d7ff5f"): "\033[38;5;191m", - c("#d7ff87"): "\033[38;5;192m", c("#d7ffaf"): "\033[38;5;193m", c("#d7ffd7"): "\033[38;5;194m", c("#d7ffff"): "\033[38;5;195m", - c("#ff0000"): "\033[38;5;196m", c("#ff005f"): "\033[38;5;197m", c("#ff0087"): "\033[38;5;198m", c("#ff00af"): "\033[38;5;199m", - c("#ff00d7"): "\033[38;5;200m", c("#ff00ff"): "\033[38;5;201m", c("#ff5f00"): "\033[38;5;202m", c("#ff5f5f"): "\033[38;5;203m", - c("#ff5f87"): "\033[38;5;204m", c("#ff5faf"): "\033[38;5;205m", c("#ff5fd7"): "\033[38;5;206m", c("#ff5fff"): "\033[38;5;207m", - c("#ff8700"): "\033[38;5;208m", c("#ff875f"): "\033[38;5;209m", c("#ff8787"): "\033[38;5;210m", c("#ff87af"): "\033[38;5;211m", - c("#ff87d7"): "\033[38;5;212m", c("#ff87ff"): "\033[38;5;213m", c("#ffaf00"): "\033[38;5;214m", c("#ffaf5f"): "\033[38;5;215m", - c("#ffaf87"): "\033[38;5;216m", c("#ffafaf"): "\033[38;5;217m", c("#ffafd7"): "\033[38;5;218m", c("#ffafff"): "\033[38;5;219m", - c("#ffd700"): "\033[38;5;220m", c("#ffd75f"): "\033[38;5;221m", c("#ffd787"): "\033[38;5;222m", c("#ffd7af"): "\033[38;5;223m", - c("#ffd7d7"): "\033[38;5;224m", c("#ffd7ff"): "\033[38;5;225m", c("#ffff00"): "\033[38;5;226m", c("#ffff5f"): "\033[38;5;227m", - c("#ffff87"): "\033[38;5;228m", c("#ffffaf"): "\033[38;5;229m", c("#ffffd7"): "\033[38;5;230m", c("#ffffff"): "\033[38;5;231m", - c("#080808"): "\033[38;5;232m", c("#121212"): "\033[38;5;233m", c("#1c1c1c"): "\033[38;5;234m", c("#262626"): "\033[38;5;235m", - c("#303030"): "\033[38;5;236m", c("#3a3a3a"): "\033[38;5;237m", c("#444444"): "\033[38;5;238m", c("#4e4e4e"): "\033[38;5;239m", - c("#585858"): "\033[38;5;240m", c("#626262"): "\033[38;5;241m", c("#6c6c6c"): "\033[38;5;242m", c("#767676"): "\033[38;5;243m", - c("#808080"): "\033[38;5;244m", c("#8a8a8a"): "\033[38;5;245m", c("#949494"): "\033[38;5;246m", c("#9e9e9e"): "\033[38;5;247m", - c("#a8a8a8"): "\033[38;5;248m", c("#b2b2b2"): "\033[38;5;249m", c("#bcbcbc"): "\033[38;5;250m", c("#c6c6c6"): "\033[38;5;251m", - c("#d0d0d0"): "\033[38;5;252m", c("#dadada"): "\033[38;5;253m", c("#e4e4e4"): "\033[38;5;254m", c("#eeeeee"): "\033[38;5;255m", - }, - background: map[chroma.Colour]string{ - c("#000000"): "\033[48;5;0m", c("#800000"): "\033[48;5;1m", c("#008000"): "\033[48;5;2m", c("#808000"): "\033[48;5;3m", - c("#000080"): "\033[48;5;4m", c("#800080"): "\033[48;5;5m", c("#008080"): "\033[48;5;6m", c("#c0c0c0"): "\033[48;5;7m", - c("#808080"): "\033[48;5;8m", c("#ff0000"): "\033[48;5;9m", c("#00ff00"): "\033[48;5;10m", c("#ffff00"): "\033[48;5;11m", - c("#0000ff"): "\033[48;5;12m", c("#ff00ff"): "\033[48;5;13m", c("#00ffff"): "\033[48;5;14m", c("#ffffff"): "\033[48;5;15m", - c("#000000"): "\033[48;5;16m", c("#00005f"): "\033[48;5;17m", c("#000087"): "\033[48;5;18m", c("#0000af"): "\033[48;5;19m", - c("#0000d7"): "\033[48;5;20m", c("#0000ff"): "\033[48;5;21m", c("#005f00"): "\033[48;5;22m", c("#005f5f"): "\033[48;5;23m", - c("#005f87"): "\033[48;5;24m", c("#005faf"): "\033[48;5;25m", c("#005fd7"): "\033[48;5;26m", c("#005fff"): "\033[48;5;27m", - c("#008700"): "\033[48;5;28m", c("#00875f"): "\033[48;5;29m", c("#008787"): "\033[48;5;30m", c("#0087af"): "\033[48;5;31m", - c("#0087d7"): "\033[48;5;32m", c("#0087ff"): "\033[48;5;33m", c("#00af00"): "\033[48;5;34m", c("#00af5f"): "\033[48;5;35m", - c("#00af87"): "\033[48;5;36m", c("#00afaf"): "\033[48;5;37m", c("#00afd7"): "\033[48;5;38m", c("#00afff"): "\033[48;5;39m", - c("#00d700"): "\033[48;5;40m", c("#00d75f"): "\033[48;5;41m", c("#00d787"): "\033[48;5;42m", c("#00d7af"): "\033[48;5;43m", - c("#00d7d7"): "\033[48;5;44m", c("#00d7ff"): "\033[48;5;45m", c("#00ff00"): "\033[48;5;46m", c("#00ff5f"): "\033[48;5;47m", - c("#00ff87"): "\033[48;5;48m", c("#00ffaf"): "\033[48;5;49m", c("#00ffd7"): "\033[48;5;50m", c("#00ffff"): "\033[48;5;51m", - c("#5f0000"): "\033[48;5;52m", c("#5f005f"): "\033[48;5;53m", c("#5f0087"): "\033[48;5;54m", c("#5f00af"): "\033[48;5;55m", - c("#5f00d7"): "\033[48;5;56m", c("#5f00ff"): "\033[48;5;57m", c("#5f5f00"): "\033[48;5;58m", c("#5f5f5f"): "\033[48;5;59m", - c("#5f5f87"): "\033[48;5;60m", c("#5f5faf"): "\033[48;5;61m", c("#5f5fd7"): "\033[48;5;62m", c("#5f5fff"): "\033[48;5;63m", - c("#5f8700"): "\033[48;5;64m", c("#5f875f"): "\033[48;5;65m", c("#5f8787"): "\033[48;5;66m", c("#5f87af"): "\033[48;5;67m", - c("#5f87d7"): "\033[48;5;68m", c("#5f87ff"): "\033[48;5;69m", c("#5faf00"): "\033[48;5;70m", c("#5faf5f"): "\033[48;5;71m", - c("#5faf87"): "\033[48;5;72m", c("#5fafaf"): "\033[48;5;73m", c("#5fafd7"): "\033[48;5;74m", c("#5fafff"): "\033[48;5;75m", - c("#5fd700"): "\033[48;5;76m", c("#5fd75f"): "\033[48;5;77m", c("#5fd787"): "\033[48;5;78m", c("#5fd7af"): "\033[48;5;79m", - c("#5fd7d7"): "\033[48;5;80m", c("#5fd7ff"): "\033[48;5;81m", c("#5fff00"): "\033[48;5;82m", c("#5fff5f"): "\033[48;5;83m", - c("#5fff87"): "\033[48;5;84m", c("#5fffaf"): "\033[48;5;85m", c("#5fffd7"): "\033[48;5;86m", c("#5fffff"): "\033[48;5;87m", - c("#870000"): "\033[48;5;88m", c("#87005f"): "\033[48;5;89m", c("#870087"): "\033[48;5;90m", c("#8700af"): "\033[48;5;91m", - c("#8700d7"): "\033[48;5;92m", c("#8700ff"): "\033[48;5;93m", c("#875f00"): "\033[48;5;94m", c("#875f5f"): "\033[48;5;95m", - c("#875f87"): "\033[48;5;96m", c("#875faf"): "\033[48;5;97m", c("#875fd7"): "\033[48;5;98m", c("#875fff"): "\033[48;5;99m", - c("#878700"): "\033[48;5;100m", c("#87875f"): "\033[48;5;101m", c("#878787"): "\033[48;5;102m", c("#8787af"): "\033[48;5;103m", - c("#8787d7"): "\033[48;5;104m", c("#8787ff"): "\033[48;5;105m", c("#87af00"): "\033[48;5;106m", c("#87af5f"): "\033[48;5;107m", - c("#87af87"): "\033[48;5;108m", c("#87afaf"): "\033[48;5;109m", c("#87afd7"): "\033[48;5;110m", c("#87afff"): "\033[48;5;111m", - c("#87d700"): "\033[48;5;112m", c("#87d75f"): "\033[48;5;113m", c("#87d787"): "\033[48;5;114m", c("#87d7af"): "\033[48;5;115m", - c("#87d7d7"): "\033[48;5;116m", c("#87d7ff"): "\033[48;5;117m", c("#87ff00"): "\033[48;5;118m", c("#87ff5f"): "\033[48;5;119m", - c("#87ff87"): "\033[48;5;120m", c("#87ffaf"): "\033[48;5;121m", c("#87ffd7"): "\033[48;5;122m", c("#87ffff"): "\033[48;5;123m", - c("#af0000"): "\033[48;5;124m", c("#af005f"): "\033[48;5;125m", c("#af0087"): "\033[48;5;126m", c("#af00af"): "\033[48;5;127m", - c("#af00d7"): "\033[48;5;128m", c("#af00ff"): "\033[48;5;129m", c("#af5f00"): "\033[48;5;130m", c("#af5f5f"): "\033[48;5;131m", - c("#af5f87"): "\033[48;5;132m", c("#af5faf"): "\033[48;5;133m", c("#af5fd7"): "\033[48;5;134m", c("#af5fff"): "\033[48;5;135m", - c("#af8700"): "\033[48;5;136m", c("#af875f"): "\033[48;5;137m", c("#af8787"): "\033[48;5;138m", c("#af87af"): "\033[48;5;139m", - c("#af87d7"): "\033[48;5;140m", c("#af87ff"): "\033[48;5;141m", c("#afaf00"): "\033[48;5;142m", c("#afaf5f"): "\033[48;5;143m", - c("#afaf87"): "\033[48;5;144m", c("#afafaf"): "\033[48;5;145m", c("#afafd7"): "\033[48;5;146m", c("#afafff"): "\033[48;5;147m", - c("#afd700"): "\033[48;5;148m", c("#afd75f"): "\033[48;5;149m", c("#afd787"): "\033[48;5;150m", c("#afd7af"): "\033[48;5;151m", - c("#afd7d7"): "\033[48;5;152m", c("#afd7ff"): "\033[48;5;153m", c("#afff00"): "\033[48;5;154m", c("#afff5f"): "\033[48;5;155m", - c("#afff87"): "\033[48;5;156m", c("#afffaf"): "\033[48;5;157m", c("#afffd7"): "\033[48;5;158m", c("#afffff"): "\033[48;5;159m", - c("#d70000"): "\033[48;5;160m", c("#d7005f"): "\033[48;5;161m", c("#d70087"): "\033[48;5;162m", c("#d700af"): "\033[48;5;163m", - c("#d700d7"): "\033[48;5;164m", c("#d700ff"): "\033[48;5;165m", c("#d75f00"): "\033[48;5;166m", c("#d75f5f"): "\033[48;5;167m", - c("#d75f87"): "\033[48;5;168m", c("#d75faf"): "\033[48;5;169m", c("#d75fd7"): "\033[48;5;170m", c("#d75fff"): "\033[48;5;171m", - c("#d78700"): "\033[48;5;172m", c("#d7875f"): "\033[48;5;173m", c("#d78787"): "\033[48;5;174m", c("#d787af"): "\033[48;5;175m", - c("#d787d7"): "\033[48;5;176m", c("#d787ff"): "\033[48;5;177m", c("#d7af00"): "\033[48;5;178m", c("#d7af5f"): "\033[48;5;179m", - c("#d7af87"): "\033[48;5;180m", c("#d7afaf"): "\033[48;5;181m", c("#d7afd7"): "\033[48;5;182m", c("#d7afff"): "\033[48;5;183m", - c("#d7d700"): "\033[48;5;184m", c("#d7d75f"): "\033[48;5;185m", c("#d7d787"): "\033[48;5;186m", c("#d7d7af"): "\033[48;5;187m", - c("#d7d7d7"): "\033[48;5;188m", c("#d7d7ff"): "\033[48;5;189m", c("#d7ff00"): "\033[48;5;190m", c("#d7ff5f"): "\033[48;5;191m", - c("#d7ff87"): "\033[48;5;192m", c("#d7ffaf"): "\033[48;5;193m", c("#d7ffd7"): "\033[48;5;194m", c("#d7ffff"): "\033[48;5;195m", - c("#ff0000"): "\033[48;5;196m", c("#ff005f"): "\033[48;5;197m", c("#ff0087"): "\033[48;5;198m", c("#ff00af"): "\033[48;5;199m", - c("#ff00d7"): "\033[48;5;200m", c("#ff00ff"): "\033[48;5;201m", c("#ff5f00"): "\033[48;5;202m", c("#ff5f5f"): "\033[48;5;203m", - c("#ff5f87"): "\033[48;5;204m", c("#ff5faf"): "\033[48;5;205m", c("#ff5fd7"): "\033[48;5;206m", c("#ff5fff"): "\033[48;5;207m", - c("#ff8700"): "\033[48;5;208m", c("#ff875f"): "\033[48;5;209m", c("#ff8787"): "\033[48;5;210m", c("#ff87af"): "\033[48;5;211m", - c("#ff87d7"): "\033[48;5;212m", c("#ff87ff"): "\033[48;5;213m", c("#ffaf00"): "\033[48;5;214m", c("#ffaf5f"): "\033[48;5;215m", - c("#ffaf87"): "\033[48;5;216m", c("#ffafaf"): "\033[48;5;217m", c("#ffafd7"): "\033[48;5;218m", c("#ffafff"): "\033[48;5;219m", - c("#ffd700"): "\033[48;5;220m", c("#ffd75f"): "\033[48;5;221m", c("#ffd787"): "\033[48;5;222m", c("#ffd7af"): "\033[48;5;223m", - c("#ffd7d7"): "\033[48;5;224m", c("#ffd7ff"): "\033[48;5;225m", c("#ffff00"): "\033[48;5;226m", c("#ffff5f"): "\033[48;5;227m", - c("#ffff87"): "\033[48;5;228m", c("#ffffaf"): "\033[48;5;229m", c("#ffffd7"): "\033[48;5;230m", c("#ffffff"): "\033[48;5;231m", - c("#080808"): "\033[48;5;232m", c("#121212"): "\033[48;5;233m", c("#1c1c1c"): "\033[48;5;234m", c("#262626"): "\033[48;5;235m", - c("#303030"): "\033[48;5;236m", c("#3a3a3a"): "\033[48;5;237m", c("#444444"): "\033[48;5;238m", c("#4e4e4e"): "\033[48;5;239m", - c("#585858"): "\033[48;5;240m", c("#626262"): "\033[48;5;241m", c("#6c6c6c"): "\033[48;5;242m", c("#767676"): "\033[48;5;243m", - c("#808080"): "\033[48;5;244m", c("#8a8a8a"): "\033[48;5;245m", c("#949494"): "\033[48;5;246m", c("#9e9e9e"): "\033[48;5;247m", - c("#a8a8a8"): "\033[48;5;248m", c("#b2b2b2"): "\033[48;5;249m", c("#bcbcbc"): "\033[48;5;250m", c("#c6c6c6"): "\033[48;5;251m", - c("#d0d0d0"): "\033[48;5;252m", c("#dadada"): "\033[48;5;253m", c("#e4e4e4"): "\033[48;5;254m", c("#eeeeee"): "\033[48;5;255m", - }, - }, -} - -func entryToEscapeSequence(table *ttyTable, entry chroma.StyleEntry) string { - out := "" - if entry.Bold == chroma.Yes { - out += "\033[1m" - } - if entry.Underline == chroma.Yes { - out += "\033[4m" - } - if entry.Italic == chroma.Yes { - out += "\033[3m" - } - if entry.Colour.IsSet() { - out += table.foreground[findClosest(table, entry.Colour)] - } - if entry.Background.IsSet() { - out += table.background[findClosest(table, entry.Background)] - } - return out -} - -func findClosest(table *ttyTable, seeking chroma.Colour) chroma.Colour { - closestColour := chroma.Colour(0) - closest := float64(math.MaxFloat64) - for colour := range table.foreground { - distance := colour.Distance(seeking) - if distance < closest { - closest = distance - closestColour = colour - } - } - return closestColour -} - -func styleToEscapeSequence(table *ttyTable, style *chroma.Style) map[chroma.TokenType]string { - style = clearBackground(style) - out := map[chroma.TokenType]string{} - for _, ttype := range style.Types() { - entry := style.Get(ttype) - out[ttype] = entryToEscapeSequence(table, entry) - } - return out -} - -// Clear the background colour. -func clearBackground(style *chroma.Style) *chroma.Style { - builder := style.Builder() - bg := builder.Get(chroma.Background) - bg.Background = 0 - bg.NoInherit = true - builder.AddEntry(chroma.Background, bg) - style, _ = builder.Build() - return style -} - -type indexedTTYFormatter struct { - table *ttyTable -} - -func (c *indexedTTYFormatter) Format(w io.Writer, style *chroma.Style, it chroma.Iterator) (err error) { - theme := styleToEscapeSequence(c.table, style) - for token := it(); token != chroma.EOF; token = it() { - // TODO: Cache token lookups? - clr, ok := theme[token.Type] - if !ok { - clr, ok = theme[token.Type.SubCategory()] - if !ok { - clr = theme[token.Type.Category()] - // if !ok { - // clr = theme[chroma.InheritStyle] - // } - } - } - if clr != "" { - fmt.Fprint(w, clr) - } - fmt.Fprint(w, token.Value) - if clr != "" { - fmt.Fprintf(w, "\033[0m") - } - } - return nil -} - -// TTY8 is an 8-colour terminal formatter. -// -// The Lab colour space is used to map RGB values to the most appropriate index colour. -var TTY8 = Register("terminal", &indexedTTYFormatter{ttyTables[8]}) - -// TTY256 is a 256-colour terminal formatter. -// -// The Lab colour space is used to map RGB values to the most appropriate index colour. -var TTY256 = Register("terminal256", &indexedTTYFormatter{ttyTables[256]}) diff --git a/vendor/github.com/alecthomas/chroma/formatters/tty_truecolour.go b/vendor/github.com/alecthomas/chroma/formatters/tty_truecolour.go deleted file mode 100644 index b02e6360..00000000 --- a/vendor/github.com/alecthomas/chroma/formatters/tty_truecolour.go +++ /dev/null @@ -1,42 +0,0 @@ -package formatters - -import ( - "fmt" - "io" - - "github.com/alecthomas/chroma" -) - -// TTY16m is a true-colour terminal formatter. -var TTY16m = Register("terminal16m", chroma.FormatterFunc(trueColourFormatter)) - -func trueColourFormatter(w io.Writer, style *chroma.Style, it chroma.Iterator) error { - style = clearBackground(style) - for token := it(); token != chroma.EOF; token = it() { - entry := style.Get(token.Type) - if !entry.IsZero() { - out := "" - if entry.Bold == chroma.Yes { - out += "\033[1m" - } - if entry.Underline == chroma.Yes { - out += "\033[4m" - } - if entry.Italic == chroma.Yes { - out += "\033[3m" - } - if entry.Colour.IsSet() { - out += fmt.Sprintf("\033[38;2;%d;%d;%dm", entry.Colour.Red(), entry.Colour.Green(), entry.Colour.Blue()) - } - if entry.Background.IsSet() { - out += fmt.Sprintf("\033[48;2;%d;%d;%dm", entry.Background.Red(), entry.Background.Green(), entry.Background.Blue()) - } - fmt.Fprint(w, out) - } - fmt.Fprint(w, token.Value) - if !entry.IsZero() { - fmt.Fprint(w, "\033[0m") - } - } - return nil -} diff --git a/vendor/github.com/alecthomas/chroma/go.mod b/vendor/github.com/alecthomas/chroma/go.mod deleted file mode 100644 index 38eaa006..00000000 --- a/vendor/github.com/alecthomas/chroma/go.mod +++ /dev/null @@ -1,19 +0,0 @@ -module github.com/alecthomas/chroma - -require ( - github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 - github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 // indirect - github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae - github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 // indirect - github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 - github.com/dlclark/regexp2 v1.1.6 - github.com/mattn/go-colorable v0.0.9 - github.com/mattn/go-isatty v0.0.4 - github.com/sergi/go-diff v1.0.0 // indirect - github.com/stretchr/testify v1.3.0 // indirect - golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 // indirect -) - -replace github.com/GeertJohan/go.rice => github.com/alecthomas/go.rice v1.0.1-0.20190719113735-961b99d742e7 - -go 1.13 diff --git a/vendor/github.com/alecthomas/chroma/go.sum b/vendor/github.com/alecthomas/chroma/go.sum deleted file mode 100644 index 82643a3c..00000000 --- a/vendor/github.com/alecthomas/chroma/go.sum +++ /dev/null @@ -1,33 +0,0 @@ -github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= -github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= -github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= -github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae h1:C4Q9m+oXOxcSWwYk9XzzafY2xAVAaeubZbUHJkw3PlY= -github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= -github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= -github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= -github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= -github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 h1:YAFjXN64LMvktoUZH9zgY4lGc/msGN7HQfoSuKCgaDU= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/alecthomas/chroma/iterator.go b/vendor/github.com/alecthomas/chroma/iterator.go deleted file mode 100644 index c8845a1f..00000000 --- a/vendor/github.com/alecthomas/chroma/iterator.go +++ /dev/null @@ -1,76 +0,0 @@ -package chroma - -import "strings" - -// An Iterator across tokens. -// -// nil will be returned at the end of the Token stream. -// -// If an error occurs within an Iterator, it may propagate this in a panic. Formatters should recover. -type Iterator func() Token - -// Tokens consumes all tokens from the iterator and returns them as a slice. -func (i Iterator) Tokens() []Token { - var out []Token - for t := i(); t != EOF; t = i() { - out = append(out, t) - } - return out -} - -// Concaterator concatenates tokens from a series of iterators. -func Concaterator(iterators ...Iterator) Iterator { - return func() Token { - for len(iterators) > 0 { - t := iterators[0]() - if t != EOF { - return t - } - iterators = iterators[1:] - } - return EOF - } -} - -// Literator converts a sequence of literal Tokens into an Iterator. -func Literator(tokens ...Token) Iterator { - return func() Token { - if len(tokens) == 0 { - return EOF - } - token := tokens[0] - tokens = tokens[1:] - return token - } -} - -// SplitTokensIntoLines splits tokens containing newlines in two. -func SplitTokensIntoLines(tokens []Token) (out [][]Token) { - var line []Token // nolint: prealloc - for _, token := range tokens { - for strings.Contains(token.Value, "\n") { - parts := strings.SplitAfterN(token.Value, "\n", 2) - // Token becomes the tail. - token.Value = parts[1] - - // Append the head to the line and flush the line. - clone := token.Clone() - clone.Value = parts[0] - line = append(line, clone) - out = append(out, line) - line = nil - } - line = append(line, token) - } - if len(line) > 0 { - out = append(out, line) - } - // Strip empty trailing token line. - if len(out) > 0 { - last := out[len(out)-1] - if len(last) == 1 && last[0].Value == "" { - out = out[:len(out)-1] - } - } - return -} diff --git a/vendor/github.com/alecthomas/chroma/lexer.go b/vendor/github.com/alecthomas/chroma/lexer.go deleted file mode 100644 index a6ae84b2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexer.go +++ /dev/null @@ -1,120 +0,0 @@ -package chroma - -import ( - "fmt" -) - -var ( - defaultOptions = &TokeniseOptions{ - State: "root", - } -) - -// Config for a lexer. -type Config struct { - // Name of the lexer. - Name string - - // Shortcuts for the lexer - Aliases []string - - // File name globs - Filenames []string - - // Secondary file name globs - AliasFilenames []string - - // MIME types - MimeTypes []string - - // Regex matching is case-insensitive. - CaseInsensitive bool - - // Regex matches all characters. - DotAll bool - - // Regex does not match across lines ($ matches EOL). - // - // Defaults to multiline. - NotMultiline bool - - // Don't strip leading and trailing newlines from the input. - // DontStripNL bool - - // Strip all leading and trailing whitespace from the input - // StripAll bool - - // Make sure that the input ends with a newline. This - // is required for some lexers that consume input linewise. - EnsureNL bool - - // If given and greater than 0, expand tabs in the input. - // TabSize int - - // Priority of lexer. - // - // If this is 0 it will be treated as a default of 1. - Priority float32 -} - -// Token output to formatter. -type Token struct { - Type TokenType `json:"type"` - Value string `json:"value"` -} - -func (t *Token) String() string { return t.Value } -func (t *Token) GoString() string { return fmt.Sprintf("&Token{%s, %q}", t.Type, t.Value) } - -// Clone returns a clone of the Token. -func (t *Token) Clone() Token { - return *t -} - -// EOF is returned by lexers at the end of input. -var EOF Token - -// TokeniseOptions contains options for tokenisers. -type TokeniseOptions struct { - // State to start tokenisation in. Defaults to "root". - State string - // Nested tokenisation. - Nested bool -} - -// A Lexer for tokenising source code. -type Lexer interface { - // Config describing the features of the Lexer. - Config() *Config - // Tokenise returns an Iterator over tokens in text. - Tokenise(options *TokeniseOptions, text string) (Iterator, error) -} - -// Lexers is a slice of lexers sortable by name. -type Lexers []Lexer - -func (l Lexers) Len() int { return len(l) } -func (l Lexers) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l Lexers) Less(i, j int) bool { return l[i].Config().Name < l[j].Config().Name } - -// PrioritisedLexers is a slice of lexers sortable by priority. -type PrioritisedLexers []Lexer - -func (l PrioritisedLexers) Len() int { return len(l) } -func (l PrioritisedLexers) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l PrioritisedLexers) Less(i, j int) bool { - ip := l[i].Config().Priority - if ip == 0 { - ip = 1 - } - jp := l[j].Config().Priority - if jp == 0 { - jp = 1 - } - return ip > jp -} - -// Analyser determines how appropriate this lexer is for the given text. -type Analyser interface { - AnalyseText(text string) float32 -} diff --git a/vendor/github.com/alecthomas/chroma/lexers/README.md b/vendor/github.com/alecthomas/chroma/lexers/README.md deleted file mode 100644 index 2421710e..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Lexer tests - -The tests in this directory feed a known input `testdata/.actual` into the parser for `` and check -that its output matches `.exported`. - -## Running the tests - -Run the tests as normal: -```go -go test ./lexers -``` - -## Update existing tests -When you add a new test data file (`*.actual`), you need to regenerate all tests. That's how Chroma creates the `*.expected` test file based on the corresponding lexer. - -To regenerate all tests, type in your terminal: - -```go -RECORD=true go test ./lexers -``` - -This first sets the `RECORD` environment variable to `true`. Then it runs `go test` on the `./lexers` directory of the Chroma project. - -(That environment variable tells Chroma it needs to output test data. After running `go test ./lexers` you can remove or reset that variable.) - -### Windows users -Windows users will find that the `RECORD=true go test ./lexers` command fails in both the standard command prompt terminal and in PowerShell. - -Instead we have to perform both steps separately: - -- Set the `RECORD` environment variable to `true`. - + In the regular command prompt window, the `set` command sets an environment variable for the current session: `set RECORD=true`. See [this page](https://superuser.com/questions/212150/how-to-set-env-variable-in-windows-cmd-line) for more. - + In PowerShell, you can use the `$env:RECORD = 'true'` command for that. See [this article](https://mcpmag.com/articles/2019/03/28/environment-variables-in-powershell.aspx) for more. - + You can also make a persistent environment variable by hand in the Windows computer settings. See [this article](https://www.computerhope.com/issues/ch000549.htm) for how. -- When the environment variable is set, run `go tests ./lexers`. - -Chroma will now regenerate the test files and print its results to the console window. diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/abap.go b/vendor/github.com/alecthomas/chroma/lexers/a/abap.go deleted file mode 100644 index 61c294e0..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/abap.go +++ /dev/null @@ -1,56 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// ABAP lexer. -var Abap = internal.Register(MustNewLexer( - &Config{ - Name: "ABAP", - Aliases: []string{"abap"}, - Filenames: []string{"*.abap", "*.ABAP"}, - MimeTypes: []string{"text/x-abap"}, - CaseInsensitive: true, - }, - Rules{ - "common": { - {`\s+`, Text, nil}, - {`^\*.*$`, CommentSingle, nil}, - {`\".*?\n`, CommentSingle, nil}, - {`##\w+`, CommentSpecial, nil}, - }, - "variable-names": { - {`<\S+>`, NameVariable, nil}, - {`\w[\w~]*(?:(\[\])|->\*)?`, NameVariable, nil}, - }, - "root": { - Include("common"), - {`CALL\s+(?:BADI|CUSTOMER-FUNCTION|FUNCTION)`, Keyword, nil}, - {`(CALL\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|TRANSACTION|TRANSFORMATION))\b`, Keyword, nil}, - {`(FORM|PERFORM)(\s+)(\w+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`(PERFORM)(\s+)(\()(\w+)(\))`, ByGroups(Keyword, Text, Punctuation, NameVariable, Punctuation), nil}, - {`(MODULE)(\s+)(\S+)(\s+)(INPUT|OUTPUT)`, ByGroups(Keyword, Text, NameFunction, Text, Keyword), nil}, - {`(METHOD)(\s+)([\w~]+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`(\s+)([\w\-]+)([=\-]>)([\w\-~]+)`, ByGroups(Text, NameVariable, Operator, NameFunction), nil}, - {`(?<=(=|-)>)([\w\-~]+)(?=\()`, NameFunction, nil}, - {`(TEXT)(-)(\d{3})`, ByGroups(Keyword, Punctuation, LiteralNumberInteger), nil}, - {`(TEXT)(-)(\w{3})`, ByGroups(Keyword, Punctuation, NameVariable), nil}, - {`(ADD-CORRESPONDING|AUTHORITY-CHECK|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|DELETE-ADJACENT|DIVIDE-CORRESPONDING|EDITOR-CALL|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|EXIT-COMMAND|FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|INTERFACE-POOL|INVERTED-DATE|LOAD-OF-PROGRAM|LOG-POINT|MESSAGE-ID|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|NEW-PAGE|NEW-SECTION|NO-EXTENSION|OUTPUT-LENGTH|PRINT-CONTROL|SELECT-OPTIONS|START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYSTEM-EXCEPTIONS|TYPE-POOL|TYPE-POOLS|NO-DISPLAY)\b`, Keyword, nil}, - {`(?])(CREATE\s+(PUBLIC|PRIVATE|DATA|OBJECT)|(PUBLIC|PRIVATE|PROTECTED)\s+SECTION|(TYPE|LIKE)\s+((LINE\s+OF|REF\s+TO|(SORTED|STANDARD|HASHED)\s+TABLE\s+OF))?|FROM\s+(DATABASE|MEMORY)|CALL\s+METHOD|(GROUP|ORDER) BY|HAVING|SEPARATED BY|GET\s+(BADI|BIT|CURSOR|DATASET|LOCALE|PARAMETER|PF-STATUS|(PROPERTY|REFERENCE)\s+OF|RUN\s+TIME|TIME\s+(STAMP)?)?|SET\s+(BIT|BLANK\s+LINES|COUNTRY|CURSOR|DATASET|EXTENDED\s+CHECK|HANDLER|HOLD\s+DATA|LANGUAGE|LEFT\s+SCROLL-BOUNDARY|LOCALE|MARGIN|PARAMETER|PF-STATUS|PROPERTY\s+OF|RUN\s+TIME\s+(ANALYZER|CLOCK\s+RESOLUTION)|SCREEN|TITLEBAR|UPADTE\s+TASK\s+LOCAL|USER-COMMAND)|CONVERT\s+((INVERTED-)?DATE|TIME|TIME\s+STAMP|TEXT)|(CLOSE|OPEN)\s+(DATASET|CURSOR)|(TO|FROM)\s+(DATA BUFFER|INTERNAL TABLE|MEMORY ID|DATABASE|SHARED\s+(MEMORY|BUFFER))|DESCRIBE\s+(DISTANCE\s+BETWEEN|FIELD|LIST|TABLE)|FREE\s(MEMORY|OBJECT)?|PROCESS\s+(BEFORE\s+OUTPUT|AFTER\s+INPUT|ON\s+(VALUE-REQUEST|HELP-REQUEST))|AT\s+(LINE-SELECTION|USER-COMMAND|END\s+OF|NEW)|AT\s+SELECTION-SCREEN(\s+(ON(\s+(BLOCK|(HELP|VALUE)-REQUEST\s+FOR|END\s+OF|RADIOBUTTON\s+GROUP))?|OUTPUT))?|SELECTION-SCREEN:?\s+((BEGIN|END)\s+OF\s+((TABBED\s+)?BLOCK|LINE|SCREEN)|COMMENT|FUNCTION\s+KEY|INCLUDE\s+BLOCKS|POSITION|PUSHBUTTON|SKIP|ULINE)|LEAVE\s+(LIST-PROCESSING|PROGRAM|SCREEN|TO LIST-PROCESSING|TO TRANSACTION)(ENDING|STARTING)\s+AT|FORMAT\s+(COLOR|INTENSIFIED|INVERSE|HOTSPOT|INPUT|FRAMES|RESET)|AS\s+(CHECKBOX|SUBSCREEN|WINDOW)|WITH\s+(((NON-)?UNIQUE)?\s+KEY|FRAME)|(BEGIN|END)\s+OF|DELETE(\s+ADJACENT\s+DUPLICATES\sFROM)?|COMPARING(\s+ALL\s+FIELDS)?|(INSERT|APPEND)(\s+INITIAL\s+LINE\s+(IN)?TO|\s+LINES\s+OF)?|IN\s+((BYTE|CHARACTER)\s+MODE|PROGRAM)|END-OF-(DEFINITION|PAGE|SELECTION)|WITH\s+FRAME(\s+TITLE)|(REPLACE|FIND)\s+((FIRST|ALL)\s+OCCURRENCES?\s+OF\s+)?(SUBSTRING|REGEX)?|MATCH\s+(LENGTH|COUNT|LINE|OFFSET)|(RESPECTING|IGNORING)\s+CASE|IN\s+UPDATE\s+TASK|(SOURCE|RESULT)\s+(XML)?|REFERENCE\s+INTO|AND\s+(MARK|RETURN)|CLIENT\s+SPECIFIED|CORRESPONDING\s+FIELDS\s+OF|IF\s+FOUND|FOR\s+EVENT|INHERITING\s+FROM|LEAVE\s+TO\s+SCREEN|LOOP\s+AT\s+(SCREEN)?|LOWER\s+CASE|MATCHCODE\s+OBJECT|MODIF\s+ID|MODIFY\s+SCREEN|NESTING\s+LEVEL|NO\s+INTERVALS|OF\s+STRUCTURE|RADIOBUTTON\s+GROUP|RANGE\s+OF|REF\s+TO|SUPPRESS DIALOG|TABLE\s+OF|UPPER\s+CASE|TRANSPORTING\s+NO\s+FIELDS|VALUE\s+CHECK|VISIBLE\s+LENGTH|HEADER\s+LINE|COMMON\s+PART)\b`, Keyword, nil}, - {`(^|(?<=(\s|\.)))(ABBREVIATED|ABSTRACT|ADD|ALIASES|ALIGN|ALPHA|ASSERT|AS|ASSIGN(ING)?|AT(\s+FIRST)?|BACK|BLOCK|BREAK-POINT|CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|CONSTANTS|CONTEXTS|CONTINUE|CONTROLS|COUNTRY|CURRENCY|DATA|DATE|DECIMALS|DEFAULT|DEFINE|DEFINITION|DEFERRED|DEMAND|DETAIL|DIRECTORY|DIVIDE|DO|DUMMY|ELSE(IF)?|ENDAT|ENDCASE|ENDCATCH|ENDCLASS|ENDDO|ENDFORM|ENDFUNCTION|ENDIF|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDSELECT|ENDTRY|ENDWHILE|ENHANCEMENT|EVENTS|EXACT|EXCEPTIONS?|EXIT|EXPONENT|EXPORT|EXPORTING|EXTRACT|FETCH|FIELDS?|FOR|FORM|FORMAT|FREE|FROM|FUNCTION|HIDE|ID|IF|IMPORT|IMPLEMENTATION|IMPORTING|IN|INCLUDE|INCLUDING|INDEX|INFOTYPES|INITIALIZATION|INTERFACE|INTERFACES|INTO|LANGUAGE|LEAVE|LENGTH|LINES|LOAD|LOCAL|JOIN|KEY|NEXT|MAXIMUM|MESSAGE|METHOD[S]?|MINIMUM|MODULE|MODIFIER|MODIFY|MOVE|MULTIPLY|NODES|NUMBER|OBLIGATORY|OBJECT|OF|OFF|ON|OTHERS|OVERLAY|PACK|PAD|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|PF\d\d|RAISE|RAISING|RANGES?|READ|RECEIVE|REDEFINITION|REFRESH|REJECT|REPORT|RESERVE|RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|REPLACE|SCROLL|SEARCH|SELECT|SHIFT|SIGN|SINGLE|SIZE|SKIP|SORT|SPLIT|STATICS|STOP|STYLE|SUBMATCHES|SUBMIT|SUBTRACT|SUM(?!\()|SUMMARY|SUMMING|SUPPLY|TABLE|TABLES|TIMESTAMP|TIMES?|TIMEZONE|TITLE|\??TO|TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|ULINE|UNDER|UNPACK|UPDATE|USING|VALUE|VALUES|VIA|VARYING|VARY|WAIT|WHEN|WHERE|WIDTH|WHILE|WITH|WINDOW|WRITE|XSD|ZERO)\b`, Keyword, nil}, - {`(abs|acos|asin|atan|boolc|boolx|bit_set|char_off|charlen|ceil|cmax|cmin|condense|contains|contains_any_of|contains_any_not_of|concat_lines_of|cos|cosh|count|count_any_of|count_any_not_of|dbmaxlen|distance|escape|exp|find|find_end|find_any_of|find_any_not_of|floor|frac|from_mixed|insert|lines|log|log10|match|matches|nmax|nmin|numofchar|repeat|replace|rescale|reverse|round|segment|shift_left|shift_right|sign|sin|sinh|sqrt|strlen|substring|substring_after|substring_from|substring_before|substring_to|tan|tanh|to_upper|to_lower|to_mixed|translate|trunc|xstrlen)(\()\b`, ByGroups(NameBuiltin, Punctuation), nil}, - {`&[0-9]`, Name, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`(?<=(\s|.))(AND|OR|EQ|NE|GT|LT|GE|LE|CO|CN|CA|NA|CS|NOT|NS|CP|NP|BYTE-CO|BYTE-CN|BYTE-CA|BYTE-NA|BYTE-CS|BYTE-NS|IS\s+(NOT\s+)?(INITIAL|ASSIGNED|REQUESTED|BOUND))\b`, OperatorWord, nil}, - Include("variable-names"), - {`[?*<>=\-+&]`, Operator, nil}, - {`'(''|[^'])*'`, LiteralStringSingle, nil}, - {"`([^`])*`", LiteralStringSingle, nil}, - {`([|}])([^{}|]*?)([|{])`, ByGroups(Punctuation, LiteralStringSingle, Punctuation), nil}, - {`[/;:()\[\],.]`, Punctuation, nil}, - {`(!)(\w+)`, ByGroups(Operator, Name), nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/abnf.go b/vendor/github.com/alecthomas/chroma/lexers/a/abnf.go deleted file mode 100644 index ff29aed2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/abnf.go +++ /dev/null @@ -1,38 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Abnf lexer. -var Abnf = internal.Register(MustNewLexer( - &Config{ - Name: "ABNF", - Aliases: []string{"abnf"}, - Filenames: []string{"*.abnf"}, - MimeTypes: []string{"text/x-abnf"}, - }, - Rules{ - "root": { - {`;.*$`, CommentSingle, nil}, - {`(%[si])?"[^"]*"`, Literal, nil}, - {`%b[01]+\-[01]+\b`, Literal, nil}, - {`%b[01]+(\.[01]+)*\b`, Literal, nil}, - {`%d[0-9]+\-[0-9]+\b`, Literal, nil}, - {`%d[0-9]+(\.[0-9]+)*\b`, Literal, nil}, - {`%x[0-9a-fA-F]+\-[0-9a-fA-F]+\b`, Literal, nil}, - {`%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\b`, Literal, nil}, - {`\b[0-9]+\*[0-9]+`, Operator, nil}, - {`\b[0-9]+\*`, Operator, nil}, - {`\b[0-9]+`, Operator, nil}, - {`\*`, Operator, nil}, - {Words(``, `\b`, `ALPHA`, `BIT`, `CHAR`, `CR`, `CRLF`, `CTL`, `DIGIT`, `DQUOTE`, `HEXDIG`, `HTAB`, `LF`, `LWSP`, `OCTET`, `SP`, `VCHAR`, `WSP`), Keyword, nil}, - {`[a-zA-Z][a-zA-Z0-9-]+\b`, NameClass, nil}, - {`(=/|=|/)`, Operator, nil}, - {`[\[\]()]`, Punctuation, nil}, - {`\s+`, Text, nil}, - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/actionscript.go b/vendor/github.com/alecthomas/chroma/lexers/a/actionscript.go deleted file mode 100644 index 43d38521..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/actionscript.go +++ /dev/null @@ -1,39 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Actionscript lexer. -var Actionscript = internal.Register(MustNewLexer( - &Config{ - Name: "ActionScript", - Aliases: []string{"as", "actionscript"}, - Filenames: []string{"*.as"}, - MimeTypes: []string{"application/x-actionscript", "text/x-actionscript", "text/actionscript"}, - NotMultiline: true, - DotAll: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`/(\\\\|\\/|[^/\n])*/[gim]*`, LiteralStringRegex, nil}, - {`[~^*!%&<>|+=:;,/?\\-]+`, Operator, nil}, - {`[{}\[\]();.]+`, Punctuation, nil}, - {Words(``, `\b`, `case`, `default`, `for`, `each`, `in`, `while`, `do`, `break`, `return`, `continue`, `if`, `else`, `throw`, `try`, `catch`, `var`, `with`, `new`, `typeof`, `arguments`, `instanceof`, `this`, `switch`), Keyword, nil}, - {Words(``, `\b`, `class`, `public`, `final`, `internal`, `native`, `override`, `private`, `protected`, `static`, `import`, `extends`, `implements`, `interface`, `intrinsic`, `return`, `super`, `dynamic`, `function`, `const`, `get`, `namespace`, `package`, `set`), KeywordDeclaration, nil}, - {`(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\b`, KeywordConstant, nil}, - {Words(``, `\b`, `Accessibility`, `AccessibilityProperties`, `ActionScriptVersion`, `ActivityEvent`, `AntiAliasType`, `ApplicationDomain`, `AsBroadcaster`, `Array`, `AsyncErrorEvent`, `AVM1Movie`, `BevelFilter`, `Bitmap`, `BitmapData`, `BitmapDataChannel`, `BitmapFilter`, `BitmapFilterQuality`, `BitmapFilterType`, `BlendMode`, `BlurFilter`, `Boolean`, `ByteArray`, `Camera`, `Capabilities`, `CapsStyle`, `Class`, `Color`, `ColorMatrixFilter`, `ColorTransform`, `ContextMenu`, `ContextMenuBuiltInItems`, `ContextMenuEvent`, `ContextMenuItem`, `ConvultionFilter`, `CSMSettings`, `DataEvent`, `Date`, `DefinitionError`, `DeleteObjectSample`, `Dictionary`, `DisplacmentMapFilter`, `DisplayObject`, `DisplacmentMapFilterMode`, `DisplayObjectContainer`, `DropShadowFilter`, `Endian`, `EOFError`, `Error`, `ErrorEvent`, `EvalError`, `Event`, `EventDispatcher`, `EventPhase`, `ExternalInterface`, `FileFilter`, `FileReference`, `FileReferenceList`, `FocusDirection`, `FocusEvent`, `Font`, `FontStyle`, `FontType`, `FrameLabel`, `FullScreenEvent`, `Function`, `GlowFilter`, `GradientBevelFilter`, `GradientGlowFilter`, `GradientType`, `Graphics`, `GridFitType`, `HTTPStatusEvent`, `IBitmapDrawable`, `ID3Info`, `IDataInput`, `IDataOutput`, `IDynamicPropertyOutputIDynamicPropertyWriter`, `IEventDispatcher`, `IExternalizable`, `IllegalOperationError`, `IME`, `IMEConversionMode`, `IMEEvent`, `int`, `InteractiveObject`, `InterpolationMethod`, `InvalidSWFError`, `InvokeEvent`, `IOError`, `IOErrorEvent`, `JointStyle`, `Key`, `Keyboard`, `KeyboardEvent`, `KeyLocation`, `LineScaleMode`, `Loader`, `LoaderContext`, `LoaderInfo`, `LoadVars`, `LocalConnection`, `Locale`, `Math`, `Matrix`, `MemoryError`, `Microphone`, `MorphShape`, `Mouse`, `MouseEvent`, `MovieClip`, `MovieClipLoader`, `Namespace`, `NetConnection`, `NetStatusEvent`, `NetStream`, `NewObjectSample`, `Number`, `Object`, `ObjectEncoding`, `PixelSnapping`, `Point`, `PrintJob`, `PrintJobOptions`, `PrintJobOrientation`, `ProgressEvent`, `Proxy`, `QName`, `RangeError`, `Rectangle`, `ReferenceError`, `RegExp`, `Responder`, `Sample`, `Scene`, `ScriptTimeoutError`, `Security`, `SecurityDomain`, `SecurityError`, `SecurityErrorEvent`, `SecurityPanel`, `Selection`, `Shape`, `SharedObject`, `SharedObjectFlushStatus`, `SimpleButton`, `Socket`, `Sound`, `SoundChannel`, `SoundLoaderContext`, `SoundMixer`, `SoundTransform`, `SpreadMethod`, `Sprite`, `StackFrame`, `StackOverflowError`, `Stage`, `StageAlign`, `StageDisplayState`, `StageQuality`, `StageScaleMode`, `StaticText`, `StatusEvent`, `String`, `StyleSheet`, `SWFVersion`, `SyncEvent`, `SyntaxError`, `System`, `TextColorType`, `TextField`, `TextFieldAutoSize`, `TextFieldType`, `TextFormat`, `TextFormatAlign`, `TextLineMetrics`, `TextRenderer`, `TextSnapshot`, `Timer`, `TimerEvent`, `Transform`, `TypeError`, `uint`, `URIError`, `URLLoader`, `URLLoaderDataFormat`, `URLRequest`, `URLRequestHeader`, `URLRequestMethod`, `URLStream`, `URLVariabeles`, `VerifyError`, `Video`, `XML`, `XMLDocument`, `XMLList`, `XMLNode`, `XMLNodeType`, `XMLSocket`, `XMLUI`), NameBuiltin, nil}, - {Words(``, `\b`, `decodeURI`, `decodeURIComponent`, `encodeURI`, `escape`, `eval`, `isFinite`, `isNaN`, `isXMLName`, `clearInterval`, `fscommand`, `getTimer`, `getURL`, `getVersion`, `parseFloat`, `parseInt`, `setInterval`, `trace`, `updateAfterEvent`, `unescape`), NameFunction, nil}, - {`[$a-zA-Z_]\w*`, NameOther, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-f]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/actionscript3.go b/vendor/github.com/alecthomas/chroma/lexers/a/actionscript3.go deleted file mode 100644 index 3404bd55..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/actionscript3.go +++ /dev/null @@ -1,56 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Actionscript 3 lexer. -var Actionscript3 = internal.Register(MustNewLexer( - &Config{ - Name: "ActionScript 3", - Aliases: []string{"as3", "actionscript3"}, - Filenames: []string{"*.as"}, - MimeTypes: []string{"application/x-actionscript3", "text/x-actionscript3", "text/actionscript3"}, - DotAll: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`(function\s+)([$a-zA-Z_]\w*)(\s*)(\()`, ByGroups(KeywordDeclaration, NameFunction, Text, Operator), Push("funcparams")}, - {`(var|const)(\s+)([$a-zA-Z_]\w*)(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?)`, ByGroups(KeywordDeclaration, Text, Name, Text, Punctuation, Text, KeywordType), nil}, - {`(import|package)(\s+)((?:[$a-zA-Z_]\w*|\.)+)(\s*)`, ByGroups(Keyword, Text, NameNamespace, Text), nil}, - {`(new)(\s+)([$a-zA-Z_]\w*(?:\.<\w+>)?)(\s*)(\()`, ByGroups(Keyword, Text, KeywordType, Text, Operator), nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`/(\\\\|\\/|[^\n])*/[gisx]*`, LiteralStringRegex, nil}, - {`(\.)([$a-zA-Z_]\w*)`, ByGroups(Operator, NameAttribute), nil}, - {`(case|default|for|each|in|while|do|break|return|continue|if|else|throw|try|catch|with|new|typeof|arguments|instanceof|this|switch|import|include|as|is)\b`, Keyword, nil}, - {`(class|public|final|internal|native|override|private|protected|static|import|extends|implements|interface|intrinsic|return|super|dynamic|function|const|get|namespace|package|set)\b`, KeywordDeclaration, nil}, - {`(true|false|null|NaN|Infinity|-Infinity|undefined|void)\b`, KeywordConstant, nil}, - {`(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|unescape)\b`, NameFunction, nil}, - {`[$a-zA-Z_]\w*`, Name, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-f]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[~^*!%&<>|+=:;,/?\\{}\[\]().-]+`, Operator, nil}, - }, - "funcparams": { - {`\s+`, Text, nil}, - {`(\s*)(\.\.\.)?([$a-zA-Z_]\w*)(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?|\*)(\s*)`, ByGroups(Text, Punctuation, Name, Text, Operator, Text, KeywordType, Text), Push("defval")}, - {`\)`, Operator, Push("type")}, - }, - "type": { - {`(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?|\*)`, ByGroups(Text, Operator, Text, KeywordType), Pop(2)}, - {`\s+`, Text, Pop(2)}, - Default(Pop(2)), - }, - "defval": { - {`(=)(\s*)([^(),]+)(\s*)(,?)`, ByGroups(Operator, Text, UsingSelf("root"), Text, Operator), Pop(1)}, - {`,`, Operator, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/ada.go b/vendor/github.com/alecthomas/chroma/lexers/a/ada.go deleted file mode 100644 index d9b34e3c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/ada.go +++ /dev/null @@ -1,114 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ada lexer. -var Ada = internal.Register(MustNewLexer( - &Config{ - Name: "Ada", - Aliases: []string{"ada", "ada95", "ada2005"}, - Filenames: []string{"*.adb", "*.ads", "*.ada"}, - MimeTypes: []string{"text/x-ada"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`[^\S\n]+`, Text, nil}, - {`--.*?\n`, CommentSingle, nil}, - {`[^\S\n]+`, Text, nil}, - {`function|procedure|entry`, KeywordDeclaration, Push("subprogram")}, - {`(subtype|type)(\s+)(\w+)`, ByGroups(KeywordDeclaration, Text, KeywordType), Push("type_def")}, - {`task|protected`, KeywordDeclaration, nil}, - {`(subtype)(\s+)`, ByGroups(KeywordDeclaration, Text), nil}, - {`(end)(\s+)`, ByGroups(KeywordReserved, Text), Push("end")}, - {`(pragma)(\s+)(\w+)`, ByGroups(KeywordReserved, Text, CommentPreproc), nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {Words(``, `\b`, `Address`, `Byte`, `Boolean`, `Character`, `Controlled`, `Count`, `Cursor`, `Duration`, `File_Mode`, `File_Type`, `Float`, `Generator`, `Integer`, `Long_Float`, `Long_Integer`, `Long_Long_Float`, `Long_Long_Integer`, `Natural`, `Positive`, `Reference_Type`, `Short_Float`, `Short_Integer`, `Short_Short_Float`, `Short_Short_Integer`, `String`, `Wide_Character`, `Wide_String`), KeywordType, nil}, - {`(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b`, OperatorWord, nil}, - {`generic|private`, KeywordDeclaration, nil}, - {`package`, KeywordDeclaration, Push("package")}, - {`array\b`, KeywordReserved, Push("array_def")}, - {`(with|use)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`(\w+)(\s*)(:)(\s*)(constant)`, ByGroups(NameConstant, Text, Punctuation, Text, KeywordReserved), nil}, - {`<<\w+>>`, NameLabel, nil}, - {`(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)`, ByGroups(NameLabel, Text, Punctuation, Text, KeywordReserved), nil}, - {Words(`\b`, `\b`, `abort`, `abs`, `abstract`, `accept`, `access`, `aliased`, `all`, `array`, `at`, `begin`, `body`, `case`, `constant`, `declare`, `delay`, `delta`, `digits`, `do`, `else`, `elsif`, `end`, `entry`, `exception`, `exit`, `interface`, `for`, `goto`, `if`, `is`, `limited`, `loop`, `new`, `null`, `of`, `or`, `others`, `out`, `overriding`, `pragma`, `protected`, `raise`, `range`, `record`, `renames`, `requeue`, `return`, `reverse`, `select`, `separate`, `subtype`, `synchronized`, `task`, `tagged`, `terminate`, `then`, `type`, `until`, `when`, `while`, `xor`), KeywordReserved, nil}, - {`"[^"]*"`, LiteralString, nil}, - Include("attribute"), - Include("numbers"), - {`'[^']'`, LiteralStringChar, nil}, - {`(\w+)(\s*|[(,])`, ByGroups(Name, UsingSelf("root")), nil}, - {`(<>|=>|:=|[()|:;,.'])`, Punctuation, nil}, - {`[*<>+=/&-]`, Operator, nil}, - {`\n+`, Text, nil}, - }, - "numbers": { - {`[0-9_]+#[0-9a-f]+#`, LiteralNumberHex, nil}, - {`[0-9_]+\.[0-9_]*`, LiteralNumberFloat, nil}, - {`[0-9_]+`, LiteralNumberInteger, nil}, - }, - "attribute": { - {`(')(\w+)`, ByGroups(Punctuation, NameAttribute), nil}, - }, - "subprogram": { - {`\(`, Punctuation, Push("#pop", "formal_part")}, - {`;`, Punctuation, Pop(1)}, - {`is\b`, KeywordReserved, Pop(1)}, - {`"[^"]+"|\w+`, NameFunction, nil}, - Include("root"), - }, - "end": { - {`(if|case|record|loop|select)`, KeywordReserved, nil}, - {`"[^"]+"|[\w.]+`, NameFunction, nil}, - {`\s+`, Text, nil}, - {`;`, Punctuation, Pop(1)}, - }, - "type_def": { - {`;`, Punctuation, Pop(1)}, - {`\(`, Punctuation, Push("formal_part")}, - {`with|and|use`, KeywordReserved, nil}, - {`array\b`, KeywordReserved, Push("#pop", "array_def")}, - {`record\b`, KeywordReserved, Push("record_def")}, - {`(null record)(;)`, ByGroups(KeywordReserved, Punctuation), Pop(1)}, - Include("root"), - }, - "array_def": { - {`;`, Punctuation, Pop(1)}, - {`(\w+)(\s+)(range)`, ByGroups(KeywordType, Text, KeywordReserved), nil}, - Include("root"), - }, - "record_def": { - {`end record`, KeywordReserved, Pop(1)}, - Include("root"), - }, - "import": { - {`[\w.]+`, NameNamespace, Pop(1)}, - Default(Pop(1)), - }, - "formal_part": { - {`\)`, Punctuation, Pop(1)}, - {`\w+`, NameVariable, nil}, - {`,|:[^=]`, Punctuation, nil}, - {`(in|not|null|out|access)\b`, KeywordReserved, nil}, - Include("root"), - }, - "package": { - {`body`, KeywordDeclaration, nil}, - {`is\s+new|renames`, KeywordReserved, nil}, - {`is`, KeywordReserved, Pop(1)}, - {`;`, Punctuation, Pop(1)}, - {`\(`, Punctuation, Push("package_instantiation")}, - {`([\w.]+)`, NameClass, nil}, - Include("root"), - }, - "package_instantiation": { - {`("[^"]+"|\w+)(\s+)(=>)`, ByGroups(NameVariable, Text, Punctuation), nil}, - {`[\w.\'"]`, Text, nil}, - {`\)`, Punctuation, Pop(1)}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/angular2.go b/vendor/github.com/alecthomas/chroma/lexers/a/angular2.go deleted file mode 100644 index 5258c928..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/angular2.go +++ /dev/null @@ -1,42 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Angular2 lexer. -var Angular2 = internal.Register(MustNewLexer( - &Config{ - Name: "Angular2", - Aliases: []string{"ng2"}, - Filenames: []string{}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`[^{([*#]+`, Other, nil}, - {`(\{\{)(\s*)`, ByGroups(CommentPreproc, Text), Push("ngExpression")}, - {`([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)`, ByGroups(Punctuation, NameAttribute, Punctuation, Text, Operator, Text), Push("attr")}, - {`([([]+)([\w:.-]+)([\])]+)(\s*)`, ByGroups(Punctuation, NameAttribute, Punctuation, Text), nil}, - {`([*#])([\w:.-]+)(\s*)(=)(\s*)`, ByGroups(Punctuation, NameAttribute, Punctuation, Operator), Push("attr")}, - {`([*#])([\w:.-]+)(\s*)`, ByGroups(Punctuation, NameAttribute, Punctuation), nil}, - }, - "ngExpression": { - {`\s+(\|\s+)?`, Text, nil}, - {`\}\}`, CommentPreproc, Pop(1)}, - {`:?(true|false)`, LiteralStringBoolean, nil}, - {`:?"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`:?'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - {`[a-zA-Z][\w-]*(\(.*\))?`, NameVariable, nil}, - {`\.[\w-]+(\(.*\))?`, NameVariable, nil}, - {`(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)`, ByGroups(Operator, Text, LiteralString, Text, Operator, Text, LiteralString, Text), nil}, - }, - "attr": { - {`".*?"`, LiteralString, Pop(1)}, - {`'.*?'`, LiteralString, Pop(1)}, - {`[^\s>]+`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/antlr.go b/vendor/github.com/alecthomas/chroma/lexers/a/antlr.go deleted file mode 100644 index d7649d4a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/antlr.go +++ /dev/null @@ -1,101 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// ANTLR lexer. -var ANTLR = internal.Register(MustNewLexer( - &Config{ - Name: "ANTLR", - Aliases: []string{"antlr"}, - Filenames: []string{}, - MimeTypes: []string{}, - }, - Rules{ - "whitespace": { - {`\s+`, TextWhitespace, nil}, - }, - "comments": { - {`//.*$`, Comment, nil}, - {`/\*(.|\n)*?\*/`, Comment, nil}, - }, - "root": { - Include("whitespace"), - Include("comments"), - {`(lexer|parser|tree)?(\s*)(grammar\b)(\s*)([A-Za-z]\w*)(;)`, ByGroups(Keyword, TextWhitespace, Keyword, TextWhitespace, NameClass, Punctuation), nil}, - {`options\b`, Keyword, Push("options")}, - {`tokens\b`, Keyword, Push("tokens")}, - {`(scope)(\s*)([A-Za-z]\w*)(\s*)(\{)`, ByGroups(Keyword, TextWhitespace, NameVariable, TextWhitespace, Punctuation), Push("action")}, - {`(catch|finally)\b`, Keyword, Push("exception")}, - {`(@[A-Za-z]\w*)(\s*)(::)?(\s*)([A-Za-z]\w*)(\s*)(\{)`, ByGroups(NameLabel, TextWhitespace, Punctuation, TextWhitespace, NameLabel, TextWhitespace, Punctuation), Push("action")}, - {`((?:protected|private|public|fragment)\b)?(\s*)([A-Za-z]\w*)(!)?`, ByGroups(Keyword, TextWhitespace, NameLabel, Punctuation), Push("rule-alts", "rule-prelims")}, - }, - "exception": { - {`\n`, TextWhitespace, Pop(1)}, - {`\s`, TextWhitespace, nil}, - Include("comments"), - {`\[`, Punctuation, Push("nested-arg-action")}, - {`\{`, Punctuation, Push("action")}, - }, - "rule-prelims": { - Include("whitespace"), - Include("comments"), - {`returns\b`, Keyword, nil}, - {`\[`, Punctuation, Push("nested-arg-action")}, - {`\{`, Punctuation, Push("action")}, - {`(throws)(\s+)([A-Za-z]\w*)`, ByGroups(Keyword, TextWhitespace, NameLabel), nil}, - {`(,)(\s*)([A-Za-z]\w*)`, ByGroups(Punctuation, TextWhitespace, NameLabel), nil}, - {`options\b`, Keyword, Push("options")}, - {`(scope)(\s+)(\{)`, ByGroups(Keyword, TextWhitespace, Punctuation), Push("action")}, - {`(scope)(\s+)([A-Za-z]\w*)(\s*)(;)`, ByGroups(Keyword, TextWhitespace, NameLabel, TextWhitespace, Punctuation), nil}, - {`(@[A-Za-z]\w*)(\s*)(\{)`, ByGroups(NameLabel, TextWhitespace, Punctuation), Push("action")}, - {`:`, Punctuation, Pop(1)}, - }, - "rule-alts": { - Include("whitespace"), - Include("comments"), - {`options\b`, Keyword, Push("options")}, - {`:`, Punctuation, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralString, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`<<([^>]|>[^>])>>`, LiteralString, nil}, - {`\$?[A-Z_]\w*`, NameConstant, nil}, - {`\$?[a-z_]\w*`, NameVariable, nil}, - {`(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)`, Operator, nil}, - {`,`, Punctuation, nil}, - {`\[`, Punctuation, Push("nested-arg-action")}, - {`\{`, Punctuation, Push("action")}, - {`;`, Punctuation, Pop(1)}, - }, - "tokens": { - Include("whitespace"), - Include("comments"), - {`\{`, Punctuation, nil}, - {`([A-Z]\w*)(\s*)(=)?(\s*)(\'(?:\\\\|\\\'|[^\']*)\')?(\s*)(;)`, ByGroups(NameLabel, TextWhitespace, Punctuation, TextWhitespace, LiteralString, TextWhitespace, Punctuation), nil}, - {`\}`, Punctuation, Pop(1)}, - }, - "options": { - Include("whitespace"), - Include("comments"), - {`\{`, Punctuation, nil}, - {`([A-Za-z]\w*)(\s*)(=)(\s*)([A-Za-z]\w*|\'(?:\\\\|\\\'|[^\']*)\'|[0-9]+|\*)(\s*)(;)`, ByGroups(NameVariable, TextWhitespace, Punctuation, TextWhitespace, Text, TextWhitespace, Punctuation), nil}, - {`\}`, Punctuation, Pop(1)}, - }, - "action": { - {`([^${}\'"/\\]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|\\(?!%)|/)+`, Other, nil}, - {`(\\)(%)`, ByGroups(Punctuation, Other), nil}, - {`(\$[a-zA-Z]+)(\.?)(text|value)?`, ByGroups(NameVariable, Punctuation, NameProperty), nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "nested-arg-action": { - {`([^$\[\]\'"/]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|/)+`, Other, nil}, - {`\[`, Punctuation, Push()}, - {`\]`, Punctuation, Pop(1)}, - {`(\$[a-zA-Z]+)(\.?)(text|value)?`, ByGroups(NameVariable, Punctuation, NameProperty), nil}, - {`(\\\\|\\\]|\\\[|[^\[\]])+`, Other, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/apache.go b/vendor/github.com/alecthomas/chroma/lexers/a/apache.go deleted file mode 100644 index 6c56a1db..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/apache.go +++ /dev/null @@ -1,38 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Apacheconf lexer. -var Apacheconf = internal.Register(MustNewLexer( - &Config{ - Name: "ApacheConf", - Aliases: []string{"apacheconf", "aconf", "apache"}, - Filenames: []string{".htaccess", "apache.conf", "apache2.conf"}, - MimeTypes: []string{"text/x-apacheconf"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`(#.*?)$`, Comment, nil}, - {`(<[^\s>]+)(?:(\s+)(.*?))?(>)`, ByGroups(NameTag, Text, LiteralString, NameTag), nil}, - {`([a-z]\w*)(\s+)`, ByGroups(NameBuiltin, Text), Push("value")}, - {`\.+`, Text, nil}, - }, - "value": { - {`\\\n`, Text, nil}, - {`$`, Text, Pop(1)}, - {`\\`, Text, nil}, - {`[^\S\n]+`, Text, nil}, - {`\d+\.\d+\.\d+\.\d+(?:/\d+)?`, LiteralNumber, nil}, - {`\d+`, LiteralNumber, nil}, - {`/([a-z0-9][\w./-]+)`, LiteralStringOther, nil}, - {`(on|off|none|any|all|double|email|dns|min|minimal|os|productonly|full|emerg|alert|crit|error|warn|notice|info|debug|registry|script|inetd|standalone|user|group)\b`, Keyword, nil}, - {`"([^"\\]*(?:\\.[^"\\]*)*)"`, LiteralStringDouble, nil}, - {`[^\s"\\]+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/apl.go b/vendor/github.com/alecthomas/chroma/lexers/a/apl.go deleted file mode 100644 index 820e13b6..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/apl.go +++ /dev/null @@ -1,36 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Apl lexer. -var Apl = internal.Register(MustNewLexer( - &Config{ - Name: "APL", - Aliases: []string{"apl"}, - Filenames: []string{"*.apl"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`[⍝#].*$`, CommentSingle, nil}, - {`\'((\'\')|[^\'])*\'`, LiteralStringSingle, nil}, - {`"(("")|[^"])*"`, LiteralStringDouble, nil}, - {`[⋄◇()]`, Punctuation, nil}, - {`[\[\];]`, LiteralStringRegex, nil}, - {`⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameFunction, nil}, - {`[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*`, NameVariable, nil}, - {`¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?`, LiteralNumber, nil}, - {`[\.\\/⌿⍀¨⍣⍨⍠⍤∘]`, NameAttribute, nil}, - {`[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗]`, Operator, nil}, - {`⍬`, NameConstant, nil}, - {`[⎕⍞]`, NameVariableGlobal, nil}, - {`[←→]`, KeywordDeclaration, nil}, - {`[⍺⍵⍶⍹∇:]`, NameBuiltinPseudo, nil}, - {`[{}]`, KeywordType, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/applescript.go b/vendor/github.com/alecthomas/chroma/lexers/a/applescript.go deleted file mode 100644 index db83ed0e..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/applescript.go +++ /dev/null @@ -1,55 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Applescript lexer. -var Applescript = internal.Register(MustNewLexer( - &Config{ - Name: "AppleScript", - Aliases: []string{"applescript"}, - Filenames: []string{"*.applescript"}, - MimeTypes: []string{}, - DotAll: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`¬\n`, LiteralStringEscape, nil}, - {`'s\s+`, Text, nil}, - {`(--|#).*?$`, Comment, nil}, - {`\(\*`, CommentMultiline, Push("comment")}, - {`[(){}!,.:]`, Punctuation, nil}, - {`(«)([^»]+)(»)`, ByGroups(Text, NameBuiltin, Text), nil}, - {`\b((?:considering|ignoring)\s*)(application responses|case|diacriticals|hyphens|numeric strings|punctuation|white space)`, ByGroups(Keyword, NameBuiltin), nil}, - {`(-|\*|\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\^)`, Operator, nil}, - {`\b(and|or|is equal|equals|(is )?equal to|is not|isn't|isn't equal( to)?|is not equal( to)?|doesn't equal|does not equal|(is )?greater than|comes after|is not less than or equal( to)?|isn't less than or equal( to)?|(is )?less than|comes before|is not greater than or equal( to)?|isn't greater than or equal( to)?|(is )?greater than or equal( to)?|is not less than|isn't less than|does not come before|doesn't come before|(is )?less than or equal( to)?|is not greater than|isn't greater than|does not come after|doesn't come after|starts? with|begins? with|ends? with|contains?|does not contain|doesn't contain|is in|is contained by|is not in|is not contained by|isn't contained by|div|mod|not|(a )?(ref( to)?|reference to)|is|does)\b`, OperatorWord, nil}, - {`^(\s*(?:on|end)\s+)(zoomed|write to file|will zoom|will show|will select tab view item|will resize( sub views)?|will resign active|will quit|will pop up|will open|will move|will miniaturize|will hide|will finish launching|will display outline cell|will display item cell|will display cell|will display browser cell|will dismiss|will close|will become active|was miniaturized|was hidden|update toolbar item|update parameters|update menu item|shown|should zoom|should selection change|should select tab view item|should select row|should select item|should select column|should quit( after last window closed)?|should open( untitled)?|should expand item|should end editing|should collapse item|should close|should begin editing|selection changing|selection changed|selected tab view item|scroll wheel|rows changed|right mouse up|right mouse dragged|right mouse down|resized( sub views)?|resigned main|resigned key|resigned active|read from file|prepare table drop|prepare table drag|prepare outline drop|prepare outline drag|prepare drop|plugin loaded|parameters updated|panel ended|opened|open untitled|number of rows|number of items|number of browser rows|moved|mouse up|mouse moved|mouse exited|mouse entered|mouse dragged|mouse down|miniaturized|load data representation|launched|keyboard up|keyboard down|items changed|item value changed|item value|item expandable|idle|exposed|end editing|drop|drag( (entered|exited|updated))?|double clicked|document nib name|dialog ended|deminiaturized|data representation|conclude drop|column resized|column moved|column clicked|closed|clicked toolbar item|clicked|choose menu item|child of item|changed|change item value|change cell value|cell value changed|cell value|bounds changed|begin editing|became main|became key|awake from nib|alert ended|activated|action|accept table drop|accept outline drop)`, ByGroups(Keyword, NameFunction), nil}, - {`^(\s*)(in|on|script|to)(\s+)`, ByGroups(Text, Keyword, Text), nil}, - {`\b(as )(alias |application |boolean |class |constant |date |file |integer |list |number |POSIX file |real |record |reference |RGB color |script |text |unit types|(?:Unicode )?text|string)\b`, ByGroups(Keyword, NameClass), nil}, - {`\b(AppleScript|current application|false|linefeed|missing value|pi|quote|result|return|space|tab|text item delimiters|true|version)\b`, NameConstant, nil}, - {`\b(ASCII (character|number)|activate|beep|choose URL|choose application|choose color|choose file( name)?|choose folder|choose from list|choose remote application|clipboard info|close( access)?|copy|count|current date|delay|delete|display (alert|dialog)|do shell script|duplicate|exists|get eof|get volume settings|info for|launch|list (disks|folder)|load script|log|make|mount volume|new|offset|open( (for access|location))?|path to|print|quit|random number|read|round|run( script)?|say|scripting components|set (eof|the clipboard to|volume)|store script|summarize|system attribute|system info|the clipboard|time to GMT|write|quoted form)\b`, NameBuiltin, nil}, - {`\b(considering|else|error|exit|from|if|ignoring|in|repeat|tell|then|times|to|try|until|using terms from|while|with|with timeout( of)?|with transaction|by|continue|end|its?|me|my|return|of|as)\b`, Keyword, nil}, - {`\b(global|local|prop(erty)?|set|get)\b`, Keyword, nil}, - {`\b(but|put|returning|the)\b`, NameBuiltin, nil}, - {`\b(attachment|attribute run|character|day|month|paragraph|word|year)s?\b`, NameBuiltin, nil}, - {`\b(about|above|against|apart from|around|aside from|at|below|beneath|beside|between|for|given|instead of|on|onto|out of|over|since)\b`, NameBuiltin, nil}, - {`\b(accepts arrow key|action method|active|alignment|allowed identifiers|allows branch selection|allows column reordering|allows column resizing|allows column selection|allows customization|allows editing text attributes|allows empty selection|allows mixed state|allows multiple selection|allows reordering|allows undo|alpha( value)?|alternate image|alternate increment value|alternate title|animation delay|associated file name|associated object|auto completes|auto display|auto enables items|auto repeat|auto resizes( outline column)?|auto save expanded items|auto save name|auto save table columns|auto saves configuration|auto scroll|auto sizes all columns to fit|auto sizes cells|background color|bezel state|bezel style|bezeled|border rect|border type|bordered|bounds( rotation)?|box type|button returned|button type|can choose directories|can choose files|can draw|can hide|cell( (background color|size|type))?|characters|class|click count|clicked( data)? column|clicked data item|clicked( data)? row|closeable|collating|color( (mode|panel))|command key down|configuration|content(s| (size|view( margins)?))?|context|continuous|control key down|control size|control tint|control view|controller visible|coordinate system|copies( on scroll)?|corner view|current cell|current column|current( field)? editor|current( menu)? item|current row|current tab view item|data source|default identifiers|delta (x|y|z)|destination window|directory|display mode|displayed cell|document( (edited|rect|view))?|double value|dragged column|dragged distance|dragged items|draws( cell)? background|draws grid|dynamically scrolls|echos bullets|edge|editable|edited( data)? column|edited data item|edited( data)? row|enabled|enclosing scroll view|ending page|error handling|event number|event type|excluded from windows menu|executable path|expanded|fax number|field editor|file kind|file name|file type|first responder|first visible column|flipped|floating|font( panel)?|formatter|frameworks path|frontmost|gave up|grid color|has data items|has horizontal ruler|has horizontal scroller|has parent data item|has resize indicator|has shadow|has sub menu|has vertical ruler|has vertical scroller|header cell|header view|hidden|hides when deactivated|highlights by|horizontal line scroll|horizontal page scroll|horizontal ruler view|horizontally resizable|icon image|id|identifier|ignores multiple clicks|image( (alignment|dims when disabled|frame style|scaling))?|imports graphics|increment value|indentation per level|indeterminate|index|integer value|intercell spacing|item height|key( (code|equivalent( modifier)?|window))?|knob thickness|label|last( visible)? column|leading offset|leaf|level|line scroll|loaded|localized sort|location|loop mode|main( (bunde|menu|window))?|marker follows cell|matrix mode|maximum( content)? size|maximum visible columns|menu( form representation)?|miniaturizable|miniaturized|minimized image|minimized title|minimum column width|minimum( content)? size|modal|modified|mouse down state|movie( (controller|file|rect))?|muted|name|needs display|next state|next text|number of tick marks|only tick mark values|opaque|open panel|option key down|outline table column|page scroll|pages across|pages down|palette label|pane splitter|parent data item|parent window|pasteboard|path( (names|separator))?|playing|plays every frame|plays selection only|position|preferred edge|preferred type|pressure|previous text|prompt|properties|prototype cell|pulls down|rate|released when closed|repeated|requested print time|required file type|resizable|resized column|resource path|returns records|reuses columns|rich text|roll over|row height|rulers visible|save panel|scripts path|scrollable|selectable( identifiers)?|selected cell|selected( data)? columns?|selected data items?|selected( data)? rows?|selected item identifier|selection by rect|send action on arrow key|sends action when done editing|separates columns|separator item|sequence number|services menu|shared frameworks path|shared support path|sheet|shift key down|shows alpha|shows state by|size( mode)?|smart insert delete enabled|sort case sensitivity|sort column|sort order|sort type|sorted( data rows)?|sound|source( mask)?|spell checking enabled|starting page|state|string value|sub menu|super menu|super view|tab key traverses cells|tab state|tab type|tab view|table view|tag|target( printer)?|text color|text container insert|text container origin|text returned|tick mark position|time stamp|title(d| (cell|font|height|position|rect))?|tool tip|toolbar|trailing offset|transparent|treat packages as directories|truncated labels|types|unmodified characters|update views|use sort indicator|user defaults|uses data source|uses ruler|uses threaded animation|uses title from previous column|value wraps|version|vertical( (line scroll|page scroll|ruler view))?|vertically resizable|view|visible( document rect)?|volume|width|window|windows menu|wraps|zoomable|zoomed)\b`, NameAttribute, nil}, - {`\b(action cell|alert reply|application|box|browser( cell)?|bundle|button( cell)?|cell|clip view|color well|color-panel|combo box( item)?|control|data( (cell|column|item|row|source))?|default entry|dialog reply|document|drag info|drawer|event|font(-panel)?|formatter|image( (cell|view))?|matrix|menu( item)?|item|movie( view)?|open-panel|outline view|panel|pasteboard|plugin|popup button|progress indicator|responder|save-panel|scroll view|secure text field( cell)?|slider|sound|split view|stepper|tab view( item)?|table( (column|header cell|header view|view))|text( (field( cell)?|view))?|toolbar( item)?|user-defaults|view|window)s?\b`, NameBuiltin, nil}, - {`\b(animate|append|call method|center|close drawer|close panel|display|display alert|display dialog|display panel|go|hide|highlight|increment|item for|load image|load movie|load nib|load panel|load sound|localized string|lock focus|log|open drawer|path for|pause|perform action|play|register|resume|scroll|select( all)?|show|size to fit|start|step back|step forward|stop|synchronize|unlock focus|update)\b`, NameBuiltin, nil}, - {`\b((in )?back of|(in )?front of|[0-9]+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|after|back|before|behind|every|front|index|last|middle|some|that|through|thru|where|whose)\b`, NameBuiltin, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`\b([a-zA-Z]\w*)\b`, NameVariable, nil}, - {`[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?`, LiteralNumberFloat, nil}, - {`[-+]?\d+`, LiteralNumberInteger, nil}, - }, - "comment": { - {`\(\*`, CommentMultiline, Push()}, - {`\*\)`, CommentMultiline, Pop(1)}, - {`[^*(]+`, CommentMultiline, nil}, - {`[*(]`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/a/arduino.go b/vendor/github.com/alecthomas/chroma/lexers/a/arduino.go deleted file mode 100644 index b0cd8c95..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/a/arduino.go +++ /dev/null @@ -1,110 +0,0 @@ -package a - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Arduino lexer. -var Arduino = internal.Register(MustNewLexer( - &Config{ - Name: "Arduino", - Aliases: []string{"arduino"}, - Filenames: []string{"*.ino"}, - MimeTypes: []string{"text/x-arduino"}, - EnsureNL: true, - }, - Rules{ - "statements": { - {Words(``, `\b`, `catch`, `const_cast`, `delete`, `dynamic_cast`, `explicit`, `export`, `friend`, `mutable`, `namespace`, `new`, `operator`, `private`, `protected`, `public`, `reinterpret_cast`, `restrict`, `static_cast`, `template`, `this`, `throw`, `throws`, `try`, `typeid`, `typename`, `using`, `virtual`, `constexpr`, `nullptr`, `decltype`, `thread_local`, `alignas`, `alignof`, `static_assert`, `noexcept`, `override`, `final`), Keyword, nil}, - {`char(16_t|32_t)\b`, KeywordType, nil}, - {`(class)\b`, ByGroups(Keyword, Text), Push("classname")}, - {`(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")`, ByGroups(LiteralStringAffix, LiteralString, LiteralStringDelimiter, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, LiteralString), nil}, - {`(u8|u|U)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')`, ByGroups(LiteralStringAffix, LiteralStringChar, LiteralStringChar, LiteralStringChar), nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+[LlUu]*`, LiteralNumberHex, nil}, - {`0[0-7]+[LlUu]*`, LiteralNumberOct, nil}, - {`\d+[LlUu]*`, LiteralNumberInteger, nil}, - {`\*/`, Error, nil}, - {`[~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[()\[\],.]`, Punctuation, nil}, - {Words(``, `\b`, `asm`, `auto`, `break`, `case`, `const`, `continue`, `default`, `do`, `else`, `enum`, `extern`, `for`, `goto`, `if`, `register`, `restricted`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `volatile`, `while`), Keyword, nil}, - {`(_Bool|_Complex|_Imaginary|array|atomic_bool|atomic_char|atomic_int|atomic_llong|atomic_long|atomic_schar|atomic_short|atomic_uchar|atomic_uint|atomic_ullong|atomic_ulong|atomic_ushort|auto|bool|boolean|BooleanVariables|Byte|byte|Char|char|char16_t|char32_t|class|complex|Const|const|const_cast|delete|double|dynamic_cast|enum|explicit|extern|Float|float|friend|inline|Int|int|int16_t|int32_t|int64_t|int8_t|Long|long|new|NULL|null|operator|private|PROGMEM|protected|public|register|reinterpret_cast|short|signed|sizeof|Static|static|static_cast|String|struct|typedef|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|virtual|Void|void|Volatile|volatile|word)\b`, KeywordType, nil}, - // Start of: Arduino-specific syntax - {`(and|final|If|Loop|loop|not|or|override|setup|Setup|throw|try|xor)\b`, Keyword, nil}, // Addition to keywords already defined by C++ - {`(ANALOG_MESSAGE|BIN|CHANGE|DEC|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FALLING|FIRMATA_STRING|HALF_PI|HEX|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL1V1|INTERNAL2V56|INTERNAL2V56|LED_BUILTIN|LED_BUILTIN_RX|LED_BUILTIN_TX|LOW|LSBFIRST|MSBFIRST|OCT|OUTPUT|PI|REPORT_ANALOG|REPORT_DIGITAL|RISING|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET|TWO_PI)\b`, KeywordConstant, nil}, - {`(boolean|const|byte|word|string|String|array)\b`, NameVariable, nil}, - {`(Keyboard|KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD)\b`, NameClass, nil}, - {`(abs|Abs|accept|ACos|acos|acosf|addParameter|analogRead|AnalogRead|analogReadResolution|AnalogReadResolution|analogReference|AnalogReference|analogWrite|AnalogWrite|analogWriteResolution|AnalogWriteResolution|answerCall|asin|ASin|asinf|atan|ATan|atan2|ATan2|atan2f|atanf|attach|attached|attachGPRS|attachInterrupt|AttachInterrupt|autoscroll|available|availableForWrite|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|Bit|BitClear|bitClear|bitRead|BitRead|bitSet|BitSet|BitWrite|bitWrite|blink|blinkVersion|BSSID|buffer|byte|cbrt|cbrtf|Ceil|ceil|ceilf|changePIN|char|charAt|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compareTo|compassRead|concat|config|connect|connected|constrain|Constrain|copysign|copysignf|cos|Cos|cosf|cosh|coshf|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|degrees|Delay|delay|DelayMicroseconds|delayMicroseconds|detach|DetachInterrupt|detachInterrupt|DigitalPinToInterrupt|digitalPinToInterrupt|DigitalRead|digitalRead|DigitalWrite|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endsWith|endTransmission|endWrite|equals|equalsIgnoreCase|exists|exitValue|Exp|exp|expf|fabs|fabsf|fdim|fdimf|fill|find|findUntil|float|floor|Floor|floorf|flush|fma|fmaf|fmax|fmaxf|fmin|fminf|fmod|fmodf|gatewayIP|get|getAsynchronously|getBand|getButton|getBytes|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|HighByte|home|hypot|hypotf|image|indexOf|int|interrupts|IPAddress|IRread|isActionDone|isAlpha|isAlphaNumeric|isAscii|isControl|isDigit|isDirectory|isfinite|isGraph|isHexadecimalDigit|isinf|isListening|isLowerCase|isnan|isPIN|isPressed|isPrintable|isPunct|isSpace|isUpperCase|isValid|isWhitespace|keyboardRead|keyPressed|keyReleased|knobRead|lastIndexOf|ldexp|ldexpf|leftToRight|length|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|log|Log|log10|log10f|logf|long|lowByte|LowByte|lrint|lrintf|lround|lroundf|macAddress|maintain|map|Map|Max|max|messageAvailable|Micros|micros|millis|Millis|Min|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|NoInterrupts|noListenOnLocalhost|noStroke|noTone|NoTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|PinMode|pinMode|playFile|playMelody|point|pointTo|position|Pow|pow|powf|prepare|press|print|printFirmwareVersion|println|printVersion|process|processInput|PulseIn|pulseIn|pulseInLong|PulseInLong|put|radians|random|Random|randomSeed|RandomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|replace|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|round|roundf|RSSI|run|runAsynchronously|running|runShellCommand|runShellCommandAsynchronously|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|Serial_Available|Serial_Begin|Serial_End|Serial_Flush|Serial_Peek|Serial_Print|Serial_Println|Serial_Read|serialEvent|setBand|setBitOrder|setCharAt|setClockDivider|setCursor|setDataMode|setDNS|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|ShiftIn|shiftIn|ShiftOut|shiftOut|shutdown|signbit|sin|Sin|sinf|sinh|sinhf|size|sizeof|Sq|sq|Sqrt|sqrt|sqrtf|SSID|startLoop|startsWith|step|stop|stroke|subnetMask|substring|switchPIN|tan|Tan|tanf|tanh|tanhf|tempoWrite|text|toCharArray|toInt|toLowerCase|tone|Tone|toUpperCase|transfer|trim|trunc|truncf|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|WiFiServer|word|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRed|writeRGB|yield|Yield)\b`, NameFunction, nil}, - // End of: Arduino-specific syntax - {Words(``, `\b`, `inline`, `_inline`, `__inline`, `naked`, `restrict`, `thread`, `typename`), KeywordReserved, nil}, - {`(__m(128i|128d|128|64))\b`, KeywordReserved, nil}, - {Words(`__`, `\b`, `asm`, `int8`, `based`, `except`, `int16`, `stdcall`, `cdecl`, `fastcall`, `int32`, `declspec`, `finally`, `int64`, `try`, `leave`, `wchar_t`, `w64`, `unaligned`, `raise`, `noop`, `identifier`, `forceinline`, `assume`), KeywordReserved, nil}, - {`(true|false|NULL)\b`, NameBuiltin, nil}, - {`([a-zA-Z_]\w*)(\s*)(:)(?!:)`, ByGroups(NameLabel, Text, Punctuation), nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "root": { - Include("whitespace"), - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), Push("function")}, - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), nil}, - Default(Push("statement")), - {Words(`__`, `\b`, `virtual_inheritance`, `uuidof`, `super`, `single_inheritance`, `multiple_inheritance`, `interface`, `event`), KeywordReserved, nil}, - {`__(offload|blockingoffload|outer)\b`, KeywordPseudo, nil}, - }, - "classname": { - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - {`\s*(?=>)`, Text, Pop(1)}, - }, - "whitespace": { - {`^#if\s+0`, CommentPreproc, Push("if0")}, - {`^#`, CommentPreproc, Push("macro")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("if0")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("macro")}, - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil}, - }, - "statement": { - Include("whitespace"), - Include("statements"), - {`[{}]`, Punctuation, nil}, - {`;`, Punctuation, Pop(1)}, - }, - "function": { - Include("whitespace"), - Include("statements"), - {`;`, Punctuation, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "macro": { - {`(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)`, ByGroups(CommentPreproc, Text, CommentPreprocFile), nil}, - {`[^/\n]+`, CommentPreproc, nil}, - {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {`/`, CommentPreproc, nil}, - {`(?<=\\)\n`, CommentPreproc, nil}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "if0": { - {`^\s*#if.*?(?+*%\^/!=|])=?`, Operator, Push("slashstartsregex")}, - {`[{(\[;,]`, Punctuation, Push("slashstartsregex")}, - {`[})\].]`, Punctuation, nil}, - {`(break|continue|do|while|exit|for|if|else|return)\b`, Keyword, Push("slashstartsregex")}, - {`function\b`, KeywordDeclaration, Push("slashstartsregex")}, - {`(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|match|split|sprintf|sub|substr|tolower|toupper|close|fflush|getline|next|nextfile|print|printf|strftime|systime|delete|system)\b`, KeywordReserved, nil}, - {`(ARGC|ARGIND|ARGV|BEGIN|CONVFMT|ENVIRON|END|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|SUBSEP)\b`, NameBuiltin, nil}, - {`[$a-zA-Z_]\w*`, NameOther, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/ballerina.go b/vendor/github.com/alecthomas/chroma/lexers/b/ballerina.go deleted file mode 100644 index 91dc9017..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/ballerina.go +++ /dev/null @@ -1,46 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ballerina lexer. -var Ballerina = internal.Register(MustNewLexer( - &Config{ - Name: "Ballerina", - Aliases: []string{"ballerina"}, - Filenames: []string{"*.bal"}, - MimeTypes: []string{"text/x-ballerina"}, - DotAll: true, - }, - Rules{ - "root": { - {`[^\S\n]+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`(break|catch|continue|done|else|finally|foreach|forever|fork|if|lock|match|return|throw|transaction|try|while)\b`, Keyword, nil}, - {`((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil}, - {`@[^\W\d][\w.]*`, NameDecorator, nil}, - {`(annotation|bind|but|endpoint|error|function|object|private|public|returns|service|type|var|with|worker)\b`, KeywordDeclaration, nil}, - {`(boolean|byte|decimal|float|int|json|map|nil|record|string|table|xml)\b`, KeywordType, nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(import)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil}, - {`(\.)((?:[^\W\d]|\$)[\w$]*)`, ByGroups(Operator, NameAttribute), nil}, - {`^\s*([^\W\d]|\$)[\w$]*:`, NameLabel, nil}, - {`([^\W\d]|\$)[\w$]*`, Name, nil}, - {`([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?`, LiteralNumberFloat, nil}, - {`0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?`, LiteralNumberHex, nil}, - {`0[bB][01][01_]*[lL]?`, LiteralNumberBin, nil}, - {`0[0-7_]+[lL]?`, LiteralNumberOct, nil}, - {`0|[1-9][0-9_]*[lL]?`, LiteralNumberInteger, nil}, - {`[~^*!%&\[\](){}<>|+=:;,./?-]`, Operator, nil}, - {`\n`, Text, nil}, - }, - "import": { - {`[\w.]+`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bash.go b/vendor/github.com/alecthomas/chroma/lexers/b/bash.go deleted file mode 100644 index 38b3f224..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/bash.go +++ /dev/null @@ -1,95 +0,0 @@ -package b - -import ( - "regexp" - - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var bashAnalyserRe = regexp.MustCompile(`(?m)^#!.*/bin/(?:env |)(?:bash|zsh|sh|ksh)`) - -// Bash lexer. -var Bash = internal.Register(MustNewLexer( - &Config{ - Name: "Bash", - Aliases: []string{"bash", "sh", "ksh", "zsh", "shell"}, - Filenames: []string{"*.sh", "*.ksh", "*.bash", "*.ebuild", "*.eclass", "*.exheres-0", "*.exlib", "*.zsh", "*.zshrc", ".bashrc", "bashrc", ".bash_*", "bash_*", "zshrc", ".zshrc", "PKGBUILD"}, - MimeTypes: []string{"application/x-sh", "application/x-shellscript"}, - }, - Rules{ - "root": { - Include("basic"), - {"`", LiteralStringBacktick, Push("backticks")}, - Include("data"), - Include("interp"), - }, - "interp": { - {`\$\(\(`, Keyword, Push("math")}, - {`\$\(`, Keyword, Push("paren")}, - {`\$\{#?`, LiteralStringInterpol, Push("curly")}, - {`\$[a-zA-Z_]\w*`, NameVariable, nil}, - {`\$(?:\d+|[#$?!_*@-])`, NameVariable, nil}, - {`\$`, Text, nil}, - }, - "basic": { - {`\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)(\s*)\b`, ByGroups(Keyword, Text), nil}, - {"\\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)(?=[\\s)`])", NameBuiltin, nil}, - {`\A#!.+\n`, CommentPreproc, nil}, - {`#.*\S`, CommentSingle, nil}, - {`\\[\w\W]`, LiteralStringEscape, nil}, - {`(\b\w+)(\s*)(\+?=)`, ByGroups(NameVariable, Text, Operator), nil}, - {`[\[\]{}()=]`, Operator, nil}, - {`<<<`, Operator, nil}, - {`<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2`, LiteralString, nil}, - {`&&|\|\|`, Operator, nil}, - }, - "data": { - {`(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'`, LiteralStringSingle, nil}, - {`(?s)'.*?'`, LiteralStringSingle, nil}, - {`;`, Punctuation, nil}, - {`&`, Punctuation, nil}, - {`\|`, Punctuation, nil}, - {`\s+`, Text, nil}, - {`\d+(?= |$)`, LiteralNumber, nil}, - {"[^=\\s\\[\\]{}()$\"\\'`\\\\<&|;]+", Text, nil}, - {`<`, Text, nil}, - }, - "string": { - {`"`, LiteralStringDouble, Pop(1)}, - {`(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+`, LiteralStringDouble, nil}, - Include("interp"), - }, - "curly": { - {`\}`, LiteralStringInterpol, Pop(1)}, - {`:-`, Keyword, nil}, - {`\w+`, NameVariable, nil}, - {"[^}:\"\\'`$\\\\]+", Punctuation, nil}, - {`:`, Punctuation, nil}, - Include("root"), - }, - "paren": { - {`\)`, Keyword, Pop(1)}, - Include("root"), - }, - "math": { - {`\)\)`, Keyword, Pop(1)}, - {`[-+*/%^|&]|\*\*|\|\|`, Operator, nil}, - {`\d+#\d+`, LiteralNumber, nil}, - {`\d+#(?! )`, LiteralNumber, nil}, - {`\d+`, LiteralNumber, nil}, - Include("root"), - }, - "backticks": { - {"`", LiteralStringBacktick, Pop(1)}, - Include("root"), - }, - }, -).SetAnalyser(func(text string) float32 { - if bashAnalyserRe.FindString(text) != "" { - return 1.0 - } - return 0.0 -})) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/batch.go b/vendor/github.com/alecthomas/chroma/lexers/b/batch.go deleted file mode 100644 index dc6ce524..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/batch.go +++ /dev/null @@ -1,194 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Batchfile lexer. -var Batchfile = internal.Register(MustNewLexer( - &Config{ - Name: "Batchfile", - Aliases: []string{"bat", "batch", "dosbatch", "winbatch"}, - Filenames: []string{"*.bat", "*.cmd"}, - MimeTypes: []string{"application/x-dos-batch"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\)((?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?:(?:[^\n\x1a^]|\^[\n\x1a]?[\w\W])*)`, CommentSingle, nil}, - {`(?=((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:))`, Text, Push("follow")}, - {`(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)`, UsingSelf("text"), nil}, - Include("redirect"), - {`[\n\x1a]+`, Text, nil}, - {`\(`, Punctuation, Push("root/compound")}, - {`@+`, Punctuation, nil}, - {`((?:for|if|rem)(?:(?=(?:\^[\n\x1a]?)?/)|(?:(?!\^)|(?<=m))(?:(?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+)?(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?)`, ByGroups(Keyword, UsingSelf("text")), Push("follow")}, - {`(goto(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|])*(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|])*)`, ByGroups(Keyword, UsingSelf("text")), Push("follow")}, - {Words(``, `(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])`, `assoc`, `break`, `cd`, `chdir`, `cls`, `color`, `copy`, `date`, `del`, `dir`, `dpath`, `echo`, `endlocal`, `erase`, `exit`, `ftype`, `keys`, `md`, `mkdir`, `mklink`, `move`, `path`, `pause`, `popd`, `prompt`, `pushd`, `rd`, `ren`, `rename`, `rmdir`, `setlocal`, `shift`, `start`, `time`, `title`, `type`, `ver`, `verify`, `vol`), Keyword, Push("follow")}, - {`(call)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:)`, ByGroups(Keyword, UsingSelf("text"), Punctuation), Push("call")}, - {`call(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])`, Keyword, nil}, - {`(for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/f(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("for/f", "for")}, - {`(for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/l(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("for/l", "for")}, - {`for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^)`, Keyword, Push("for2", "for")}, - {`(goto(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:?)`, ByGroups(Keyword, UsingSelf("text"), Punctuation), Push("label")}, - {`(if(?:(?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:/i(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:not(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)`, ByGroups(Keyword, UsingSelf("text"), Keyword, UsingSelf("text"), Keyword, UsingSelf("text")), Push("(?", "if")}, - {`rem(((?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)?.*|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])(?:(?:[^\n\x1a^]|\^[\n\x1a]?[\w\W])*))`, CommentSingle, Push("follow")}, - {`(set(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:\^[\n\x1a]?)?[^\S\n])*)(/a)`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("arithmetic")}, - {`(set(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:/p)?)((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|^=]|\^[\n\x1a]?[^"=])+)?)((?:(?:\^[\n\x1a]?)?=)?)`, ByGroups(Keyword, UsingSelf("text"), Keyword, UsingSelf("text"), UsingSelf("variable"), Punctuation), Push("follow")}, - Default(Push("follow")), - }, - "follow": { - {`((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:)([\t\v\f\r ,;=\xa0]*)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*))(.*)`, ByGroups(Text, Punctuation, Text, NameLabel, CommentSingle), nil}, - Include("redirect"), - {`(?=[\n\x1a])`, Text, Pop(1)}, - {`\|\|?|&&?`, Punctuation, Pop(1)}, - Include("text"), - }, - "arithmetic": { - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0x[\da-f]+`, LiteralNumberHex, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`[(),]+`, Punctuation, nil}, - {`([=+\-*/!~]|%|\^\^)+`, Operator, nil}, - {`((?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(\^[\n\x1a]?)?[^()=+\-*/!~%^"\n\x1a&<>|\t\v\f\r ,;=\xa0]|\^[\n\x1a\t\v\f\r ,;=\xa0]?[\w\W])+`, UsingSelf("variable"), nil}, - {`(?=[\x00|&])`, Text, Pop(1)}, - Include("follow"), - }, - "call": { - {`(:?)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*))`, ByGroups(Punctuation, NameLabel), Pop(1)}, - }, - "label": { - {`((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*)?)((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|\^[\n\x1a]?[\w\W]|[^"%^\n\x1a&<>|])*)`, ByGroups(NameLabel, CommentSingle), Pop(1)}, - }, - "redirect": { - {`((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])\d)?)(>>?&|<&)([\n\x1a\t\v\f\r ,;=\xa0]*)(\d)`, ByGroups(LiteralNumberInteger, Punctuation, Text, LiteralNumberInteger), nil}, - {`((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])(?>?|<)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))`, ByGroups(LiteralNumberInteger, Punctuation, UsingSelf("text")), nil}, - }, - "root/compound": { - {`\)`, Punctuation, Pop(1)}, - {`(?=((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:))`, Text, Push("follow/compound")}, - {`(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)`, UsingSelf("text"), nil}, - Include("redirect/compound"), - {`[\n\x1a]+`, Text, nil}, - {`\(`, Punctuation, Push("root/compound")}, - {`@+`, Punctuation, nil}, - {`((?:for|if|rem)(?:(?=(?:\^[\n\x1a]?)?/)|(?:(?!\^)|(?<=m))(?:(?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0)])+)?(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?)`, ByGroups(Keyword, UsingSelf("text")), Push("follow/compound")}, - {`(goto(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|)])*(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|)])*)`, ByGroups(Keyword, UsingSelf("text")), Push("follow/compound")}, - {Words(``, `(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))`, `assoc`, `break`, `cd`, `chdir`, `cls`, `color`, `copy`, `date`, `del`, `dir`, `dpath`, `echo`, `endlocal`, `erase`, `exit`, `ftype`, `keys`, `md`, `mkdir`, `mklink`, `move`, `path`, `pause`, `popd`, `prompt`, `pushd`, `rd`, `ren`, `rename`, `rmdir`, `setlocal`, `shift`, `start`, `time`, `title`, `type`, `ver`, `verify`, `vol`), Keyword, Push("follow/compound")}, - {`(call)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:)`, ByGroups(Keyword, UsingSelf("text"), Punctuation), Push("call/compound")}, - {`call(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))`, Keyword, nil}, - {`(for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/f(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("for/f", "for")}, - {`(for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/l(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("for/l", "for")}, - {`for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^)`, Keyword, Push("for2", "for")}, - {`(goto(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:?)`, ByGroups(Keyword, UsingSelf("text"), Punctuation), Push("label/compound")}, - {`(if(?:(?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:/i(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:not(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)`, ByGroups(Keyword, UsingSelf("text"), Keyword, UsingSelf("text"), Keyword, UsingSelf("text")), Push("(?", "if")}, - {`rem(((?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)?.*|(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))(?:(?:[^\n\x1a^)]|\^[\n\x1a]?[^)])*))`, CommentSingle, Push("follow/compound")}, - {`(set(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:\^[\n\x1a]?)?[^\S\n])*)(/a)`, ByGroups(Keyword, UsingSelf("text"), Keyword), Push("arithmetic/compound")}, - {`(set(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:/p)?)((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|^=)]|\^[\n\x1a]?[^"=])+)?)((?:(?:\^[\n\x1a]?)?=)?)`, ByGroups(Keyword, UsingSelf("text"), Keyword, UsingSelf("text"), UsingSelf("variable"), Punctuation), Push("follow/compound")}, - Default(Push("follow/compound")), - }, - "follow/compound": { - {`(?=\))`, Text, Pop(1)}, - {`((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:)([\t\v\f\r ,;=\xa0]*)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*))(.*)`, ByGroups(Text, Punctuation, Text, NameLabel, CommentSingle), nil}, - Include("redirect/compound"), - {`(?=[\n\x1a])`, Text, Pop(1)}, - {`\|\|?|&&?`, Punctuation, Pop(1)}, - Include("text"), - }, - "arithmetic/compound": { - {`(?=\))`, Text, Pop(1)}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0x[\da-f]+`, LiteralNumberHex, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`[(),]+`, Punctuation, nil}, - {`([=+\-*/!~]|%|\^\^)+`, Operator, nil}, - {`((?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(\^[\n\x1a]?)?[^()=+\-*/!~%^"\n\x1a&<>|\t\v\f\r ,;=\xa0]|\^[\n\x1a\t\v\f\r ,;=\xa0]?[^)])+`, UsingSelf("variable"), nil}, - {`(?=[\x00|&])`, Text, Pop(1)}, - Include("follow"), - }, - "call/compound": { - {`(?=\))`, Text, Pop(1)}, - {`(:?)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*))`, ByGroups(Punctuation, NameLabel), Pop(1)}, - }, - "label/compound": { - {`(?=\))`, Text, Pop(1)}, - {`((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*)?)((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|\^[\n\x1a]?[^)]|[^"%^\n\x1a&<>|)])*)`, ByGroups(NameLabel, CommentSingle), Pop(1)}, - }, - "redirect/compound": { - {`((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])\d)?)(>>?&|<&)([\n\x1a\t\v\f\r ,;=\xa0]*)(\d)`, ByGroups(LiteralNumberInteger, Punctuation, Text, LiteralNumberInteger), nil}, - {`((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])(?>?|<)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0)])+))+))`, ByGroups(LiteralNumberInteger, Punctuation, UsingSelf("text")), nil}, - }, - "variable-or-escape": { - {`(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))`, NameVariable, nil}, - {`%%|\^[\n\x1a]?(\^!|[\w\W])`, LiteralStringEscape, nil}, - }, - "string": { - {`"`, LiteralStringDouble, Pop(1)}, - {`(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))`, NameVariable, nil}, - {`\^!|%%`, LiteralStringEscape, nil}, - {`[^"%^\n\x1a]+|[%^]`, LiteralStringDouble, nil}, - Default(Pop(1)), - }, - "sqstring": { - Include("variable-or-escape"), - {`[^%]+|%`, LiteralStringSingle, nil}, - }, - "bqstring": { - Include("variable-or-escape"), - {`[^%]+|%`, LiteralStringBacktick, nil}, - }, - "text": { - {`"`, LiteralStringDouble, Push("string")}, - Include("variable-or-escape"), - {`[^"%^\n\x1a&<>|\t\v\f\r ,;=\xa0\d)]+|.`, Text, nil}, - }, - "variable": { - {`"`, LiteralStringDouble, Push("string")}, - Include("variable-or-escape"), - {`[^"%^\n\x1a]+|.`, NameVariable, nil}, - }, - "for": { - {`((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(in)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(\()`, ByGroups(UsingSelf("text"), Keyword, UsingSelf("text"), Punctuation), Pop(1)}, - Include("follow"), - }, - "for2": { - {`\)`, Punctuation, nil}, - {`((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(do(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))`, ByGroups(UsingSelf("text"), Keyword), Pop(1)}, - {`[\n\x1a]+`, Text, nil}, - Include("follow"), - }, - "for/f": { - {`(")((?:(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"])*?")([\n\x1a\t\v\f\r ,;=\xa0]*)(\))`, ByGroups(LiteralStringDouble, UsingSelf("string"), Text, Punctuation), nil}, - {`"`, LiteralStringDouble, Push("#pop", "for2", "string")}, - {`('(?:%%|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[\w\W])*?')([\n\x1a\t\v\f\r ,;=\xa0]*)(\))`, ByGroups(UsingSelf("sqstring"), Text, Punctuation), nil}, - {"(`(?:%%|(?:(?:%(?:\\*|(?:~[a-z]*(?:\\$[^:]+:)?)?\\d|[^%:\\n\\x1a]+(?::(?:~(?:-?\\d+)?(?:,(?:-?\\d+)?)?|(?:[^%\\n\\x1a^]|\\^[^%\\n\\x1a])[^=\\n\\x1a]*=(?:[^%\\n\\x1a^]|\\^[^%\\n\\x1a])*)?)?%))|(?:\\^?![^!:\\n\\x1a]+(?::(?:~(?:-?\\d+)?(?:,(?:-?\\d+)?)?|(?:[^!\\n\\x1a^]|\\^[^!\\n\\x1a])[^=\\n\\x1a]*=(?:[^!\\n\\x1a^]|\\^[^!\\n\\x1a])*)?)?\\^?!))|[\\w\\W])*?`)([\\n\\x1a\\t\\v\\f\\r ,;=\\xa0]*)(\\))", ByGroups(UsingSelf("bqstring"), Text, Punctuation), nil}, - Include("for2"), - }, - "for/l": { - {`-?\d+`, LiteralNumberInteger, nil}, - Include("for2"), - }, - "if": { - {`((?:cmdextversion|errorlevel)(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(\d+)`, ByGroups(Keyword, UsingSelf("text"), LiteralNumberInteger), Pop(1)}, - {`(defined(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))((?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))`, ByGroups(Keyword, UsingSelf("text"), UsingSelf("variable")), Pop(1)}, - {`(exist(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)(?:[&<>|]+|(?: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\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)`, UsingSelf("text"), Push("#pop", "if2")}, - }, - "if2": { - {`((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(==)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))`, ByGroups(UsingSelf("text"), Operator, UsingSelf("text")), Pop(1)}, - {`((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))((?:equ|geq|gtr|leq|lss|neq))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))`, ByGroups(UsingSelf("text"), OperatorWord, UsingSelf("text")), Pop(1)}, - }, - "(?": { - {`(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)`, UsingSelf("text"), nil}, - {`\(`, Punctuation, Push("#pop", "else?", "root/compound")}, - Default(Pop(1)), - }, - "else?": { - {`(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)`, UsingSelf("text"), nil}, - {`else(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])`, Keyword, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bibtex.go b/vendor/github.com/alecthomas/chroma/lexers/b/bibtex.go deleted file mode 100644 index 1d76b1d8..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/bibtex.go +++ /dev/null @@ -1,76 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Bibtex lexer. -var Bibtex = internal.Register(MustNewLexer( - &Config{ - Name: "BibTeX", - Aliases: []string{"bib", "bibtex"}, - Filenames: []string{"*.bib"}, - MimeTypes: []string{"text/x-bibtex"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - Include("whitespace"), - {`@comment`, Comment, nil}, - {`@preamble`, NameClass, Push("closing-brace", "value", "opening-brace")}, - {`@string`, NameClass, Push("closing-brace", "field", "opening-brace")}, - {"@[a-z_@!$&*+\\-./:;<>?\\[\\\\\\]^`|~][\\w@!$&*+\\-./:;<>?\\[\\\\\\]^`|~]*", NameClass, Push("closing-brace", "command-body", "opening-brace")}, - {`.+`, Comment, nil}, - }, - "opening-brace": { - Include("whitespace"), - {`[{(]`, Punctuation, Pop(1)}, - }, - "closing-brace": { - Include("whitespace"), - {`[})]`, Punctuation, Pop(1)}, - }, - "command-body": { - Include("whitespace"), - {`[^\s\,\}]+`, NameLabel, Push("#pop", "fields")}, - }, - "fields": { - Include("whitespace"), - {`,`, Punctuation, Push("field")}, - Default(Pop(1)), - }, - "field": { - Include("whitespace"), - {"[a-z_@!$&*+\\-./:;<>?\\[\\\\\\]^`|~][\\w@!$&*+\\-./:;<>?\\[\\\\\\]^`|~]*", NameAttribute, Push("value", "=")}, - Default(Pop(1)), - }, - "=": { - Include("whitespace"), - {`=`, Punctuation, Pop(1)}, - }, - "value": { - Include("whitespace"), - {"[a-z_@!$&*+\\-./:;<>?\\[\\\\\\]^`|~][\\w@!$&*+\\-./:;<>?\\[\\\\\\]^`|~]*", NameVariable, nil}, - {`"`, LiteralString, Push("quoted-string")}, - {`\{`, LiteralString, Push("braced-string")}, - {`[\d]+`, LiteralNumber, nil}, - {`#`, Punctuation, nil}, - Default(Pop(1)), - }, - "quoted-string": { - {`\{`, LiteralString, Push("braced-string")}, - {`"`, LiteralString, Pop(1)}, - {`[^\{\"]+`, LiteralString, nil}, - }, - "braced-string": { - {`\{`, LiteralString, Push()}, - {`\}`, LiteralString, Pop(1)}, - {`[^\{\}]+`, LiteralString, nil}, - }, - "whitespace": { - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/blitz.go b/vendor/github.com/alecthomas/chroma/lexers/b/blitz.go deleted file mode 100644 index 5d5ffc85..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/blitz.go +++ /dev/null @@ -1,48 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Blitzbasic lexer. -var Blitzbasic = internal.Register(MustNewLexer( - &Config{ - Name: "BlitzBasic", - Aliases: []string{"blitzbasic", "b3d", "bplus"}, - Filenames: []string{"*.bb", "*.decls"}, - MimeTypes: []string{"text/x-bb"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`[ \t]+`, Text, nil}, - {`;.*?\n`, CommentSingle, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`[0-9]+\.[0-9]*(?!\.)`, LiteralNumberFloat, nil}, - {`\.[0-9]+(?!\.)`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`\$[0-9a-f]+`, LiteralNumberHex, nil}, - {`\%[10]+`, LiteralNumberBin, nil}, - {Words(`\b`, `\b`, `Shl`, `Shr`, `Sar`, `Mod`, `Or`, `And`, `Not`, `Abs`, `Sgn`, `Handle`, `Int`, `Float`, `Str`, `First`, `Last`, `Before`, `After`), Operator, nil}, - {`([+\-*/~=<>^])`, Operator, nil}, - {`[(),:\[\]\\]`, Punctuation, nil}, - {`\.([ \t]*)([a-z]\w*)`, NameLabel, nil}, - {`\b(New)\b([ \t]+)([a-z]\w*)`, ByGroups(KeywordReserved, Text, NameClass), nil}, - {`\b(Gosub|Goto)\b([ \t]+)([a-z]\w*)`, ByGroups(KeywordReserved, Text, NameLabel), nil}, - {`\b(Object)\b([ \t]*)([.])([ \t]*)([a-z]\w*)\b`, ByGroups(Operator, Text, Punctuation, Text, NameClass), nil}, - {`\b([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?\b([ \t]*)(\()`, ByGroups(NameFunction, Text, KeywordType, Text, Punctuation, Text, NameClass, Text, Punctuation), nil}, - {`\b(Function)\b([ \t]+)([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?`, ByGroups(KeywordReserved, Text, NameFunction, Text, KeywordType, Text, Punctuation, Text, NameClass), nil}, - {`\b(Type)([ \t]+)([a-z]\w*)`, ByGroups(KeywordReserved, Text, NameClass), nil}, - {`\b(Pi|True|False|Null)\b`, KeywordConstant, nil}, - {`\b(Local|Global|Const|Field|Dim)\b`, KeywordDeclaration, nil}, - {Words(`\b`, `\b`, `End`, `Return`, `Exit`, `Chr`, `Len`, `Asc`, `New`, `Delete`, `Insert`, `Include`, `Function`, `Type`, `If`, `Then`, `Else`, `ElseIf`, `EndIf`, `For`, `To`, `Next`, `Step`, `Each`, `While`, `Wend`, `Repeat`, `Until`, `Forever`, `Select`, `Case`, `Default`, `Goto`, `Gosub`, `Data`, `Read`, `Restore`), KeywordReserved, nil}, - {`([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?`, ByGroups(NameVariable, Text, KeywordType, Text, Punctuation, Text, NameClass), nil}, - }, - "string": { - {`""`, LiteralStringDouble, nil}, - {`"C?`, LiteralStringDouble, Pop(1)}, - {`[^"]+`, LiteralStringDouble, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bnf.go b/vendor/github.com/alecthomas/chroma/lexers/b/bnf.go deleted file mode 100644 index 5123a45a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/bnf.go +++ /dev/null @@ -1,24 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Bnf lexer. -var Bnf = internal.Register(MustNewLexer( - &Config{ - Name: "BNF", - Aliases: []string{"bnf"}, - Filenames: []string{"*.bnf"}, - MimeTypes: []string{"text/x-bnf"}, - }, - Rules{ - "root": { - {`(<)([ -;=?-~]+)(>)`, ByGroups(Punctuation, NameClass, Punctuation), nil}, - {`::=`, Operator, nil}, - {`[^<>:]+`, Text, nil}, - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/brainfuck.go b/vendor/github.com/alecthomas/chroma/lexers/b/brainfuck.go deleted file mode 100644 index 6fac5f5e..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/b/brainfuck.go +++ /dev/null @@ -1,34 +0,0 @@ -package b - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Brainfuck lexer. -var Brainfuck = internal.Register(MustNewLexer( - &Config{ - Name: "Brainfuck", - Aliases: []string{"brainfuck", "bf"}, - Filenames: []string{"*.bf", "*.b"}, - MimeTypes: []string{"application/x-brainfuck"}, - }, - Rules{ - "common": { - {`[.,]+`, NameTag, nil}, - {`[+-]+`, NameBuiltin, nil}, - {`[<>]+`, NameVariable, nil}, - {`[^.,+\-<>\[\]]+`, Comment, nil}, - }, - "root": { - {`\[`, Keyword, Push("loop")}, - {`\]`, Error, nil}, - Include("common"), - }, - "loop": { - {`\[`, Keyword, Push()}, - {`\]`, Keyword, Pop(1)}, - Include("common"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/c.go b/vendor/github.com/alecthomas/chroma/lexers/c/c.go deleted file mode 100644 index df2c0faa..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/c.go +++ /dev/null @@ -1,91 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// C lexer. -var C = internal.Register(MustNewLexer( - &Config{ - Name: "C", - Aliases: []string{"c"}, - Filenames: []string{"*.c", "*.h", "*.idc"}, - MimeTypes: []string{"text/x-chdr", "text/x-csrc"}, - }, - Rules{ - "whitespace": { - {`^#if\s+0`, CommentPreproc, Push("if0")}, - {`^#`, CommentPreproc, Push("macro")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("if0")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("macro")}, - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil}, - }, - "statements": { - {`(L?)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')`, ByGroups(LiteralStringAffix, LiteralStringChar, LiteralStringChar, LiteralStringChar), nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+[LlUu]*`, LiteralNumberHex, nil}, - {`0[0-7]+[LlUu]*`, LiteralNumberOct, nil}, - {`\d+[LlUu]*`, LiteralNumberInteger, nil}, - {`\*/`, Error, nil}, - {`[~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[()\[\],.]`, Punctuation, nil}, - {Words(``, `\b`, `asm`, `auto`, `break`, `case`, `const`, `continue`, `default`, `do`, `else`, `enum`, `extern`, `for`, `goto`, `if`, `register`, `restricted`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `volatile`, `while`), Keyword, nil}, - {`(bool|int|long|float|short|double|char|unsigned|signed|void)\b`, KeywordType, nil}, - {Words(``, `\b`, `inline`, `_inline`, `__inline`, `naked`, `restrict`, `thread`, `typename`), KeywordReserved, nil}, - {`(__m(128i|128d|128|64))\b`, KeywordReserved, nil}, - {Words(`__`, `\b`, `asm`, `int8`, `based`, `except`, `int16`, `stdcall`, `cdecl`, `fastcall`, `int32`, `declspec`, `finally`, `int64`, `try`, `leave`, `wchar_t`, `w64`, `unaligned`, `raise`, `noop`, `identifier`, `forceinline`, `assume`), KeywordReserved, nil}, - {`(true|false|NULL)\b`, NameBuiltin, nil}, - {`([a-zA-Z_]\w*)(\s*)(:)(?!:)`, ByGroups(NameLabel, Text, Punctuation), nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "root": { - Include("whitespace"), - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), Push("function")}, - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), nil}, - Default(Push("statement")), - }, - "statement": { - Include("whitespace"), - Include("statements"), - {`[{}]`, Punctuation, nil}, - {`;`, Punctuation, Pop(1)}, - }, - "function": { - Include("whitespace"), - Include("statements"), - {`;`, Punctuation, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "macro": { - {`(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)`, ByGroups(CommentPreproc, Text, CommentPreprocFile), nil}, - {`[^/\n]+`, CommentPreproc, nil}, - {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {`/`, CommentPreproc, nil}, - {`(?<=\\)\n`, CommentPreproc, nil}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "if0": { - {`^\s*#if.*?(?|+=:;,./?-]`, Operator, nil}, - {`\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?`, LiteralNumberFloat, nil}, - {`\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?`, LiteralNumberFloat, nil}, - {`[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?`, LiteralNumberFloat, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?`, LiteralNumberFloat, nil}, - {`#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+`, LiteralNumberHex, nil}, - {`#[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`\$([01]{4})(_[01]{4})+`, LiteralNumberBin, nil}, - {`\$[01]+`, LiteralNumberBin, nil}, - {`\d{1,3}(_\d{3})+[kMGTP]?`, LiteralNumberInteger, nil}, - {`[0-9]+[kMGTP]?`, LiteralNumberInteger, nil}, - {`\n`, Text, nil}, - }, - "class": { - {`[A-Za-z_]\w*`, NameClass, Pop(1)}, - }, - "import": { - {`[a-z][\w.]*`, NameNamespace, Pop(1)}, - }, - "comment": { - {`[^*/]`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cfengine3.go b/vendor/github.com/alecthomas/chroma/lexers/c/cfengine3.go deleted file mode 100644 index f96252fa..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cfengine3.go +++ /dev/null @@ -1,56 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Cfengine3 lexer. -var Cfengine3 = internal.Register(MustNewLexer( - &Config{ - Name: "CFEngine3", - Aliases: []string{"cfengine3", "cf3"}, - Filenames: []string{"*.cf"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`#.*?\n`, Comment, nil}, - {`(body)(\s+)(\S+)(\s+)(control)`, ByGroups(Keyword, Text, Keyword, Text, Keyword), nil}, - {`(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()`, ByGroups(Keyword, Text, Keyword, Text, NameFunction, Punctuation), Push("arglist")}, - {`(body|bundle)(\s+)(\S+)(\s+)(\w+)`, ByGroups(Keyword, Text, Keyword, Text, NameFunction), nil}, - {`(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)`, ByGroups(Punctuation, NameVariable, Punctuation, Text, KeywordType, Text, Operator, Text), nil}, - {`(\S+)(\s*)(=>)(\s*)`, ByGroups(KeywordReserved, Text, Operator, Text), nil}, - {`"`, LiteralString, Push("string")}, - {`(\w+)(\()`, ByGroups(NameFunction, Punctuation), nil}, - {`([\w.!&|()]+)(::)`, ByGroups(NameClass, Punctuation), nil}, - {`(\w+)(:)`, ByGroups(KeywordDeclaration, Punctuation), nil}, - {`@[{(][^)}]+[})]`, NameVariable, nil}, - {`[(){},;]`, Punctuation, nil}, - {`=>`, Operator, nil}, - {`->`, Operator, nil}, - {`\d+\.\d+`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`\w+`, NameFunction, nil}, - {`\s+`, Text, nil}, - }, - "string": { - {`\$[{(]`, LiteralStringInterpol, Push("interpol")}, - {`\\.`, LiteralStringEscape, nil}, - {`"`, LiteralString, Pop(1)}, - {`\n`, LiteralString, nil}, - {`.`, LiteralString, nil}, - }, - "interpol": { - {`\$[{(]`, LiteralStringInterpol, Push()}, - {`[})]`, LiteralStringInterpol, Pop(1)}, - {`[^${()}]+`, LiteralStringInterpol, nil}, - }, - "arglist": { - {`\)`, Punctuation, Pop(1)}, - {`,`, Punctuation, nil}, - {`\w+`, NameVariable, nil}, - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/chaiscript.go b/vendor/github.com/alecthomas/chroma/lexers/c/chaiscript.go deleted file mode 100644 index d2aa50db..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/chaiscript.go +++ /dev/null @@ -1,63 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Chaiscript lexer. -var Chaiscript = internal.Register(MustNewLexer( - &Config{ - Name: "ChaiScript", - Aliases: []string{"chai", "chaiscript"}, - Filenames: []string{"*.chai"}, - MimeTypes: []string{"text/x-chaiscript", "application/x-chaiscript"}, - DotAll: true, - }, - Rules{ - "commentsandwhitespace": { - {`\s+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`^\#.*?\n`, CommentSingle, nil}, - }, - "slashstartsregex": { - Include("commentsandwhitespace"), - {`/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)`, LiteralStringRegex, Pop(1)}, - {`(?=/)`, Text, Push("#pop", "badregex")}, - Default(Pop(1)), - }, - "badregex": { - {`\n`, Text, Pop(1)}, - }, - "root": { - Include("commentsandwhitespace"), - {`\n`, Text, nil}, - {`[^\S\n]+`, Text, nil}, - {`\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|\.\.(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?`, Operator, Push("slashstartsregex")}, - {`[{(\[;,]`, Punctuation, Push("slashstartsregex")}, - {`[})\].]`, Punctuation, nil}, - {`[=+\-*/]`, Operator, nil}, - {`(for|in|while|do|break|return|continue|if|else|throw|try|catch)\b`, Keyword, Push("slashstartsregex")}, - {`(var)\b`, KeywordDeclaration, Push("slashstartsregex")}, - {`(attr|def|fun)\b`, KeywordReserved, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`(eval|throw)\b`, NameBuiltin, nil}, - {"`\\S+`", NameBuiltin, nil}, - {`[$a-zA-Z_]\w*`, NameOther, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`"`, LiteralStringDouble, Push("dqstring")}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - }, - "dqstring": { - {`\$\{[^"}]+?\}`, LiteralStringInterpol, nil}, - {`\$`, LiteralStringDouble, nil}, - {`\\\\`, LiteralStringDouble, nil}, - {`\\"`, LiteralStringDouble, nil}, - {`[^\\"$]+`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cheetah.go b/vendor/github.com/alecthomas/chroma/lexers/c/cheetah.go deleted file mode 100644 index b2cb9c40..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cheetah.go +++ /dev/null @@ -1,37 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" - . "github.com/alecthomas/chroma/lexers/p" // nolint -) - -// Cheetah lexer. -var Cheetah = internal.Register(MustNewLexer( - &Config{ - Name: "Cheetah", - Aliases: []string{"cheetah", "spitfire"}, - Filenames: []string{"*.tmpl", "*.spt"}, - MimeTypes: []string{"application/x-cheetah", "application/x-spitfire"}, - }, - Rules{ - "root": { - {`(##[^\n]*)$`, ByGroups(Comment), nil}, - {`#[*](.|\n)*?[*]#`, Comment, nil}, - {`#end[^#\n]*(?:#|$)`, CommentPreproc, nil}, - {`#slurp$`, CommentPreproc, nil}, - {`(#[a-zA-Z]+)([^#\n]*)(#|$)`, ByGroups(CommentPreproc, Using(Python), CommentPreproc), nil}, - {`(\$)([a-zA-Z_][\w.]*\w)`, ByGroups(CommentPreproc, Using(Python)), nil}, - {`(\$\{!?)(.*?)(\})(?s)`, ByGroups(CommentPreproc, Using(Python), CommentPreproc), nil}, - {`(?sx) - (.+?) # anything, followed by: - (?: - (?=\#[#a-zA-Z]*) | # an eval comment - (?=\$[a-zA-Z_{]) | # a substitution - \Z # end of string - ) - `, Other, nil}, - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cl.go b/vendor/github.com/alecthomas/chroma/lexers/c/cl.go deleted file mode 100644 index fdc97297..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cl.go +++ /dev/null @@ -1,306 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var ( - clBuiltinFunctions = []string{ - "<", "<=", "=", ">", ">=", "-", "/", "/=", "*", "+", "1-", "1+", - "abort", "abs", "acons", "acos", "acosh", "add-method", "adjoin", - "adjustable-array-p", "adjust-array", "allocate-instance", - "alpha-char-p", "alphanumericp", "append", "apply", "apropos", - "apropos-list", "aref", "arithmetic-error-operands", - "arithmetic-error-operation", "array-dimension", "array-dimensions", - "array-displacement", "array-element-type", "array-has-fill-pointer-p", - "array-in-bounds-p", "arrayp", "array-rank", "array-row-major-index", - "array-total-size", "ash", "asin", "asinh", "assoc", "assoc-if", - "assoc-if-not", "atan", "atanh", "atom", "bit", "bit-and", "bit-andc1", - "bit-andc2", "bit-eqv", "bit-ior", "bit-nand", "bit-nor", "bit-not", - "bit-orc1", "bit-orc2", "bit-vector-p", "bit-xor", "boole", - "both-case-p", "boundp", "break", "broadcast-stream-streams", - "butlast", "byte", "byte-position", "byte-size", "caaaar", "caaadr", - "caaar", "caadar", "caaddr", "caadr", "caar", "cadaar", "cadadr", - "cadar", "caddar", "cadddr", "caddr", "cadr", "call-next-method", "car", - "cdaaar", "cdaadr", "cdaar", "cdadar", "cdaddr", "cdadr", "cdar", - "cddaar", "cddadr", "cddar", "cdddar", "cddddr", "cdddr", "cddr", "cdr", - "ceiling", "cell-error-name", "cerror", "change-class", "char", "char<", - "char<=", "char=", "char>", "char>=", "char/=", "character", - "characterp", "char-code", "char-downcase", "char-equal", - "char-greaterp", "char-int", "char-lessp", "char-name", - "char-not-equal", "char-not-greaterp", "char-not-lessp", "char-upcase", - "cis", "class-name", "class-of", "clear-input", "clear-output", - "close", "clrhash", "code-char", "coerce", "compile", - "compiled-function-p", "compile-file", "compile-file-pathname", - "compiler-macro-function", "complement", "complex", "complexp", - "compute-applicable-methods", "compute-restarts", "concatenate", - "concatenated-stream-streams", "conjugate", "cons", "consp", - "constantly", "constantp", "continue", "copy-alist", "copy-list", - "copy-pprint-dispatch", "copy-readtable", "copy-seq", "copy-structure", - "copy-symbol", "copy-tree", "cos", "cosh", "count", "count-if", - "count-if-not", "decode-float", "decode-universal-time", "delete", - "delete-duplicates", "delete-file", "delete-if", "delete-if-not", - "delete-package", "denominator", "deposit-field", "describe", - "describe-object", "digit-char", "digit-char-p", "directory", - "directory-namestring", "disassemble", "documentation", "dpb", - "dribble", "echo-stream-input-stream", "echo-stream-output-stream", - "ed", "eighth", "elt", "encode-universal-time", "endp", - "enough-namestring", "ensure-directories-exist", - "ensure-generic-function", "eq", "eql", "equal", "equalp", "error", - "eval", "evenp", "every", "exp", "export", "expt", "fboundp", - "fceiling", "fdefinition", "ffloor", "fifth", "file-author", - "file-error-pathname", "file-length", "file-namestring", - "file-position", "file-string-length", "file-write-date", - "fill", "fill-pointer", "find", "find-all-symbols", "find-class", - "find-if", "find-if-not", "find-method", "find-package", "find-restart", - "find-symbol", "finish-output", "first", "float", "float-digits", - "floatp", "float-precision", "float-radix", "float-sign", "floor", - "fmakunbound", "force-output", "format", "fourth", "fresh-line", - "fround", "ftruncate", "funcall", "function-keywords", - "function-lambda-expression", "functionp", "gcd", "gensym", "gentemp", - "get", "get-decoded-time", "get-dispatch-macro-character", "getf", - "gethash", "get-internal-real-time", "get-internal-run-time", - "get-macro-character", "get-output-stream-string", "get-properties", - "get-setf-expansion", "get-universal-time", "graphic-char-p", - "hash-table-count", "hash-table-p", "hash-table-rehash-size", - "hash-table-rehash-threshold", "hash-table-size", "hash-table-test", - "host-namestring", "identity", "imagpart", "import", - "initialize-instance", "input-stream-p", "inspect", - "integer-decode-float", "integer-length", "integerp", - "interactive-stream-p", "intern", "intersection", - "invalid-method-error", "invoke-debugger", "invoke-restart", - "invoke-restart-interactively", "isqrt", "keywordp", "last", "lcm", - "ldb", "ldb-test", "ldiff", "length", "lisp-implementation-type", - "lisp-implementation-version", "list", "list*", "list-all-packages", - "listen", "list-length", "listp", "load", - "load-logical-pathname-translations", "log", "logand", "logandc1", - "logandc2", "logbitp", "logcount", "logeqv", "logical-pathname", - "logical-pathname-translations", "logior", "lognand", "lognor", - "lognot", "logorc1", "logorc2", "logtest", "logxor", "long-site-name", - "lower-case-p", "machine-instance", "machine-type", "machine-version", - "macroexpand", "macroexpand-1", "macro-function", "make-array", - "make-broadcast-stream", "make-concatenated-stream", "make-condition", - "make-dispatch-macro-character", "make-echo-stream", "make-hash-table", - "make-instance", "make-instances-obsolete", "make-list", - "make-load-form", "make-load-form-saving-slots", "make-package", - "make-pathname", "make-random-state", "make-sequence", "make-string", - "make-string-input-stream", "make-string-output-stream", "make-symbol", - "make-synonym-stream", "make-two-way-stream", "makunbound", "map", - "mapc", "mapcan", "mapcar", "mapcon", "maphash", "map-into", "mapl", - "maplist", "mask-field", "max", "member", "member-if", "member-if-not", - "merge", "merge-pathnames", "method-combination-error", - "method-qualifiers", "min", "minusp", "mismatch", "mod", - "muffle-warning", "name-char", "namestring", "nbutlast", "nconc", - "next-method-p", "nintersection", "ninth", "no-applicable-method", - "no-next-method", "not", "notany", "notevery", "nreconc", "nreverse", - "nset-difference", "nset-exclusive-or", "nstring-capitalize", - "nstring-downcase", "nstring-upcase", "nsublis", "nsubst", "nsubst-if", - "nsubst-if-not", "nsubstitute", "nsubstitute-if", "nsubstitute-if-not", - "nth", "nthcdr", "null", "numberp", "numerator", "nunion", "oddp", - "open", "open-stream-p", "output-stream-p", "package-error-package", - "package-name", "package-nicknames", "packagep", - "package-shadowing-symbols", "package-used-by-list", "package-use-list", - "pairlis", "parse-integer", "parse-namestring", "pathname", - "pathname-device", "pathname-directory", "pathname-host", - "pathname-match-p", "pathname-name", "pathnamep", "pathname-type", - "pathname-version", "peek-char", "phase", "plusp", "position", - "position-if", "position-if-not", "pprint", "pprint-dispatch", - "pprint-fill", "pprint-indent", "pprint-linear", "pprint-newline", - "pprint-tab", "pprint-tabular", "prin1", "prin1-to-string", "princ", - "princ-to-string", "print", "print-object", "probe-file", "proclaim", - "provide", "random", "random-state-p", "rassoc", "rassoc-if", - "rassoc-if-not", "rational", "rationalize", "rationalp", "read", - "read-byte", "read-char", "read-char-no-hang", "read-delimited-list", - "read-from-string", "read-line", "read-preserving-whitespace", - "read-sequence", "readtable-case", "readtablep", "realp", "realpart", - "reduce", "reinitialize-instance", "rem", "remhash", "remove", - "remove-duplicates", "remove-if", "remove-if-not", "remove-method", - "remprop", "rename-file", "rename-package", "replace", "require", - "rest", "restart-name", "revappend", "reverse", "room", "round", - "row-major-aref", "rplaca", "rplacd", "sbit", "scale-float", "schar", - "search", "second", "set", "set-difference", - "set-dispatch-macro-character", "set-exclusive-or", - "set-macro-character", "set-pprint-dispatch", "set-syntax-from-char", - "seventh", "shadow", "shadowing-import", "shared-initialize", - "short-site-name", "signal", "signum", "simple-bit-vector-p", - "simple-condition-format-arguments", "simple-condition-format-control", - "simple-string-p", "simple-vector-p", "sin", "sinh", "sixth", "sleep", - "slot-boundp", "slot-exists-p", "slot-makunbound", "slot-missing", - "slot-unbound", "slot-value", "software-type", "software-version", - "some", "sort", "special-operator-p", "sqrt", "stable-sort", - "standard-char-p", "store-value", "stream-element-type", - "stream-error-stream", "stream-external-format", "streamp", "string", - "string<", "string<=", "string=", "string>", "string>=", "string/=", - "string-capitalize", "string-downcase", "string-equal", - "string-greaterp", "string-left-trim", "string-lessp", - "string-not-equal", "string-not-greaterp", "string-not-lessp", - "stringp", "string-right-trim", "string-trim", "string-upcase", - "sublis", "subseq", "subsetp", "subst", "subst-if", "subst-if-not", - "substitute", "substitute-if", "substitute-if-not", "subtypep", "svref", - "sxhash", "symbol-function", "symbol-name", "symbolp", "symbol-package", - "symbol-plist", "symbol-value", "synonym-stream-symbol", "syntax:", - "tailp", "tan", "tanh", "tenth", "terpri", "third", - "translate-logical-pathname", "translate-pathname", "tree-equal", - "truename", "truncate", "two-way-stream-input-stream", - "two-way-stream-output-stream", "type-error-datum", - "type-error-expected-type", "type-of", "typep", "unbound-slot-instance", - "unexport", "unintern", "union", "unread-char", "unuse-package", - "update-instance-for-different-class", - "update-instance-for-redefined-class", "upgraded-array-element-type", - "upgraded-complex-part-type", "upper-case-p", "use-package", - "user-homedir-pathname", "use-value", "values", "values-list", "vector", - "vectorp", "vector-pop", "vector-push", "vector-push-extend", "warn", - "wild-pathname-p", "write", "write-byte", "write-char", "write-line", - "write-sequence", "write-string", "write-to-string", "yes-or-no-p", - "y-or-n-p", "zerop", - } - - clSpecialForms = []string{ - "block", "catch", "declare", "eval-when", "flet", "function", "go", "if", - "labels", "lambda", "let", "let*", "load-time-value", "locally", "macrolet", - "multiple-value-call", "multiple-value-prog1", "progn", "progv", "quote", - "return-from", "setq", "symbol-macrolet", "tagbody", "the", "throw", - "unwind-protect", - } - - clMacros = []string{ - "and", "assert", "call-method", "case", "ccase", "check-type", "cond", - "ctypecase", "decf", "declaim", "defclass", "defconstant", "defgeneric", - "define-compiler-macro", "define-condition", "define-method-combination", - "define-modify-macro", "define-setf-expander", "define-symbol-macro", - "defmacro", "defmethod", "defpackage", "defparameter", "defsetf", - "defstruct", "deftype", "defun", "defvar", "destructuring-bind", "do", - "do*", "do-all-symbols", "do-external-symbols", "dolist", "do-symbols", - "dotimes", "ecase", "etypecase", "formatter", "handler-bind", - "handler-case", "ignore-errors", "incf", "in-package", "lambda", "loop", - "loop-finish", "make-method", "multiple-value-bind", "multiple-value-list", - "multiple-value-setq", "nth-value", "or", "pop", - "pprint-exit-if-list-exhausted", "pprint-logical-block", "pprint-pop", - "print-unreadable-object", "prog", "prog*", "prog1", "prog2", "psetf", - "psetq", "push", "pushnew", "remf", "restart-bind", "restart-case", - "return", "rotatef", "setf", "shiftf", "step", "time", "trace", "typecase", - "unless", "untrace", "when", "with-accessors", "with-compilation-unit", - "with-condition-restarts", "with-hash-table-iterator", - "with-input-from-string", "with-open-file", "with-open-stream", - "with-output-to-string", "with-package-iterator", "with-simple-restart", - "with-slots", "with-standard-io-syntax", - } - - clLambdaListKeywords = []string{ - "&allow-other-keys", "&aux", "&body", "&environment", "&key", "&optional", - "&rest", "&whole", - } - - clDeclarations = []string{ - "dynamic-extent", "ignore", "optimize", "ftype", "inline", "special", - "ignorable", "notinline", "type", - } - - clBuiltinTypes = []string{ - "atom", "boolean", "base-char", "base-string", "bignum", "bit", - "compiled-function", "extended-char", "fixnum", "keyword", "nil", - "signed-byte", "short-float", "single-float", "double-float", "long-float", - "simple-array", "simple-base-string", "simple-bit-vector", "simple-string", - "simple-vector", "standard-char", "unsigned-byte", - - // Condition Types - "arithmetic-error", "cell-error", "condition", "control-error", - "division-by-zero", "end-of-file", "error", "file-error", - "floating-point-inexact", "floating-point-overflow", - "floating-point-underflow", "floating-point-invalid-operation", - "parse-error", "package-error", "print-not-readable", "program-error", - "reader-error", "serious-condition", "simple-condition", "simple-error", - "simple-type-error", "simple-warning", "stream-error", "storage-condition", - "style-warning", "type-error", "unbound-variable", "unbound-slot", - "undefined-function", "warning", - } - - clBuiltinClasses = []string{ - "array", "broadcast-stream", "bit-vector", "built-in-class", "character", - "class", "complex", "concatenated-stream", "cons", "echo-stream", - "file-stream", "float", "function", "generic-function", "hash-table", - "integer", "list", "logical-pathname", "method-combination", "method", - "null", "number", "package", "pathname", "ratio", "rational", "readtable", - "real", "random-state", "restart", "sequence", "standard-class", - "standard-generic-function", "standard-method", "standard-object", - "string-stream", "stream", "string", "structure-class", "structure-object", - "symbol", "synonym-stream", "t", "two-way-stream", "vector", - } -) - -// Common Lisp lexer. -var CommonLisp = internal.Register(TypeRemappingLexer(MustNewLexer( - &Config{ - Name: "Common Lisp", - Aliases: []string{"common-lisp", "cl", "lisp"}, - Filenames: []string{"*.cl", "*.lisp"}, - MimeTypes: []string{"text/x-common-lisp"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - Default(Push("body")), - }, - "multiline-comment": { - {`#\|`, CommentMultiline, Push()}, - {`\|#`, CommentMultiline, Pop(1)}, - {`[^|#]+`, CommentMultiline, nil}, - {`[|#]`, CommentMultiline, nil}, - }, - "commented-form": { - {`\(`, CommentPreproc, Push()}, - {`\)`, CommentPreproc, Pop(1)}, - {`[^()]+`, CommentPreproc, nil}, - }, - "body": { - {`\s+`, Text, nil}, - {`;.*$`, CommentSingle, nil}, - {`#\|`, CommentMultiline, Push("multiline-comment")}, - {`#\d*Y.*$`, CommentSpecial, nil}, - {`"(\\.|\\\n|[^"\\])*"`, LiteralString, nil}, - {`:(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringSymbol, nil}, - {`::(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringSymbol, nil}, - {`:#(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringSymbol, nil}, - {`'(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringSymbol, nil}, - {`'`, Operator, nil}, - {"`", Operator, nil}, - {"[-+]?\\d+\\.?(?=[ \"()\\'\\n,;`])", LiteralNumberInteger, nil}, - {"[-+]?\\d+/\\d+(?=[ \"()\\'\\n,;`])", LiteralNumber, nil}, - {"[-+]?(\\d*\\.\\d+([defls][-+]?\\d+)?|\\d+(\\.\\d*)?[defls][-+]?\\d+)(?=[ \"()\\'\\n,;`])", LiteralNumberFloat, nil}, - {"#\\\\.(?=[ \"()\\'\\n,;`])", LiteralStringChar, nil}, - {`#\\(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringChar, nil}, - {`#\(`, Operator, Push("body")}, - {`#\d*\*[01]*`, LiteralOther, nil}, - {`#:(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, LiteralStringSymbol, nil}, - {`#[.,]`, Operator, nil}, - {`#\'`, NameFunction, nil}, - {`#b[+-]?[01]+(/[01]+)?`, LiteralNumberBin, nil}, - {`#o[+-]?[0-7]+(/[0-7]+)?`, LiteralNumberOct, nil}, - {`#x[+-]?[0-9a-f]+(/[0-9a-f]+)?`, LiteralNumberHex, nil}, - {`#\d+r[+-]?[0-9a-z]+(/[0-9a-z]+)?`, LiteralNumber, nil}, - {`(#c)(\()`, ByGroups(LiteralNumber, Punctuation), Push("body")}, - {`(#\d+a)(\()`, ByGroups(LiteralOther, Punctuation), Push("body")}, - {`(#s)(\()`, ByGroups(LiteralOther, Punctuation), Push("body")}, - {`#p?"(\\.|[^"])*"`, LiteralOther, nil}, - {`#\d+=`, Operator, nil}, - {`#\d+#`, Operator, nil}, - {"#+nil(?=[ \"()\\'\\n,;`])\\s*\\(", CommentPreproc, Push("commented-form")}, - {`#[+-]`, Operator, nil}, - {`(,@|,|\.)`, Operator, nil}, - {"(t|nil)(?=[ \"()\\'\\n,;`])", NameConstant, nil}, - {`\*(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)\*`, NameVariableGlobal, nil}, - {`(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)`, NameVariable, nil}, - {`\(`, Punctuation, Push("body")}, - {`\)`, Punctuation, Pop(1)}, - }, - }, -), TypeMapping{ - {NameVariable, NameFunction, clBuiltinFunctions}, - {NameVariable, Keyword, clSpecialForms}, - {NameVariable, NameBuiltin, clMacros}, - {NameVariable, Keyword, clLambdaListKeywords}, - {NameVariable, Keyword, clDeclarations}, - {NameVariable, KeywordType, clBuiltinTypes}, - {NameVariable, NameClass, clBuiltinClasses}, -})) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/clojure.go b/vendor/github.com/alecthomas/chroma/lexers/c/clojure.go deleted file mode 100644 index e63752a5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/clojure.go +++ /dev/null @@ -1,38 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Clojure lexer. -var Clojure = internal.Register(MustNewLexer( - &Config{ - Name: "Clojure", - Aliases: []string{"clojure", "clj"}, - Filenames: []string{"*.clj"}, - MimeTypes: []string{"text/x-clojure", "application/x-clojure"}, - }, - Rules{ - "root": { - {`;.*$`, CommentSingle, nil}, - {`[,\s]+`, Text, nil}, - {`-?\d+\.\d+`, LiteralNumberFloat, nil}, - {`-?\d+`, LiteralNumberInteger, nil}, - {`0x-?[abcdef\d]+`, LiteralNumberHex, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'(?!#)[\w!$%*+<=>?/.#-]+`, LiteralStringSymbol, nil}, - {`\\(.|[a-z]+)`, LiteralStringChar, nil}, - {`::?#?(?!#)[\w!$%*+<=>?/.#-]+`, LiteralStringSymbol, nil}, - {"~@|[`\\'#^~&@]", Operator, nil}, - {Words(``, ` `, `.`, `def`, `do`, `fn`, `if`, `let`, `new`, `quote`, `var`, `loop`), Keyword, nil}, - {Words(``, ` `, `def-`, `defn`, `defn-`, `defmacro`, `defmulti`, `defmethod`, `defstruct`, `defonce`, `declare`, `definline`, `definterface`, `defprotocol`, `defrecord`, `deftype`, `defproject`, `ns`), KeywordDeclaration, nil}, - {Words(``, ` `, `*`, `+`, `-`, `->`, `/`, `<`, `<=`, `=`, `==`, `>`, `>=`, `..`, `accessor`, `agent`, `agent-errors`, `aget`, `alength`, `all-ns`, `alter`, `and`, `append-child`, `apply`, `array-map`, `aset`, `aset-boolean`, `aset-byte`, `aset-char`, `aset-double`, `aset-float`, `aset-int`, `aset-long`, `aset-short`, `assert`, `assoc`, `await`, `await-for`, `bean`, `binding`, `bit-and`, `bit-not`, `bit-or`, `bit-shift-left`, `bit-shift-right`, `bit-xor`, `boolean`, `branch?`, `butlast`, `byte`, `cast`, `char`, `children`, `class`, `clear-agent-errors`, `comment`, `commute`, `comp`, `comparator`, `complement`, `concat`, `conj`, `cons`, `constantly`, `cond`, `if-not`, `construct-proxy`, `contains?`, `count`, `create-ns`, `create-struct`, `cycle`, `dec`, `deref`, `difference`, `disj`, `dissoc`, `distinct`, `doall`, `doc`, `dorun`, `doseq`, `dosync`, `dotimes`, `doto`, `double`, `down`, `drop`, `drop-while`, `edit`, `end?`, `ensure`, `eval`, `every?`, `false?`, `ffirst`, `file-seq`, `filter`, `find`, `find-doc`, `find-ns`, `find-var`, `first`, `float`, `flush`, `for`, `fnseq`, `frest`, `gensym`, `get-proxy-class`, `get`, `hash-map`, `hash-set`, `identical?`, `identity`, `if-let`, `import`, `in-ns`, `inc`, `index`, `insert-child`, `insert-left`, `insert-right`, `inspect-table`, `inspect-tree`, `instance?`, `int`, `interleave`, `intersection`, `into`, `into-array`, `iterate`, `join`, `key`, `keys`, `keyword`, `keyword?`, `last`, `lazy-cat`, `lazy-cons`, `left`, `lefts`, `line-seq`, `list*`, `list`, `load`, `load-file`, `locking`, `long`, `loop`, `macroexpand`, `macroexpand-1`, `make-array`, `make-node`, `map`, `map-invert`, `map?`, `mapcat`, `max`, `max-key`, `memfn`, `merge`, `merge-with`, `meta`, `min`, `min-key`, `name`, `namespace`, `neg?`, `new`, `newline`, `next`, `nil?`, `node`, `not`, `not-any?`, `not-every?`, `not=`, `ns-imports`, `ns-interns`, `ns-map`, `ns-name`, `ns-publics`, `ns-refers`, `ns-resolve`, `ns-unmap`, `nth`, `nthrest`, `or`, `parse`, `partial`, `path`, `peek`, `pop`, `pos?`, `pr`, `pr-str`, `print`, `print-str`, `println`, `println-str`, `prn`, `prn-str`, `project`, `proxy`, `proxy-mappings`, `quot`, `rand`, `rand-int`, `range`, `re-find`, `re-groups`, `re-matcher`, `re-matches`, `re-pattern`, `re-seq`, `read`, `read-line`, `reduce`, `ref`, `ref-set`, `refer`, `rem`, `remove`, `remove-method`, `remove-ns`, `rename`, `rename-keys`, `repeat`, `replace`, `replicate`, `resolve`, `rest`, `resultset-seq`, `reverse`, `rfirst`, `right`, `rights`, `root`, `rrest`, `rseq`, `second`, `select`, `select-keys`, `send`, `send-off`, `seq`, `seq-zip`, `seq?`, `set`, `short`, `slurp`, `some`, `sort`, `sort-by`, `sorted-map`, `sorted-map-by`, `sorted-set`, `special-symbol?`, `split-at`, `split-with`, `str`, `string?`, `struct`, `struct-map`, `subs`, `subvec`, `symbol`, `symbol?`, `sync`, `take`, `take-nth`, `take-while`, `test`, `time`, `to-array`, `to-array-2d`, `tree-seq`, `true?`, `union`, `up`, `update-proxy`, `val`, `vals`, `var-get`, `var-set`, `var?`, `vector`, `vector-zip`, `vector?`, `when`, `when-first`, `when-let`, `when-not`, `with-local-vars`, `with-meta`, `with-open`, `with-out-str`, `xml-seq`, `xml-zip`, `zero?`, `zipmap`, `zipper`), NameBuiltin, nil}, - {`(?<=\()(?!#)[\w!$%*+<=>?/.#-]+`, NameFunction, nil}, - {`(?!#)[\w!$%*+<=>?/.#-]+`, NameVariable, nil}, - {`(\[|\])`, Punctuation, nil}, - {`(\{|\})`, Punctuation, nil}, - {`(\(|\))`, Punctuation, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cmake.go b/vendor/github.com/alecthomas/chroma/lexers/c/cmake.go deleted file mode 100644 index 163f17d9..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cmake.go +++ /dev/null @@ -1,44 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Cmake lexer. -var Cmake = internal.Register(MustNewLexer( - &Config{ - Name: "CMake", - Aliases: []string{"cmake"}, - Filenames: []string{"*.cmake", "CMakeLists.txt"}, - MimeTypes: []string{"text/x-cmake"}, - }, - Rules{ - "root": { - {`\b(\w+)([ \t]*)(\()`, ByGroups(NameBuiltin, Text, Punctuation), Push("args")}, - Include("keywords"), - Include("ws"), - }, - "args": { - {`\(`, Punctuation, Push()}, - {`\)`, Punctuation, Pop(1)}, - {`(\$\{)(.+?)(\})`, ByGroups(Operator, NameVariable, Operator), nil}, - {`(\$ENV\{)(.+?)(\})`, ByGroups(Operator, NameVariable, Operator), nil}, - {`(\$<)(.+?)(>)`, ByGroups(Operator, NameVariable, Operator), nil}, - {`(?s)".*?"`, LiteralStringDouble, nil}, - {`\\\S+`, LiteralString, nil}, - {`[^)$"# \t\n]+`, LiteralString, nil}, - {`\n`, Text, nil}, - Include("keywords"), - Include("ws"), - }, - "string": {}, - "keywords": { - {`\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|MSVC70|MSVC71|MSVC80|MSVC90)\b`, Keyword, nil}, - }, - "ws": { - {`[ \t]+`, Text, nil}, - {`#.*\n`, Comment, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cobol.go b/vendor/github.com/alecthomas/chroma/lexers/c/cobol.go deleted file mode 100644 index e9ae0bb7..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cobol.go +++ /dev/null @@ -1,51 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Cobol lexer. -var Cobol = internal.Register(MustNewLexer( - &Config{ - Name: "COBOL", - Aliases: []string{"cobol"}, - Filenames: []string{"*.cob", "*.COB", "*.cpy", "*.CPY"}, - MimeTypes: []string{"text/x-cobol"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - Include("comment"), - Include("strings"), - Include("core"), - Include("nums"), - {`[a-z0-9]([\w\-]*[a-z0-9]+)?`, NameVariable, nil}, - {`[ \t]+`, Text, nil}, - }, - "comment": { - {`(^.{6}[*/].*\n|^.{6}|\*>.*\n)`, Comment, nil}, - }, - "core": { - {`(^|(?<=[^\w\-]))(ALL\s+)?((ZEROES)|(HIGH-VALUE|LOW-VALUE|QUOTE|SPACE|ZERO)(S)?)\s*($|(?=[^\w\-]))`, NameConstant, nil}, - {Words(`(^|(?<=[^\w\-]))`, `\s*($|(?=[^\w\-]))`, `ACCEPT`, `ADD`, `ALLOCATE`, `CALL`, `CANCEL`, `CLOSE`, `COMPUTE`, `CONFIGURATION`, `CONTINUE`, `DATA`, `DELETE`, `DISPLAY`, `DIVIDE`, `DIVISION`, `ELSE`, `END`, `END-ACCEPT`, `END-ADD`, `END-CALL`, `END-COMPUTE`, `END-DELETE`, `END-DISPLAY`, `END-DIVIDE`, `END-EVALUATE`, `END-IF`, `END-MULTIPLY`, `END-OF-PAGE`, `END-PERFORM`, `END-READ`, `END-RETURN`, `END-REWRITE`, `END-SEARCH`, `END-START`, `END-STRING`, `END-SUBTRACT`, `END-UNSTRING`, `END-WRITE`, `ENVIRONMENT`, `EVALUATE`, `EXIT`, `FD`, `FILE`, `FILE-CONTROL`, `FOREVER`, `FREE`, `GENERATE`, `GO`, `GOBACK`, `IDENTIFICATION`, `IF`, `INITIALIZE`, `INITIATE`, `INPUT-OUTPUT`, `INSPECT`, `INVOKE`, `I-O-CONTROL`, `LINKAGE`, `LOCAL-STORAGE`, `MERGE`, `MOVE`, `MULTIPLY`, `OPEN`, `PERFORM`, `PROCEDURE`, `PROGRAM-ID`, `RAISE`, `READ`, `RELEASE`, `RESUME`, `RETURN`, `REWRITE`, `SCREEN`, `SD`, `SEARCH`, `SECTION`, `SET`, `SORT`, `START`, `STOP`, `STRING`, `SUBTRACT`, `SUPPRESS`, `TERMINATE`, `THEN`, `UNLOCK`, `UNSTRING`, `USE`, `VALIDATE`, `WORKING-STORAGE`, `WRITE`), KeywordReserved, nil}, - {Words(`(^|(?<=[^\w\-]))`, `\s*($|(?=[^\w\-]))`, `ACCESS`, `ADDRESS`, `ADVANCING`, `AFTER`, `ALL`, `ALPHABET`, `ALPHABETIC`, `ALPHABETIC-LOWER`, `ALPHABETIC-UPPER`, `ALPHANUMERIC`, `ALPHANUMERIC-EDITED`, `ALSO`, `ALTER`, `ALTERNATEANY`, `ARE`, `AREA`, `AREAS`, `ARGUMENT-NUMBER`, `ARGUMENT-VALUE`, `AS`, `ASCENDING`, `ASSIGN`, `AT`, `AUTO`, `AUTO-SKIP`, `AUTOMATIC`, `AUTOTERMINATE`, `BACKGROUND-COLOR`, `BASED`, `BEEP`, `BEFORE`, `BELL`, `BLANK`, `BLINK`, `BLOCK`, `BOTTOM`, `BY`, `BYTE-LENGTH`, `CHAINING`, `CHARACTER`, `CHARACTERS`, `CLASS`, `CODE`, `CODE-SET`, `COL`, `COLLATING`, `COLS`, `COLUMN`, `COLUMNS`, `COMMA`, `COMMAND-LINE`, `COMMIT`, `COMMON`, `CONSTANT`, `CONTAINS`, `CONTENT`, `CONTROL`, `CONTROLS`, `CONVERTING`, `COPY`, `CORR`, `CORRESPONDING`, `COUNT`, `CRT`, `CURRENCY`, `CURSOR`, `CYCLE`, `DATE`, `DAY`, `DAY-OF-WEEK`, `DE`, `DEBUGGING`, `DECIMAL-POINT`, `DECLARATIVES`, `DEFAULT`, `DELIMITED`, `DELIMITER`, `DEPENDING`, `DESCENDING`, `DETAIL`, `DISK`, `DOWN`, `DUPLICATES`, `DYNAMIC`, `EBCDIC`, `ENTRY`, `ENVIRONMENT-NAME`, `ENVIRONMENT-VALUE`, `EOL`, `EOP`, `EOS`, `ERASE`, `ERROR`, `ESCAPE`, `EXCEPTION`, `EXCLUSIVE`, `EXTEND`, `EXTERNAL`, `FILE-ID`, `FILLER`, `FINAL`, `FIRST`, `FIXED`, `FLOAT-LONG`, `FLOAT-SHORT`, `FOOTING`, `FOR`, `FOREGROUND-COLOR`, `FORMAT`, `FROM`, `FULL`, `FUNCTION`, `FUNCTION-ID`, `GIVING`, `GLOBAL`, `GROUP`, `HEADING`, `HIGHLIGHT`, `I-O`, `ID`, `IGNORE`, `IGNORING`, `IN`, `INDEX`, `INDEXED`, `INDICATE`, `INITIAL`, `INITIALIZED`, `INPUT`, `INTO`, `INTRINSIC`, `INVALID`, `IS`, `JUST`, `JUSTIFIED`, `KEY`, `LABEL`, `LAST`, `LEADING`, `LEFT`, `LENGTH`, `LIMIT`, `LIMITS`, `LINAGE`, `LINAGE-COUNTER`, `LINE`, `LINES`, `LOCALE`, `LOCK`, `LOWLIGHT`, `MANUAL`, `MEMORY`, `MINUS`, `MODE`, `MULTIPLE`, `NATIONAL`, `NATIONAL-EDITED`, `NATIVE`, `NEGATIVE`, `NEXT`, `NO`, `NULL`, `NULLS`, `NUMBER`, `NUMBERS`, `NUMERIC`, `NUMERIC-EDITED`, `OBJECT-COMPUTER`, `OCCURS`, `OF`, `OFF`, `OMITTED`, `ON`, `ONLY`, `OPTIONAL`, `ORDER`, `ORGANIZATION`, `OTHER`, `OUTPUT`, `OVERFLOW`, `OVERLINE`, `PACKED-DECIMAL`, `PADDING`, `PAGE`, `PARAGRAPH`, `PLUS`, `POINTER`, `POSITION`, `POSITIVE`, `PRESENT`, `PREVIOUS`, `PRINTER`, `PRINTING`, `PROCEDURE-POINTER`, `PROCEDURES`, `PROCEED`, `PROGRAM`, `PROGRAM-POINTER`, `PROMPT`, `QUOTE`, `QUOTES`, `RANDOM`, `RD`, `RECORD`, `RECORDING`, `RECORDS`, `RECURSIVE`, `REDEFINES`, `REEL`, `REFERENCE`, `RELATIVE`, `REMAINDER`, `REMOVAL`, `RENAMES`, `REPLACING`, `REPORT`, `REPORTING`, `REPORTS`, `REPOSITORY`, `REQUIRED`, `RESERVE`, `RETURNING`, `REVERSE-VIDEO`, `REWIND`, `RIGHT`, `ROLLBACK`, `ROUNDED`, `RUN`, `SAME`, `SCROLL`, `SECURE`, `SEGMENT-LIMIT`, `SELECT`, `SENTENCE`, `SEPARATE`, `SEQUENCE`, `SEQUENTIAL`, `SHARING`, `SIGN`, `SIGNED`, `SIGNED-INT`, `SIGNED-LONG`, `SIGNED-SHORT`, `SIZE`, `SORT-MERGE`, `SOURCE`, `SOURCE-COMPUTER`, `SPECIAL-NAMES`, `STANDARD`, `STANDARD-1`, `STANDARD-2`, `STATUS`, `SUM`, `SYMBOLIC`, `SYNC`, `SYNCHRONIZED`, `TALLYING`, `TAPE`, `TEST`, `THROUGH`, `THRU`, `TIME`, `TIMES`, `TO`, `TOP`, `TRAILING`, `TRANSFORM`, `TYPE`, `UNDERLINE`, `UNIT`, `UNSIGNED`, `UNSIGNED-INT`, `UNSIGNED-LONG`, `UNSIGNED-SHORT`, `UNTIL`, `UP`, `UPDATE`, `UPON`, `USAGE`, `USING`, `VALUE`, `VALUES`, `VARYING`, `WAIT`, `WHEN`, `WITH`, `WORDS`, `YYYYDDD`, `YYYYMMDD`), KeywordPseudo, nil}, - {Words(`(^|(?<=[^\w\-]))`, `\s*($|(?=[^\w\-]))`, `ACTIVE-CLASS`, `ALIGNED`, `ANYCASE`, `ARITHMETIC`, `ATTRIBUTE`, `B-AND`, `B-NOT`, `B-OR`, `B-XOR`, `BIT`, `BOOLEAN`, `CD`, `CENTER`, `CF`, `CH`, `CHAIN`, `CLASS-ID`, `CLASSIFICATION`, `COMMUNICATION`, `CONDITION`, `DATA-POINTER`, `DESTINATION`, `DISABLE`, `EC`, `EGI`, `EMI`, `ENABLE`, `END-RECEIVE`, `ENTRY-CONVENTION`, `EO`, `ESI`, `EXCEPTION-OBJECT`, `EXPANDS`, `FACTORY`, `FLOAT-BINARY-16`, `FLOAT-BINARY-34`, `FLOAT-BINARY-7`, `FLOAT-DECIMAL-16`, `FLOAT-DECIMAL-34`, `FLOAT-EXTENDED`, `FORMAT`, `FUNCTION-POINTER`, `GET`, `GROUP-USAGE`, `IMPLEMENTS`, `INFINITY`, `INHERITS`, `INTERFACE`, `INTERFACE-ID`, `INVOKE`, `LC_ALL`, `LC_COLLATE`, `LC_CTYPE`, `LC_MESSAGES`, `LC_MONETARY`, `LC_NUMERIC`, `LC_TIME`, `LINE-COUNTER`, `MESSAGE`, `METHOD`, `METHOD-ID`, `NESTED`, `NONE`, `NORMAL`, `OBJECT`, `OBJECT-REFERENCE`, `OPTIONS`, `OVERRIDE`, `PAGE-COUNTER`, `PF`, `PH`, `PROPERTY`, `PROTOTYPE`, `PURGE`, `QUEUE`, `RAISE`, `RAISING`, `RECEIVE`, `RELATION`, `REPLACE`, `REPRESENTS-NOT-A-NUMBER`, `RESET`, `RESUME`, `RETRY`, `RF`, `RH`, `SECONDS`, `SEGMENT`, `SELF`, `SEND`, `SOURCES`, `STATEMENT`, `STEP`, `STRONG`, `SUB-QUEUE-1`, `SUB-QUEUE-2`, `SUB-QUEUE-3`, `SUPER`, `SYMBOL`, `SYSTEM-DEFAULT`, `TABLE`, `TERMINAL`, `TEXT`, `TYPEDEF`, `UCS-4`, `UNIVERSAL`, `USER-DEFAULT`, `UTF-16`, `UTF-8`, `VAL-STATUS`, `VALID`, `VALIDATE`, `VALIDATE-STATUS`), Error, nil}, - {`(^|(?<=[^\w\-]))(PIC\s+.+?(?=(\s|\.\s))|PICTURE\s+.+?(?=(\s|\.\s))|(COMPUTATIONAL)(-[1-5X])?|(COMP)(-[1-5X])?|BINARY-C-LONG|BINARY-CHAR|BINARY-DOUBLE|BINARY-LONG|BINARY-SHORT|BINARY)\s*($|(?=[^\w\-]))`, KeywordType, nil}, - {`(\*\*|\*|\+|-|/|<=|>=|<|>|==|/=|=)`, Operator, nil}, - {`([(),;:&%.])`, Punctuation, nil}, - {`(^|(?<=[^\w\-]))(ABS|ACOS|ANNUITY|ASIN|ATAN|BYTE-LENGTH|CHAR|COMBINED-DATETIME|CONCATENATE|COS|CURRENT-DATE|DATE-OF-INTEGER|DATE-TO-YYYYMMDD|DAY-OF-INTEGER|DAY-TO-YYYYDDD|EXCEPTION-(?:FILE|LOCATION|STATEMENT|STATUS)|EXP10|EXP|E|FACTORIAL|FRACTION-PART|INTEGER-OF-(?:DATE|DAY|PART)|INTEGER|LENGTH|LOCALE-(?:DATE|TIME(?:-FROM-SECONDS)?)|LOG(?:10)?|LOWER-CASE|MAX|MEAN|MEDIAN|MIDRANGE|MIN|MOD|NUMVAL(?:-C)?|ORD(?:-MAX|-MIN)?|PI|PRESENT-VALUE|RANDOM|RANGE|REM|REVERSE|SECONDS-FROM-FORMATTED-TIME|SECONDS-PAST-MIDNIGHT|SIGN|SIN|SQRT|STANDARD-DEVIATION|STORED-CHAR-LENGTH|SUBSTITUTE(?:-CASE)?|SUM|TAN|TEST-DATE-YYYYMMDD|TEST-DAY-YYYYDDD|TRIM|UPPER-CASE|VARIANCE|WHEN-COMPILED|YEAR-TO-YYYY)\s*($|(?=[^\w\-]))`, NameFunction, nil}, - {`(^|(?<=[^\w\-]))(true|false)\s*($|(?=[^\w\-]))`, NameBuiltin, nil}, - {`(^|(?<=[^\w\-]))(equal|equals|ne|lt|le|gt|ge|greater|less|than|not|and|or)\s*($|(?=[^\w\-]))`, OperatorWord, nil}, - }, - "strings": { - {`"[^"\n]*("|\n)`, LiteralStringDouble, nil}, - {`'[^'\n]*('|\n)`, LiteralStringSingle, nil}, - }, - "nums": { - {`\d+(\s*|\.$|$)`, LiteralNumberInteger, nil}, - {`[+-]?\d*\.\d+(E[-+]?\d+)?`, LiteralNumberFloat, nil}, - {`[+-]?\d+\.\d*(E[-+]?\d+)?`, LiteralNumberFloat, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/coffee.go b/vendor/github.com/alecthomas/chroma/lexers/c/coffee.go deleted file mode 100644 index e402b8f2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/coffee.go +++ /dev/null @@ -1,91 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Coffeescript lexer. -var Coffeescript = internal.Register(MustNewLexer( - &Config{ - Name: "CoffeeScript", - Aliases: []string{"coffee-script", "coffeescript", "coffee"}, - Filenames: []string{"*.coffee"}, - MimeTypes: []string{"text/coffeescript"}, - NotMultiline: true, - DotAll: true, - }, - Rules{ - "commentsandwhitespace": { - {`\s+`, Text, nil}, - {`###[^#].*?###`, CommentMultiline, nil}, - {`#(?!##[^#]).*?\n`, CommentSingle, nil}, - }, - "multilineregex": { - {`[^/#]+`, LiteralStringRegex, nil}, - {`///([gim]+\b|\B)`, LiteralStringRegex, Pop(1)}, - {`#\{`, LiteralStringInterpol, Push("interpoling_string")}, - {`[/#]`, LiteralStringRegex, nil}, - }, - "slashstartsregex": { - Include("commentsandwhitespace"), - {`///`, LiteralStringRegex, Push("#pop", "multilineregex")}, - {`/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)`, LiteralStringRegex, Pop(1)}, - {`/`, Operator, nil}, - Default(Pop(1)), - }, - "root": { - Include("commentsandwhitespace"), - {`^(?=\s|/)`, Text, Push("slashstartsregex")}, - {"\\+\\+|~|&&|\\band\\b|\\bor\\b|\\bis\\b|\\bisnt\\b|\\bnot\\b|\\?|:|\\|\\||\\\\(?=\\n)|(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\\|\\^/])=?", Operator, Push("slashstartsregex")}, - {`(?:\([^()]*\))?\s*[=-]>`, NameFunction, Push("slashstartsregex")}, - {`[{(\[;,]`, Punctuation, Push("slashstartsregex")}, - {`[})\].]`, Punctuation, nil}, - {`(?=|<|>|==`, Operator, nil}, - {`mod\b`, Operator, nil}, - {`(eq|lt|gt|lte|gte|not|is|and|or)\b`, Operator, nil}, - {`\|\||&&`, Operator, nil}, - {`\?`, Operator, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`'.*?'`, LiteralStringSingle, nil}, - {`\d+`, LiteralNumber, nil}, - {`(if|else|len|var|xml|default|break|switch|component|property|function|do|try|catch|in|continue|for|return|while|required|any|array|binary|boolean|component|date|guid|numeric|query|string|struct|uuid|case)\b`, Keyword, nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(application|session|client|cookie|super|this|variables|arguments)\b`, NameConstant, nil}, - {`([a-z_$][\w.]*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[a-z_$][\w.]*`, NameVariable, nil}, - {`[()\[\]{};:,.\\]`, Punctuation, nil}, - {`\s+`, Text, nil}, - }, - "string": { - {`""`, LiteralStringDouble, nil}, - {`#.+?#`, LiteralStringInterpol, nil}, - {`[^"#]+`, LiteralStringDouble, nil}, - {`#`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/coq.go b/vendor/github.com/alecthomas/chroma/lexers/c/coq.go deleted file mode 100644 index e69a5c16..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/coq.go +++ /dev/null @@ -1,63 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Coq lexer. -var Coq = internal.Register(MustNewLexer( - &Config{ - Name: "Coq", - Aliases: []string{"coq"}, - Filenames: []string{"*.v"}, - MimeTypes: []string{"text/x-coq"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`false|true|\(\)|\[\]`, NameBuiltinPseudo, nil}, - {`\(\*`, Comment, Push("comment")}, - {Words(`\b`, `\b`, `Section`, `Module`, `End`, `Require`, `Import`, `Export`, `Variable`, `Variables`, `Parameter`, `Parameters`, `Axiom`, `Hypothesis`, `Hypotheses`, `Notation`, `Local`, `Tactic`, `Reserved`, `Scope`, `Open`, `Close`, `Bind`, `Delimit`, `Definition`, `Let`, `Ltac`, `Fixpoint`, `CoFixpoint`, `Morphism`, `Relation`, `Implicit`, `Arguments`, `Set`, `Unset`, `Contextual`, `Strict`, `Prenex`, `Implicits`, `Inductive`, `CoInductive`, `Record`, `Structure`, `Canonical`, `Coercion`, `Theorem`, `Lemma`, `Corollary`, `Proposition`, `Fact`, `Remark`, `Example`, `Proof`, `Goal`, `Save`, `Qed`, `Defined`, `Hint`, `Resolve`, `Rewrite`, `View`, `Search`, `Show`, `Print`, `Printing`, `All`, `Graph`, `Projections`, `inside`, `outside`, `Check`, `Global`, `Instance`, `Class`, `Existing`, `Universe`, `Polymorphic`, `Monomorphic`, `Context`), KeywordNamespace, nil}, - {Words(`\b`, `\b`, `forall`, `exists`, `exists2`, `fun`, `fix`, `cofix`, `struct`, `match`, `end`, `in`, `return`, `let`, `if`, `is`, `then`, `else`, `for`, `of`, `nosimpl`, `with`, `as`), Keyword, nil}, - {Words(`\b`, `\b`, `Type`, `Prop`), KeywordType, nil}, - {Words(`\b`, `\b`, `pose`, `set`, `move`, `case`, `elim`, `apply`, `clear`, `hnf`, `intro`, `intros`, `generalize`, `rename`, `pattern`, `after`, `destruct`, `induction`, `using`, `refine`, `inversion`, `injection`, `rewrite`, `congr`, `unlock`, `compute`, `ring`, `field`, `replace`, `fold`, `unfold`, `change`, `cutrewrite`, `simpl`, `have`, `suff`, `wlog`, `suffices`, `without`, `loss`, `nat_norm`, `assert`, `cut`, `trivial`, `revert`, `bool_congr`, `nat_congr`, `symmetry`, `transitivity`, `auto`, `split`, `left`, `right`, `autorewrite`, `tauto`, `setoid_rewrite`, `intuition`, `eauto`, `eapply`, `econstructor`, `etransitivity`, `constructor`, `erewrite`, `red`, `cbv`, `lazy`, `vm_compute`, `native_compute`, `subst`), Keyword, nil}, - {Words(`\b`, `\b`, `by`, `done`, `exact`, `reflexivity`, `tauto`, `romega`, `omega`, `assumption`, `solve`, `contradiction`, `discriminate`, `congruence`), KeywordPseudo, nil}, - {Words(`\b`, `\b`, `do`, `last`, `first`, `try`, `idtac`, `repeat`), KeywordReserved, nil}, - {`\b([A-Z][\w\']*)`, Name, nil}, - {"(\u03bb|\u03a0|\\|\\}|\\{\\||\\\\/|/\\\\|=>|~|\\}|\\|]|\\||\\{<|\\{|`|_|]|\\[\\||\\[>|\\[<|\\[|\\?\\?|\\?|>\\}|>]|>|=|<->|<-|<|;;|;|:>|:=|::|:|\\.\\.|\\.|->|-\\.|-|,|\\+|\\*|\\)|\\(|&&|&|#|!=)", Operator, nil}, - {`([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]`, Operator, nil}, - {`\b(unit|nat|bool|string|ascii|list)\b`, KeywordType, nil}, - {`[^\W\d][\w']*`, Name, nil}, - {`\d[\d_]*`, LiteralNumberInteger, nil}, - {`0[xX][\da-fA-F][\da-fA-F_]*`, LiteralNumberHex, nil}, - {`0[oO][0-7][0-7_]*`, LiteralNumberOct, nil}, - {`0[bB][01][01_]*`, LiteralNumberBin, nil}, - {`-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)`, LiteralNumberFloat, nil}, - {`'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'`, LiteralStringChar, nil}, - {`'.'`, LiteralStringChar, nil}, - {`'`, Keyword, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`[~?][a-z][\w\']*:`, Name, nil}, - }, - "comment": { - {`[^(*)]+`, Comment, nil}, - {`\(\*`, Comment, Push()}, - {`\*\)`, Comment, Pop(1)}, - {`[(*)]`, Comment, nil}, - }, - "string": { - {`[^"]+`, LiteralStringDouble, nil}, - {`""`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "dotted": { - {`\s+`, Text, nil}, - {`\.`, Punctuation, nil}, - {`[A-Z][\w\']*(?=\s*\.)`, NameNamespace, nil}, - {`[A-Z][\w\']*`, NameClass, Pop(1)}, - {`[a-z][a-z0-9_\']*`, Name, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cpp.go b/vendor/github.com/alecthomas/chroma/lexers/c/cpp.go deleted file mode 100644 index 104be240..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cpp.go +++ /dev/null @@ -1,106 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// CPP lexer. -var CPP = internal.Register(MustNewLexer( - &Config{ - Name: "C++", - Aliases: []string{"cpp", "c++"}, - Filenames: []string{"*.cpp", "*.hpp", "*.c++", "*.h++", "*.cc", "*.hh", "*.cxx", "*.hxx", "*.C", "*.H", "*.cp", "*.CPP"}, - MimeTypes: []string{"text/x-c++hdr", "text/x-c++src"}, - EnsureNL: true, - }, - Rules{ - "statements": { - {Words(``, `\b`, `catch`, `const_cast`, `delete`, `dynamic_cast`, `explicit`, `export`, `friend`, `mutable`, `namespace`, `new`, `operator`, `private`, `protected`, `public`, `reinterpret_cast`, `restrict`, `static_cast`, `template`, `this`, `throw`, `throws`, `try`, `typeid`, `typename`, `using`, `virtual`, `constexpr`, `nullptr`, `decltype`, `thread_local`, `alignas`, `alignof`, `static_assert`, `noexcept`, `override`, `final`, `concept`, `requires`, `consteval`, `co_await`, `co_return`, `co_yield`), Keyword, nil}, - {`(enum)\b(\s+)(class)\b(\s*)`, ByGroups(Keyword, Text, Keyword, Text), Push("classname")}, - {`(class|struct|enum|union)\b(\s*)`, ByGroups(Keyword, Text), Push("classname")}, - {`\[\[.+\]\]`, NameAttribute, nil}, - {`(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")`, ByGroups(LiteralStringAffix, LiteralString, LiteralStringDelimiter, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, LiteralString), nil}, - {`(u8|u|U)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')`, ByGroups(LiteralStringAffix, LiteralStringChar, LiteralStringChar, LiteralStringChar), nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`0[xX]([0-9A-Fa-f]('?[0-9A-Fa-f]+)*)[LlUu]*`, LiteralNumberHex, nil}, - {`0('?[0-7]+)+[LlUu]*`, LiteralNumberOct, nil}, - {`0[Bb][01]('?[01]+)*[LlUu]*`, LiteralNumberBin, nil}, - {`[0-9]('?[0-9]+)*[LlUu]*`, LiteralNumberInteger, nil}, - {`\*/`, Error, nil}, - {`[~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[()\[\],.]`, Punctuation, nil}, - {Words(``, `\b`, `asm`, `auto`, `break`, `case`, `const`, `continue`, `default`, `do`, `else`, `enum`, `extern`, `for`, `goto`, `if`, `register`, `restricted`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `volatile`, `while`), Keyword, nil}, - {`(bool|int|long|float|short|double|char((8|16|32)_t)?|wchar_t|unsigned|signed|void|u?int(_fast|_least|)(8|16|32|64)_t)\b`, KeywordType, nil}, - {Words(``, `\b`, `inline`, `_inline`, `__inline`, `naked`, `restrict`, `thread`, `typename`), KeywordReserved, nil}, - {`(__m(128i|128d|128|64))\b`, KeywordReserved, nil}, - {Words(`__`, `\b`, `asm`, `int8`, `based`, `except`, `int16`, `stdcall`, `cdecl`, `fastcall`, `int32`, `declspec`, `finally`, `int64`, `try`, `leave`, `w64`, `unaligned`, `raise`, `noop`, `identifier`, `forceinline`, `assume`), KeywordReserved, nil}, - {`(true|false|NULL)\b`, NameBuiltin, nil}, - {`([a-zA-Z_]\w*)(\s*)(:)(?!:)`, ByGroups(NameLabel, Text, Punctuation), nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "root": { - Include("whitespace"), - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), Push("function")}, - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), nil}, - Default(Push("statement")), - {Words(`__`, `\b`, `virtual_inheritance`, `uuidof`, `super`, `single_inheritance`, `multiple_inheritance`, `interface`, `event`), KeywordReserved, nil}, - {`__(offload|blockingoffload|outer)\b`, KeywordPseudo, nil}, - }, - "classname": { - {`(\[\[.+\]\])(\s*)`, ByGroups(NameAttribute, Text), nil}, - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - {`\s*(?=[>{])`, Text, Pop(1)}, - }, - "whitespace": { - {`^#if\s+0`, CommentPreproc, Push("if0")}, - {`^#`, CommentPreproc, Push("macro")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("if0")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("macro")}, - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil}, - }, - "statement": { - Include("whitespace"), - Include("statements"), - {`[{]`, Punctuation, Push("root")}, - {`[;}]`, Punctuation, Pop(1)}, - }, - "function": { - Include("whitespace"), - Include("statements"), - {`;`, Punctuation, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "macro": { - {`(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)`, ByGroups(CommentPreproc, Text, CommentPreprocFile), nil}, - {`[^/\n]+`, CommentPreproc, nil}, - {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {`/`, CommentPreproc, nil}, - {`(?<=\\)\n`, CommentPreproc, nil}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "if0": { - {`^\s*#if.*?(?=~!@#%^&|`?-]+", Operator, nil}, - {`(?s)(java|javascript)(\s+)(AS)(\s+)('|\$\$)(.*?)(\5)`, - UsingByGroup( - internal.Get, - 1, 6, - NameBuiltin, TextWhitespace, Keyword, TextWhitespace, - LiteralStringHeredoc, LiteralStringHeredoc, LiteralStringHeredoc, - ), - nil, - }, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`0x[0-9a-f]+`, LiteralNumberHex, nil}, - {`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`, LiteralNumberHex, nil}, - {`\.[0-9]+(e[+-]?[0-9]+)?`, Error, nil}, - {`-?[0-9]+(\.[0-9])?(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`'`, LiteralStringSingle, Push("string")}, - {`"`, LiteralStringName, Push("quoted-ident")}, - {`\$\$`, LiteralStringHeredoc, Push("dollar-string")}, - {`[a-z_]\w*`, Name, nil}, - {`:(['"]?)[a-z]\w*\b\1`, NameVariable, nil}, - {`[;:()\[\]\{\},.]`, Punctuation, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "quoted-ident": { - {`[^"]+`, LiteralStringName, nil}, - {`""`, LiteralStringName, nil}, - {`"`, LiteralStringName, Pop(1)}, - }, - "dollar-string": { - {`[^\$]+`, LiteralStringHeredoc, nil}, - {`\$\$`, LiteralStringHeredoc, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/crystal.go b/vendor/github.com/alecthomas/chroma/lexers/c/crystal.go deleted file mode 100644 index 69e053c7..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/crystal.go +++ /dev/null @@ -1,262 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Crystal lexer. -var Crystal = internal.Register(MustNewLexer( - &Config{ - Name: "Crystal", - Aliases: []string{"cr", "crystal"}, - Filenames: []string{"*.cr"}, - MimeTypes: []string{"text/x-crystal"}, - DotAll: true, - }, - Rules{ - "root": { - {`#.*?$`, CommentSingle, nil}, - {Words(``, `\b`, `abstract`, `asm`, `as`, `begin`, `break`, `case`, `do`, `else`, `elsif`, `end`, `ensure`, `extend`, `ifdef`, `if`, `include`, `instance_sizeof`, `next`, `of`, `pointerof`, `private`, `protected`, `rescue`, `return`, `require`, `sizeof`, `super`, `then`, `typeof`, `unless`, `until`, `when`, `while`, `with`, `yield`), Keyword, nil}, - {Words(``, `\b`, `true`, `false`, `nil`), KeywordConstant, nil}, - {`(module|lib)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)`, ByGroups(Keyword, Text, NameNamespace), nil}, - {`(def|fun|macro)(\s+)((?:[a-zA-Z_]\w*::)*)`, ByGroups(Keyword, Text, NameNamespace), Push("funcname")}, - {"def(?=[*%&^`~+-/\\[<>=])", Keyword, Push("funcname")}, - {`(class|struct|union|type|alias|enum)(\s+)((?:[a-zA-Z_]\w*::)*)`, ByGroups(Keyword, Text, NameNamespace), Push("classname")}, - {`(self|out|uninitialized)\b|(is_a|responds_to)\?`, KeywordPseudo, nil}, - {Words(``, `\b`, `debugger`, `record`, `pp`, `assert_responds_to`, `spawn`, `parallel`, `getter`, `setter`, `property`, `delegate`, `def_hash`, `def_equals`, `def_equals_and_hash`, `forward_missing_to`), NameBuiltinPseudo, nil}, - {`getter[!?]|property[!?]|__(DIR|FILE|LINE)__\b`, NameBuiltinPseudo, nil}, - {Words(`(?~!:])|(?<=(?:\s|;)when\s)|(?<=(?:\s|;)or\s)|(?<=(?:\s|;)and\s)|(?<=\.index\s)|(?<=\.scan\s)|(?<=\.sub\s)|(?<=\.sub!\s)|(?<=\.gsub\s)|(?<=\.gsub!\s)|(?<=\.match\s)|(?<=(?:\s|;)if\s)|(?<=(?:\s|;)elsif\s)|(?<=^when\s)|(?<=^index\s)|(?<=^scan\s)|(?<=^sub\s)|(?<=^gsub\s)|(?<=^sub!\s)|(?<=^gsub!\s)|(?<=^match\s)|(?<=^if\s)|(?<=^elsif\s))(\s*)(/)`, ByGroups(Text, LiteralStringRegex), Push("multiline-regex")}, - {`(?<=\(|,|\[)/`, LiteralStringRegex, Push("multiline-regex")}, - {`(\s+)(/)(?![\s=])`, ByGroups(Text, LiteralStringRegex), Push("multiline-regex")}, - {`(0o[0-7]+(?:_[0-7]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?`, ByGroups(LiteralNumberOct, Text, Operator), nil}, - {`(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?`, ByGroups(LiteralNumberHex, Text, Operator), nil}, - {`(0b[01]+(?:_[01]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?`, ByGroups(LiteralNumberBin, Text, Operator), nil}, - {`((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)(?:e[+-]?[0-9]+)?(?:_?f[0-9]+)?)(\s*)([/?])?`, ByGroups(LiteralNumberFloat, Text, Operator), nil}, - {`((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)(?:_?f[0-9]+)?)(\s*)([/?])?`, ByGroups(LiteralNumberFloat, Text, Operator), nil}, - {`((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)?(?:_?f[0-9]+))(\s*)([/?])?`, ByGroups(LiteralNumberFloat, Text, Operator), nil}, - {`(0\b|[1-9][\d]*(?:_\d+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil}, - {`@@[a-zA-Z_]\w*`, NameVariableClass, nil}, - {`@[a-zA-Z_]\w*`, NameVariableInstance, nil}, - {`\$\w+`, NameVariableGlobal, nil}, - {"\\$[!@&`\\'+~=/\\\\,;.<>_*$?:\"^-]", NameVariableGlobal, nil}, - {`\$-[0adFiIlpvw]`, NameVariableGlobal, nil}, - {`::`, Operator, nil}, - Include("strings"), - {`\?(\\[MC]-)*(\\([\\befnrtv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)(?!\w)`, LiteralStringChar, nil}, - {`[A-Z][A-Z_]+\b`, NameConstant, nil}, - {`\{%`, LiteralStringInterpol, Push("in-macro-control")}, - {`\{\{`, LiteralStringInterpol, Push("in-macro-expr")}, - {`(@\[)(\s*)([A-Z]\w*)`, ByGroups(Operator, Text, NameDecorator), Push("in-attr")}, - {Words(`(\.|::)`, ``, `!=`, `!~`, `!`, `%`, `&&`, `&`, `**`, `*`, `+`, `-`, `/`, `<=>`, `<<`, `<=`, `<`, `===`, `==`, `=~`, `=`, `>=`, `>>`, `>`, `[]=`, `[]?`, `[]`, `^`, `||`, `|`, `~`), ByGroups(Operator, NameOperator), nil}, - {"(\\.|::)([a-zA-Z_]\\w*[!?]?|[*%&^`~+\\-/\\[<>=])", ByGroups(Operator, Name), nil}, - {`[a-zA-Z_]\w*(?:[!?](?!=))?`, Name, nil}, - {`(\[|\]\??|\*\*|<=>?|>=|<>?|=~|===|!~|&&?|\|\||\.{1,3})`, Operator, nil}, - {`[-+/*%=<>&!^|~]=?`, Operator, nil}, - {`[(){};,/?:\\]`, Punctuation, nil}, - {`\s+`, Text, nil}, - }, - "funcname": { - {"(?:([a-zA-Z_]\\w*)(\\.))?([a-zA-Z_]\\w*[!?]?|\\*\\*?|[-+]@?|[/%&|^`~]|\\[\\]=?|<<|>>|<=?>|>=?|===?)", ByGroups(NameClass, Operator, NameFunction), Pop(1)}, - Default(Pop(1)), - }, - "classname": { - {`[A-Z_]\w*`, NameClass, nil}, - {`(\()(\s*)([A-Z_]\w*)(\s*)(\))`, ByGroups(Punctuation, Text, NameClass, Text, Punctuation), nil}, - Default(Pop(1)), - }, - "in-intp": { - {`\{`, LiteralStringInterpol, Push()}, - {`\}`, LiteralStringInterpol, Pop(1)}, - Include("root"), - }, - "string-intp": { - {`#\{`, LiteralStringInterpol, Push("in-intp")}, - }, - "string-escaped": { - {`\\([\\befnstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})`, LiteralStringEscape, nil}, - }, - "string-intp-escaped": { - Include("string-intp"), - Include("string-escaped"), - }, - "interpolated-regex": { - Include("string-intp"), - {`[\\#]`, LiteralStringRegex, nil}, - {`[^\\#]+`, LiteralStringRegex, nil}, - }, - "interpolated-string": { - Include("string-intp"), - {`[\\#]`, LiteralStringOther, nil}, - {`[^\\#]+`, LiteralStringOther, nil}, - }, - "multiline-regex": { - Include("string-intp"), - {`\\\\`, LiteralStringRegex, nil}, - {`\\/`, LiteralStringRegex, nil}, - {`[\\#]`, LiteralStringRegex, nil}, - {`[^\\/#]+`, LiteralStringRegex, nil}, - {`/[imsx]*`, LiteralStringRegex, Pop(1)}, - }, - "end-part": { - {`.+`, CommentPreproc, Pop(1)}, - }, - "in-macro-control": { - {`\{%`, LiteralStringInterpol, Push()}, - {`%\}`, LiteralStringInterpol, Pop(1)}, - {`for\b|in\b`, Keyword, nil}, - Include("root"), - }, - "in-macro-expr": { - {`\{\{`, LiteralStringInterpol, Push()}, - {`\}\}`, LiteralStringInterpol, Pop(1)}, - Include("root"), - }, - "in-attr": { - {`\[`, Operator, Push()}, - {`\]`, Operator, Pop(1)}, - Include("root"), - }, - "strings": { - {`\:@{0,2}[a-zA-Z_]\w*[!?]?`, LiteralStringSymbol, nil}, - {Words(`\:@{0,2}`, ``, `!=`, `!~`, `!`, `%`, `&&`, `&`, `**`, `*`, `+`, `-`, `/`, `<=>`, `<<`, `<=`, `<`, `===`, `==`, `=~`, `=`, `>=`, `>>`, `>`, `[]=`, `[]?`, `[]`, `^`, `||`, `|`, `~`), LiteralStringSymbol, nil}, - {`:'(\\\\|\\'|[^'])*'`, LiteralStringSymbol, nil}, - {`'(\\\\|\\'|[^']|\\[^'\\]+)'`, LiteralStringChar, nil}, - {`:"`, LiteralStringSymbol, Push("simple-sym")}, - {`([a-zA-Z_]\w*)(:)(?!:)`, ByGroups(LiteralStringSymbol, Punctuation), nil}, - {`"`, LiteralStringDouble, Push("simple-string")}, - {"(?&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)`, ByGroups(Text, LiteralStringOther, None), nil}, - {`^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)`, ByGroups(Text, LiteralStringOther, None), nil}, - {`(%([\[{(<]))((?:\\\2|(?!\2).)*)(\2)`, String, nil}, - }, - "simple-string": { - Include("string-intp-escaped"), - {`[^\\"#]+`, LiteralStringDouble, nil}, - {`[\\#]`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "simple-sym": { - Include("string-escaped"), - {`[^\\"#]+`, LiteralStringSymbol, nil}, - {`[\\#]`, LiteralStringSymbol, nil}, - {`"`, LiteralStringSymbol, Pop(1)}, - }, - "simple-backtick": { - Include("string-intp-escaped"), - {"[^\\\\`#]+", LiteralStringBacktick, nil}, - {`[\\#]`, LiteralStringBacktick, nil}, - {"`", LiteralStringBacktick, Pop(1)}, - }, - "cb-intp-string": { - {`\\[\{]`, LiteralStringOther, nil}, - {`\{`, LiteralStringOther, Push()}, - {`\}`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#{}]`, LiteralStringOther, nil}, - {`[^\\#{}]+`, LiteralStringOther, nil}, - }, - "cb-string": { - {`\\[\\{}]`, LiteralStringOther, nil}, - {`\{`, LiteralStringOther, Push()}, - {`\}`, LiteralStringOther, Pop(1)}, - {`[\\#{}]`, LiteralStringOther, nil}, - {`[^\\#{}]+`, LiteralStringOther, nil}, - }, - "cb-regex": { - {`\\[\\{}]`, LiteralStringRegex, nil}, - {`\{`, LiteralStringRegex, Push()}, - {`\}[imsx]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#{}]`, LiteralStringRegex, nil}, - {`[^\\#{}]+`, LiteralStringRegex, nil}, - }, - "sb-intp-string": { - {`\\[\[]`, LiteralStringOther, nil}, - {`\[`, LiteralStringOther, Push()}, - {`\]`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#\[\]]`, LiteralStringOther, nil}, - {`[^\\#\[\]]+`, LiteralStringOther, nil}, - }, - "sb-string": { - {`\\[\\\[\]]`, LiteralStringOther, nil}, - {`\[`, LiteralStringOther, Push()}, - {`\]`, LiteralStringOther, Pop(1)}, - {`[\\#\[\]]`, LiteralStringOther, nil}, - {`[^\\#\[\]]+`, LiteralStringOther, nil}, - }, - "sb-regex": { - {`\\[\\\[\]]`, LiteralStringRegex, nil}, - {`\[`, LiteralStringRegex, Push()}, - {`\][imsx]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#\[\]]`, LiteralStringRegex, nil}, - {`[^\\#\[\]]+`, LiteralStringRegex, nil}, - }, - "pa-intp-string": { - {`\\[\(]`, LiteralStringOther, nil}, - {`\(`, LiteralStringOther, Push()}, - {`\)`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#()]`, LiteralStringOther, nil}, - {`[^\\#()]+`, LiteralStringOther, nil}, - }, - "pa-string": { - {`\\[\\()]`, LiteralStringOther, nil}, - {`\(`, LiteralStringOther, Push()}, - {`\)`, LiteralStringOther, Pop(1)}, - {`[\\#()]`, LiteralStringOther, nil}, - {`[^\\#()]+`, LiteralStringOther, nil}, - }, - "pa-regex": { - {`\\[\\()]`, LiteralStringRegex, nil}, - {`\(`, LiteralStringRegex, Push()}, - {`\)[imsx]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#()]`, LiteralStringRegex, nil}, - {`[^\\#()]+`, LiteralStringRegex, nil}, - }, - "ab-intp-string": { - {`\\[<]`, LiteralStringOther, nil}, - {`<`, LiteralStringOther, Push()}, - {`>`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#<>]`, LiteralStringOther, nil}, - {`[^\\#<>]+`, LiteralStringOther, nil}, - }, - "ab-string": { - {`\\[\\<>]`, LiteralStringOther, nil}, - {`<`, LiteralStringOther, Push()}, - {`>`, LiteralStringOther, Pop(1)}, - {`[\\#<>]`, LiteralStringOther, nil}, - {`[^\\#<>]+`, LiteralStringOther, nil}, - }, - "ab-regex": { - {`\\[\\<>]`, LiteralStringRegex, nil}, - {`<`, LiteralStringRegex, Push()}, - {`>[imsx]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#<>]`, LiteralStringRegex, nil}, - {`[^\\#<>]+`, LiteralStringRegex, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go b/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go deleted file mode 100644 index c6a5f468..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go +++ /dev/null @@ -1,51 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// CSharp lexer. -var CSharp = internal.Register(MustNewLexer( - &Config{ - Name: "C#", - Aliases: []string{"csharp", "c#"}, - Filenames: []string{"*.cs"}, - MimeTypes: []string{"text/x-csharp"}, - DotAll: true, - EnsureNL: true, - }, - Rules{ - "root": { - {`^\s*\[.*?\]`, NameAttribute, nil}, - {`[^\S\n]+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/[*].*?[*]/`, CommentMultiline, nil}, - {`\n`, Text, nil}, - {`[~!%^&*()+=|\[\]:;,.<>/?-]`, Punctuation, nil}, - {`[{}]`, Punctuation, nil}, - {`@"(""|[^"])*"`, LiteralString, nil}, - {`\$@?"(""|[^"])*"`, LiteralString, nil}, - {`"(\\\\|\\"|[^"\n])*["\n]`, LiteralString, nil}, - {`'\\.'|'[^\\]'`, LiteralStringChar, nil}, - {`[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - {`#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma)\b.*?\n`, CommentPreproc, nil}, - {`\b(extern)(\s+)(alias)\b`, ByGroups(Keyword, Text, Keyword), nil}, - {`(abstract|as|async|await|base|break|by|case|catch|checked|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|let|lock|new|null|on|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|true|try|typeof|unchecked|unsafe|virtual|void|while|get|set|new|partial|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b`, Keyword, nil}, - {`(global)(::)`, ByGroups(Keyword, Punctuation), nil}, - {`(bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\b\??`, KeywordType, nil}, - {`(class|struct)(\s+)`, ByGroups(Keyword, Text), Push("class")}, - {`(namespace|using)(\s+)`, ByGroups(Keyword, Text), Push("namespace")}, - {`@?[_a-zA-Z]\w*`, Name, nil}, - }, - "class": { - {`@?[_a-zA-Z]\w*`, NameClass, Pop(1)}, - Default(Pop(1)), - }, - "namespace": { - {`(?=\()`, Text, Pop(1)}, - {`(@?[_a-zA-Z]\w*|\.)+`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/css.go b/vendor/github.com/alecthomas/chroma/lexers/c/css.go deleted file mode 100644 index fedc809b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/css.go +++ /dev/null @@ -1,104 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// CSS lexer. -var CSS = internal.Register(MustNewLexer( - &Config{ - Name: "CSS", - Aliases: []string{"css"}, - Filenames: []string{"*.css"}, - MimeTypes: []string{"text/css"}, - }, - Rules{ - "root": { - Include("basics"), - }, - "basics": { - {`\s+`, Text, nil}, - {`/\*(?:.|\n)*?\*/`, Comment, nil}, - {`\{`, Punctuation, Push("content")}, - {`(\:{1,2})([\w-]+)`, ByGroups(Punctuation, NameDecorator), nil}, - {`(\.)([\w-]+)`, ByGroups(Punctuation, NameClass), nil}, - {`(\#)([\w-]+)`, ByGroups(Punctuation, NameNamespace), nil}, - {`(@)([\w-]+)`, ByGroups(Punctuation, Keyword), Push("atrule")}, - {`[\w-]+`, NameTag, nil}, - {`[~^*!%&$\[\]()<>|+=@:;,./?-]`, Operator, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - }, - "atrule": { - {`\{`, Punctuation, Push("atcontent")}, - {`;`, Punctuation, Pop(1)}, - Include("basics"), - }, - "atcontent": { - Include("basics"), - {`\}`, Punctuation, Pop(2)}, - }, - "content": { - {`\s+`, Text, nil}, - {`\}`, Punctuation, Pop(1)}, - {`;`, Punctuation, nil}, - {`^@.*?$`, CommentPreproc, nil}, - {Words(``, ``, `-ms-`, `mso-`, `-moz-`, `-o-`, `-xv-`, `-atsc-`, `-wap-`, `-khtml-`, `-webkit-`, `prince-`, `-ah-`, `-hp-`, `-ro-`, `-rim-`, `-tc-`), KeywordPseudo, nil}, - {`(align-content|align-items|align-self|alignment-baseline|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|appearance|azimuth|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|baseline-shift|bookmark-label|bookmark-level|bookmark-state|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-boundary|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-decoration-break|box-shadow|box-sizing|box-snap|box-suppress|break-after|break-before|break-inside|caption-side|caret|caret-animation|caret-color|caret-shape|chains|clear|clip|clip-path|clip-rule|color|color-interpolation-filters|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|counter-set|crop|cue|cue-after|cue-before|cursor|direction|display|dominant-baseline|elevation|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|float-defer|float-offset|float-reference|flood-color|flood-opacity|flow|flow-from|flow-into|font|font-family|font-feature-settings|font-kerning|font-language-override|font-size|font-size-adjust|font-stretch|font-style|font-synthesis|font-variant|font-variant-alternates|font-variant-caps|font-variant-east-asian|font-variant-ligatures|font-variant-numeric|font-variant-position|font-weight|footnote-display|footnote-policy|glyph-orientation-vertical|grid|grid-area|grid-auto-columns|grid-auto-flow|grid-auto-rows|grid-column|grid-column-end|grid-column-gap|grid-column-start|grid-gap|grid-row|grid-row-end|grid-row-gap|grid-row-start|grid-template|grid-template-areas|grid-template-columns|grid-template-rows|hanging-punctuation|height|hyphenate-character|hyphenate-limit-chars|hyphenate-limit-last|hyphenate-limit-lines|hyphenate-limit-zone|hyphens|image-orientation|image-resolution|initial-letter|initial-letter-align|initial-letter-wrap|isolation|justify-content|justify-items|justify-self|left|letter-spacing|lighting-color|line-break|line-grid|line-height|line-snap|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|marker-side|marquee-direction|marquee-loop|marquee-speed|marquee-style|mask|mask-border|mask-border-mode|mask-border-outset|mask-border-repeat|mask-border-slice|mask-border-source|mask-border-width|mask-clip|mask-composite|mask-image|mask-mode|mask-origin|mask-position|mask-repeat|mask-size|mask-type|max-height|max-lines|max-width|min-height|min-width|mix-blend-mode|motion|motion-offset|motion-path|motion-rotation|move-to|nav-down|nav-left|nav-right|nav-up|object-fit|object-position|offset-after|offset-before|offset-end|offset-start|opacity|order|orphans|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-style|overflow-wrap|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page|page-break-after|page-break-before|page-break-inside|page-policy|pause|pause-after|pause-before|perspective|perspective-origin|pitch|pitch-range|play-during|polar-angle|polar-distance|position|presentation-level|quotes|region-fragment|resize|rest|rest-after|rest-before|richness|right|rotation|rotation-point|ruby-align|ruby-merge|ruby-position|running|scroll-snap-coordinate|scroll-snap-destination|scroll-snap-points-x|scroll-snap-points-y|scroll-snap-type|shape-image-threshold|shape-inside|shape-margin|shape-outside|size|speak|speak-as|speak-header|speak-numeral|speak-punctuation|speech-rate|stress|string-set|tab-size|table-layout|text-align|text-align-last|text-combine-upright|text-decoration|text-decoration-color|text-decoration-line|text-decoration-skip|text-decoration-style|text-emphasis|text-emphasis-color|text-emphasis-position|text-emphasis-style|text-indent|text-justify|text-orientation|text-overflow|text-shadow|text-space-collapse|text-space-trim|text-spacing|text-transform|text-underline-position|text-wrap|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch|voice-range|voice-rate|voice-stress|voice-volume|volume|white-space|widows|width|will-change|word-break|word-spacing|word-wrap|wrap-after|wrap-before|wrap-flow|wrap-inside|wrap-through|writing-mode|z-index)(\s*)(\:)`, ByGroups(Keyword, Text, Punctuation), Push("value-start")}, - {`(--[a-zA-Z_][\w-]*)(\s*)(\:)`, ByGroups(NameVariable, Text, Punctuation), Push("value-start")}, - {`([a-zA-Z_][\w-]*)(\s*)(\:)`, ByGroups(Name, Text, Punctuation), Push("value-start")}, - {`/\*(?:.|\n)*?\*/`, Comment, nil}, - }, - "value-start": { - Include("common-values"), - {Words(``, `\b`, `align-content`, `align-items`, `align-self`, `alignment-baseline`, `all`, `animation`, `animation-delay`, `animation-direction`, `animation-duration`, `animation-fill-mode`, `animation-iteration-count`, `animation-name`, `animation-play-state`, `animation-timing-function`, `appearance`, `azimuth`, `backface-visibility`, `background`, `background-attachment`, `background-blend-mode`, `background-clip`, `background-color`, `background-image`, `background-origin`, `background-position`, `background-repeat`, `background-size`, `baseline-shift`, `bookmark-label`, `bookmark-level`, `bookmark-state`, `border`, `border-bottom`, `border-bottom-color`, `border-bottom-left-radius`, `border-bottom-right-radius`, `border-bottom-style`, `border-bottom-width`, `border-boundary`, `border-collapse`, `border-color`, `border-image`, `border-image-outset`, `border-image-repeat`, `border-image-slice`, `border-image-source`, `border-image-width`, `border-left`, `border-left-color`, `border-left-style`, `border-left-width`, `border-radius`, `border-right`, `border-right-color`, `border-right-style`, `border-right-width`, `border-spacing`, `border-style`, `border-top`, `border-top-color`, `border-top-left-radius`, `border-top-right-radius`, `border-top-style`, `border-top-width`, `border-width`, `bottom`, `box-decoration-break`, `box-shadow`, `box-sizing`, `box-snap`, `box-suppress`, `break-after`, `break-before`, `break-inside`, `caption-side`, `caret`, `caret-animation`, `caret-color`, `caret-shape`, `chains`, `clear`, `clip`, `clip-path`, `clip-rule`, `color`, `color-interpolation-filters`, `column-count`, `column-fill`, `column-gap`, `column-rule`, `column-rule-color`, `column-rule-style`, `column-rule-width`, `column-span`, `column-width`, `columns`, `content`, `counter-increment`, `counter-reset`, `counter-set`, `crop`, `cue`, `cue-after`, `cue-before`, `cursor`, `direction`, `display`, `dominant-baseline`, `elevation`, `empty-cells`, `filter`, `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `float`, `float-defer`, `float-offset`, `float-reference`, `flood-color`, `flood-opacity`, `flow`, `flow-from`, `flow-into`, `font`, `font-family`, `font-feature-settings`, `font-kerning`, `font-language-override`, `font-size`, `font-size-adjust`, `font-stretch`, `font-style`, `font-synthesis`, `font-variant`, `font-variant-alternates`, `font-variant-caps`, `font-variant-east-asian`, `font-variant-ligatures`, `font-variant-numeric`, `font-variant-position`, `font-weight`, `footnote-display`, `footnote-policy`, `glyph-orientation-vertical`, `grid`, `grid-area`, `grid-auto-columns`, `grid-auto-flow`, `grid-auto-rows`, `grid-column`, `grid-column-end`, `grid-column-gap`, `grid-column-start`, `grid-gap`, `grid-row`, `grid-row-end`, `grid-row-gap`, `grid-row-start`, `grid-template`, `grid-template-areas`, `grid-template-columns`, `grid-template-rows`, `hanging-punctuation`, `height`, `hyphenate-character`, `hyphenate-limit-chars`, `hyphenate-limit-last`, `hyphenate-limit-lines`, `hyphenate-limit-zone`, `hyphens`, `image-orientation`, `image-resolution`, `initial-letter`, `initial-letter-align`, `initial-letter-wrap`, `isolation`, `justify-content`, `justify-items`, `justify-self`, `left`, `letter-spacing`, `lighting-color`, `line-break`, `line-grid`, `line-height`, `line-snap`, `list-style`, `list-style-image`, `list-style-position`, `list-style-type`, `margin`, `margin-bottom`, `margin-left`, `margin-right`, `margin-top`, `marker-side`, `marquee-direction`, `marquee-loop`, `marquee-speed`, `marquee-style`, `mask`, `mask-border`, `mask-border-mode`, `mask-border-outset`, `mask-border-repeat`, `mask-border-slice`, `mask-border-source`, `mask-border-width`, `mask-clip`, `mask-composite`, `mask-image`, `mask-mode`, `mask-origin`, `mask-position`, `mask-repeat`, `mask-size`, `mask-type`, `max-height`, `max-lines`, `max-width`, `min-height`, `min-width`, `mix-blend-mode`, `motion`, `motion-offset`, `motion-path`, `motion-rotation`, `move-to`, `nav-down`, `nav-left`, `nav-right`, `nav-up`, `object-fit`, `object-position`, `offset-after`, `offset-before`, `offset-end`, `offset-start`, `opacity`, `order`, `orphans`, `outline`, `outline-color`, `outline-offset`, `outline-style`, `outline-width`, `overflow`, `overflow-style`, `overflow-wrap`, `overflow-x`, `overflow-y`, `padding`, `padding-bottom`, `padding-left`, `padding-right`, `padding-top`, `page`, `page-break-after`, `page-break-before`, `page-break-inside`, `page-policy`, `pause`, `pause-after`, `pause-before`, `perspective`, `perspective-origin`, `pitch`, `pitch-range`, `play-during`, `polar-angle`, `polar-distance`, `position`, `presentation-level`, `quotes`, `region-fragment`, `resize`, `rest`, `rest-after`, `rest-before`, `richness`, `right`, `rotation`, `rotation-point`, `ruby-align`, `ruby-merge`, `ruby-position`, `running`, `scroll-snap-coordinate`, `scroll-snap-destination`, `scroll-snap-points-x`, `scroll-snap-points-y`, `scroll-snap-type`, `shape-image-threshold`, `shape-inside`, `shape-margin`, `shape-outside`, `size`, `speak`, `speak-as`, `speak-header`, `speak-numeral`, `speak-punctuation`, `speech-rate`, `stress`, `string-set`, `tab-size`, `table-layout`, `text-align`, `text-align-last`, `text-combine-upright`, `text-decoration`, `text-decoration-color`, `text-decoration-line`, `text-decoration-skip`, `text-decoration-style`, `text-emphasis`, `text-emphasis-color`, `text-emphasis-position`, `text-emphasis-style`, `text-indent`, `text-justify`, `text-orientation`, `text-overflow`, `text-shadow`, `text-space-collapse`, `text-space-trim`, `text-spacing`, `text-transform`, `text-underline-position`, `text-wrap`, `top`, `transform`, `transform-origin`, `transform-style`, `transition`, `transition-delay`, `transition-duration`, `transition-property`, `transition-timing-function`, `unicode-bidi`, `user-select`, `vertical-align`, `visibility`, `voice-balance`, `voice-duration`, `voice-family`, `voice-pitch`, `voice-range`, `voice-rate`, `voice-stress`, `voice-volume`, `volume`, `white-space`, `widows`, `width`, `will-change`, `word-break`, `word-spacing`, `word-wrap`, `wrap-after`, `wrap-before`, `wrap-flow`, `wrap-inside`, `wrap-through`, `writing-mode`, `z-index`), Keyword, nil}, - {`\!important`, CommentPreproc, nil}, - {`/\*(?:.|\n)*?\*/`, Comment, nil}, - Include("numeric-values"), - {`[~^*!%&<>|+=@:./?-]+`, Operator, nil}, - {`[\[\](),]+`, Punctuation, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[a-zA-Z_][\w-]*`, Name, nil}, - {`;`, Punctuation, Pop(1)}, - {`\}`, Punctuation, Pop(2)}, - }, - "function-start": { - Include("common-values"), - {`/\*(?:.|\n)*?\*/`, Comment, nil}, - Include("numeric-values"), - {`[*+/-]`, Operator, nil}, - {`[,]`, Punctuation, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[a-zA-Z_-]\w*`, Name, nil}, - {`\)`, Punctuation, Pop(1)}, - }, - "common-values": { - {`\s+`, Text, nil}, - {Words(``, ``, `-ms-`, `mso-`, `-moz-`, `-o-`, `-xv-`, `-atsc-`, `-wap-`, `-khtml-`, `-webkit-`, `prince-`, `-ah-`, `-hp-`, `-ro-`, `-rim-`, `-tc-`), KeywordPseudo, nil}, - Include("urls"), - {`(attr|blackness|blend|blenda|blur|brightness|calc|circle|color-mod|contrast|counter|cubic-bezier|device-cmyk|drop-shadow|ellipse|gray|grayscale|hsl|hsla|hue|hue-rotate|hwb|image|inset|invert|lightness|linear-gradient|matrix|matrix3d|opacity|perspective|polygon|radial-gradient|rect|repeating-linear-gradient|repeating-radial-gradient|rgb|rgba|rotate|rotate3d|rotateX|rotateY|rotateZ|saturate|saturation|scale|scale3d|scaleX|scaleY|scaleZ|sepia|shade|skewX|skewY|steps|tint|toggle|translate|translate3d|translateX|translateY|translateZ|whiteness)(\()`, ByGroups(NameBuiltin, Punctuation), Push("function-start")}, - {`([a-zA-Z_][\w-]+)(\()`, ByGroups(NameFunction, Punctuation), Push("function-start")}, - {Words(``, `\b`, `absolute`, `alias`, `all`, `all-petite-caps`, `all-scroll`, `all-small-caps`, `allow-end`, `alpha`, `alternate`, `alternate-reverse`, `always`, `armenian`, `auto`, `avoid`, `avoid-column`, `avoid-page`, `backwards`, `balance`, `baseline`, `below`, `blink`, `block`, `bold`, `bolder`, `border-box`, `both`, `bottom`, `box-decoration`, `break-word`, `capitalize`, `cell`, `center`, `circle`, `clip`, `clone`, `close-quote`, `col-resize`, `collapse`, `color`, `color-burn`, `color-dodge`, `column`, `column-reverse`, `compact`, `condensed`, `contain`, `container`, `content-box`, `context-menu`, `copy`, `cover`, `crisp-edges`, `crosshair`, `currentColor`, `cursive`, `darken`, `dashed`, `decimal`, `decimal-leading-zero`, `default`, `descendants`, `difference`, `digits`, `disc`, `distribute`, `dot`, `dotted`, `double`, `double-circle`, `e-resize`, `each-line`, `ease`, `ease-in`, `ease-in-out`, `ease-out`, `edges`, `ellipsis`, `end`, `ew-resize`, `exclusion`, `expanded`, `extra-condensed`, `extra-expanded`, `fantasy`, `fill`, `fill-box`, `filled`, `first`, `fixed`, `flat`, `flex`, `flex-end`, `flex-start`, `flip`, `force-end`, `forwards`, `from-image`, `full-width`, `geometricPrecision`, `georgian`, `groove`, `hanging`, `hard-light`, `help`, `hidden`, `hide`, `horizontal`, `hue`, `icon`, `infinite`, `inherit`, `initial`, `ink`, `inline`, `inline-block`, `inline-flex`, `inline-table`, `inset`, `inside`, `inter-word`, `invert`, `isolate`, `italic`, `justify`, `large`, `larger`, `last`, `left`, `lighten`, `lighter`, `line-through`, `linear`, `list-item`, `local`, `loose`, `lower-alpha`, `lower-greek`, `lower-latin`, `lower-roman`, `lowercase`, `ltr`, `luminance`, `luminosity`, `mandatory`, `manipulation`, `manual`, `margin-box`, `match-parent`, `medium`, `mixed`, `monospace`, `move`, `multiply`, `n-resize`, `ne-resize`, `nesw-resize`, `no-close-quote`, `no-drop`, `no-open-quote`, `no-repeat`, `none`, `normal`, `not-allowed`, `nowrap`, `ns-resize`, `nw-resize`, `nwse-resize`, `objects`, `oblique`, `off`, `on`, `open`, `open-quote`, `optimizeLegibility`, `optimizeSpeed`, `outset`, `outside`, `over`, `overlay`, `overline`, `padding-box`, `page`, `pan-down`, `pan-left`, `pan-right`, `pan-up`, `pan-x`, `pan-y`, `paused`, `petite-caps`, `pixelated`, `pointer`, `preserve-3d`, `progress`, `proximity`, `relative`, `repeat`, `repeat no-repeat`, `repeat-x`, `repeat-y`, `reverse`, `ridge`, `right`, `round`, `row`, `row-resize`, `row-reverse`, `rtl`, `ruby`, `ruby-base`, `ruby-base-container`, `ruby-text`, `ruby-text-container`, `run-in`, `running`, `s-resize`, `sans-serif`, `saturation`, `scale-down`, `screen`, `scroll`, `se-resize`, `semi-condensed`, `semi-expanded`, `separate`, `serif`, `sesame`, `show`, `sideways`, `sideways-left`, `sideways-right`, `slice`, `small`, `small-caps`, `smaller`, `smooth`, `snap`, `soft-light`, `solid`, `space`, `space-around`, `space-between`, `spaces`, `square`, `start`, `static`, `step-end`, `step-start`, `sticky`, `stretch`, `strict`, `stroke-box`, `style`, `sw-resize`, `table`, `table-caption`, `table-cell`, `table-column`, `table-column-group`, `table-footer-group`, `table-header-group`, `table-row`, `table-row-group`, `text`, `thick`, `thin`, `titling-caps`, `to`, `top`, `triangle`, `ultra-condensed`, `ultra-expanded`, `under`, `underline`, `unicase`, `unset`, `upper-alpha`, `upper-latin`, `upper-roman`, `uppercase`, `upright`, `use-glyph-orientation`, `vertical`, `vertical-text`, `view-box`, `visible`, `w-resize`, `wait`, `wavy`, `weight`, `weight style`, `wrap`, `wrap-reverse`, `x-large`, `x-small`, `xx-large`, `xx-small`, `zoom-in`, `zoom-out`), KeywordConstant, nil}, - {Words(``, `\b`, `above`, `aural`, `behind`, `bidi-override`, `center-left`, `center-right`, `cjk-ideographic`, `continuous`, `crop`, `cross`, `embed`, `far-left`, `far-right`, `fast`, `faster`, `hebrew`, `high`, `higher`, `hiragana`, `hiragana-iroha`, `katakana`, `katakana-iroha`, `landscape`, `left-side`, `leftwards`, `level`, `loud`, `low`, `lower`, `message-box`, `middle`, `mix`, `narrower`, `once`, `portrait`, `right-side`, `rightwards`, `silent`, `slow`, `slower`, `small-caption`, `soft`, `spell-out`, `status-bar`, `super`, `text-bottom`, `text-top`, `wider`, `x-fast`, `x-high`, `x-loud`, `x-low`, `x-soft`, `yes`, `pre`, `pre-wrap`, `pre-line`), KeywordConstant, nil}, - {Words(``, `\b`, `aliceblue`, `antiquewhite`, `aqua`, `aquamarine`, `azure`, `beige`, `bisque`, `black`, `blanchedalmond`, `blue`, `blueviolet`, `brown`, `burlywood`, `cadetblue`, `chartreuse`, `chocolate`, `coral`, `cornflowerblue`, `cornsilk`, `crimson`, `cyan`, `darkblue`, `darkcyan`, `darkgoldenrod`, `darkgray`, `darkgreen`, `darkgrey`, `darkkhaki`, `darkmagenta`, `darkolivegreen`, `darkorange`, `darkorchid`, `darkred`, `darksalmon`, `darkseagreen`, `darkslateblue`, `darkslategray`, `darkslategrey`, `darkturquoise`, `darkviolet`, `deeppink`, `deepskyblue`, `dimgray`, `dimgrey`, `dodgerblue`, `firebrick`, `floralwhite`, `forestgreen`, `fuchsia`, `gainsboro`, `ghostwhite`, `gold`, `goldenrod`, `gray`, `green`, `greenyellow`, `grey`, `honeydew`, `hotpink`, `indianred`, `indigo`, `ivory`, `khaki`, `lavender`, `lavenderblush`, `lawngreen`, `lemonchiffon`, `lightblue`, `lightcoral`, `lightcyan`, `lightgoldenrodyellow`, `lightgray`, `lightgreen`, `lightgrey`, `lightpink`, `lightsalmon`, `lightseagreen`, `lightskyblue`, `lightslategray`, `lightslategrey`, `lightsteelblue`, `lightyellow`, `lime`, `limegreen`, `linen`, `magenta`, `maroon`, `mediumaquamarine`, `mediumblue`, `mediumorchid`, `mediumpurple`, `mediumseagreen`, `mediumslateblue`, `mediumspringgreen`, `mediumturquoise`, `mediumvioletred`, `midnightblue`, `mintcream`, `mistyrose`, `moccasin`, `navajowhite`, `navy`, `oldlace`, `olive`, `olivedrab`, `orange`, `orangered`, `orchid`, `palegoldenrod`, `palegreen`, `paleturquoise`, `palevioletred`, `papayawhip`, `peachpuff`, `peru`, `pink`, `plum`, `powderblue`, `purple`, `rebeccapurple`, `red`, `rosybrown`, `royalblue`, `saddlebrown`, `salmon`, `sandybrown`, `seagreen`, `seashell`, `sienna`, `silver`, `skyblue`, `slateblue`, `slategray`, `slategrey`, `snow`, `springgreen`, `steelblue`, `tan`, `teal`, `thistle`, `tomato`, `turquoise`, `violet`, `wheat`, `white`, `whitesmoke`, `yellow`, `yellowgreen`, `transparent`), KeywordConstant, nil}, - }, - "urls": { - {`(url)(\()(".*?")(\))`, ByGroups(NameBuiltin, Punctuation, LiteralStringDouble, Punctuation), nil}, - {`(url)(\()('.*?')(\))`, ByGroups(NameBuiltin, Punctuation, LiteralStringSingle, Punctuation), nil}, - {`(url)(\()(.*?)(\))`, ByGroups(NameBuiltin, Punctuation, LiteralStringOther, Punctuation), nil}, - }, - "numeric-values": { - {`\#[a-zA-Z0-9]{1,6}`, LiteralNumberHex, nil}, - {`[+\-]?[0-9]*[.][0-9]+`, LiteralNumberFloat, Push("numeric-end")}, - {`[+\-]?[0-9]+`, LiteralNumberInteger, Push("numeric-end")}, - }, - "numeric-end": { - {Words(``, `\b`, `deg`, `grad`, `rad`, `turn`, `Hz`, `kHz`, `em`, `ex`, `ch`, `rem`, `vh`, `vw`, `vmin`, `vmax`, `px`, `mm`, `cm`, `in`, `pt`, `pc`, `q`, `dpi`, `dpcm`, `dppx`, `s`, `ms`), KeywordType, nil}, - {`%`, KeywordType, nil}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/cython.go b/vendor/github.com/alecthomas/chroma/lexers/c/cython.go deleted file mode 100644 index 701e2b79..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/c/cython.go +++ /dev/null @@ -1,135 +0,0 @@ -package c - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Cython lexer. -var Cython = internal.Register(MustNewLexer( - &Config{ - Name: "Cython", - Aliases: []string{"cython", "pyx", "pyrex"}, - Filenames: []string{"*.pyx", "*.pxd", "*.pxi"}, - MimeTypes: []string{"text/x-cython", "application/x-cython"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`^(\s*)("""(?:.|\n)*?""")`, ByGroups(Text, LiteralStringDoc), nil}, - {`^(\s*)('''(?:.|\n)*?''')`, ByGroups(Text, LiteralStringDoc), nil}, - {`[^\S\n]+`, Text, nil}, - {`#.*$`, Comment, nil}, - {`[]{}:(),;[]`, Punctuation, nil}, - {`\\\n`, Text, nil}, - {`\\`, Text, nil}, - {`(in|is|and|or|not)\b`, OperatorWord, nil}, - {`(<)([a-zA-Z0-9.?]+)(>)`, ByGroups(Punctuation, KeywordType, Punctuation), nil}, - {`!=|==|<<|>>|[-~+/*%=<>&^|.?]`, Operator, nil}, - {`(from)(\d+)(<=)(\s+)(<)(\d+)(:)`, ByGroups(Keyword, LiteralNumberInteger, Operator, Name, Operator, Name, Punctuation), nil}, - Include("keywords"), - {`(def|property)(\s+)`, ByGroups(Keyword, Text), Push("funcname")}, - {`(cp?def)(\s+)`, ByGroups(Keyword, Text), Push("cdef")}, - {`(cdef)(:)`, ByGroups(Keyword, Punctuation), nil}, - {`(class|struct)(\s+)`, ByGroups(Keyword, Text), Push("classname")}, - {`(from)(\s+)`, ByGroups(Keyword, Text), Push("fromimport")}, - {`(c?import)(\s+)`, ByGroups(Keyword, Text), Push("import")}, - Include("builtins"), - Include("backtick"), - {`(?:[rR]|[uU][rR]|[rR][uU])"""`, LiteralString, Push("tdqs")}, - {`(?:[rR]|[uU][rR]|[rR][uU])'''`, LiteralString, Push("tsqs")}, - {`(?:[rR]|[uU][rR]|[rR][uU])"`, LiteralString, Push("dqs")}, - {`(?:[rR]|[uU][rR]|[rR][uU])'`, LiteralString, Push("sqs")}, - {`[uU]?"""`, LiteralString, Combined("stringescape", "tdqs")}, - {`[uU]?'''`, LiteralString, Combined("stringescape", "tsqs")}, - {`[uU]?"`, LiteralString, Combined("stringescape", "dqs")}, - {`[uU]?'`, LiteralString, Combined("stringescape", "sqs")}, - Include("name"), - Include("numbers"), - }, - "keywords": { - {Words(``, `\b`, `assert`, `break`, `by`, `continue`, `ctypedef`, `del`, `elif`, `else`, `except`, `except?`, `exec`, `finally`, `for`, `fused`, `gil`, `global`, `if`, `include`, `lambda`, `nogil`, `pass`, `print`, `raise`, `return`, `try`, `while`, `yield`, `as`, `with`), Keyword, nil}, - {`(DEF|IF|ELIF|ELSE)\b`, CommentPreproc, nil}, - }, - "builtins": { - {Words(`(?`, CommentPreproc, Pop(1)}, - {`(<<<)([\'"]?)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)`, ByGroups(LiteralString, LiteralString, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, Punctuation, Text), nil}, - {`\s+`, Text, nil}, - {`#.*?\n`, CommentSingle, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*\*/`, CommentMultiline, nil}, - {`/\*\*.*?\*/`, LiteralStringDoc, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`(->|::)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Operator, Text, NameAttribute), nil}, - {`[~!%^&*+=|:.<>/@-]+`, Operator, nil}, - {`\?`, Operator, nil}, - {`[\[\]{}();,]+`, Punctuation, nil}, - {`(class)(\s+)`, ByGroups(Keyword, Text), Push("classname")}, - {`(function)(\s*)(?=\()`, ByGroups(Keyword, Text), nil}, - {`(function)(\s+)(&?)(\s*)`, ByGroups(Keyword, Text, Operator, Text), Push("functionname")}, - {`(const)(\s+)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Keyword, Text, NameConstant), nil}, - {`(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally)\b`, Keyword, nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - Include("magicconstants"), - {`\$\{\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*\}`, NameVariable, nil}, - {`\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameVariable, nil}, - {`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameOther, nil}, - {`(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+e[+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0x[a-f0-9]+`, LiteralNumberHex, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`0b[01]+`, LiteralNumberBin, nil}, - {`'([^'\\]*(?:\\.[^'\\]*)*)'`, LiteralStringSingle, nil}, - {"`([^`\\\\]*(?:\\\\.[^`\\\\]*)*)`", LiteralStringBacktick, nil}, - {`"`, LiteralStringDouble, Push("string")}, - }, - "magicfuncs": { - {Words(``, `\b`, `__construct`, `__destruct`, `__call`, `__callStatic`, `__get`, `__set`, `__isset`, `__unset`, `__sleep`, `__wakeup`, `__toString`, `__invoke`, `__set_state`, `__clone`, `__debugInfo`), NameFunctionMagic, nil}, - }, - "magicconstants": { - {Words(``, `\b`, `__LINE__`, `__FILE__`, `__DIR__`, `__FUNCTION__`, `__CLASS__`, `__TRAIT__`, `__METHOD__`, `__NAMESPACE__`), NameConstant, nil}, - }, - "classname": { - {`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameClass, Pop(1)}, - }, - "functionname": { - Include("magicfuncs"), - {`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameFunction, Pop(1)}, - Default(Pop(1)), - }, - "string": { - {`"`, LiteralStringDouble, Pop(1)}, - {`[^{$"\\]+`, LiteralStringDouble, nil}, - {`\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})`, LiteralStringEscape, nil}, - {`\$(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*(\[\S+?\]|->(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)?`, LiteralStringInterpol, nil}, - {`(\{\$\{)(.*?)(\}\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil}, - {`(\{)(\$.*?)(\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil}, - {`(\$\{)(\S+)(\})`, ByGroups(LiteralStringInterpol, NameVariable, LiteralStringInterpol), nil}, - {`[${\\]`, LiteralStringDouble, nil}, - }, - }, -).SetAnalyser(func(text string) float32 { - if strings.Contains(text, "]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil}, - - // https://dlang.org/spec/attribute.html#uda - {`@[\w.]*`, NameDecorator, nil}, - {`(abstract|auto|alias|align|const|delegate|enum|export|final|function|inout|lazy|nothrow|override|package|private|protected|public|pure|static|synchronized|template|volatile|__gshared)\b`, KeywordDeclaration, nil}, - - // https://dlang.org/spec/type.html#basic-data-types - {`(void|bool|byte|ubyte|short|ushort|int|uint|long|ulong|cent|ucent|float|double|real|ifloat|idouble|ireal|cfloat|cdouble|creal|char|wchar|dchar|string|wstring|dstring)\b`, KeywordType, nil}, - {`(module)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(class|interface|struct|template|union)(\s+)`, ByGroups(KeywordDeclaration, Text), Push("class")}, - {`(import)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - - // https://dlang.org/spec/lex.html#string_literals - // TODO support delimited strings - {`[qr]?"(\\\\|\\"|[^"])*"[cwd]?`, LiteralString, nil}, - {"(`)([^`]*)(`)[cwd]?", LiteralString, nil}, - {`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil}, - {`(\.)((?:[^\W\d]|\$)[\w$]*)`, ByGroups(Operator, NameAttribute), nil}, - {`^\s*([^\W\d]|\$)[\w$]*:`, NameLabel, nil}, - - // https://dlang.org/spec/lex.html#floatliteral - {`([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFL]?i?|[0-9][eE][+\-]?[0-9][0-9_]*[fFL]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFL]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFL]?`, LiteralNumberFloat, nil}, - // https://dlang.org/spec/lex.html#integerliteral - {`0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?`, LiteralNumberHex, nil}, - {`0[bB][01][01_]*[lL]?`, LiteralNumberBin, nil}, - {`0[0-7_]+[lL]?`, LiteralNumberOct, nil}, - {`0|[1-9][0-9_]*[lL]?`, LiteralNumberInteger, nil}, - {`([~^*!%&\[\](){}<>|+=:;,./?-]|q{)`, Operator, nil}, - {`([^\W\d]|\$)[\w$]*`, Name, nil}, - {`\n`, Text, nil}, - }, - "class": { - {`([^\W\d]|\$)[\w$]*`, NameClass, Pop(1)}, - }, - "import": { - {`[\w.]+\*?`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/d/dart.go b/vendor/github.com/alecthomas/chroma/lexers/d/dart.go deleted file mode 100644 index 6dab3b42..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/d/dart.go +++ /dev/null @@ -1,91 +0,0 @@ -package d - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Dart lexer. -var Dart = internal.Register(MustNewLexer( - &Config{ - Name: "Dart", - Aliases: []string{"dart"}, - Filenames: []string{"*.dart"}, - MimeTypes: []string{"text/x-dart"}, - DotAll: true, - }, - Rules{ - "root": { - Include("string_literal"), - {`#!(.*?)$`, CommentPreproc, nil}, - {`\b(import|export)\b`, Keyword, Push("import_decl")}, - {`\b(library|source|part of|part)\b`, Keyword, nil}, - {`[^\S\n]+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`\b(class)\b(\s+)`, ByGroups(KeywordDeclaration, Text), Push("class")}, - {`\b(assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b`, Keyword, nil}, - {`\b(abstract|async|await|const|extends|factory|final|get|implements|native|operator|set|static|sync|typedef|var|with|yield)\b`, KeywordDeclaration, nil}, - {`\b(bool|double|dynamic|int|num|Object|String|void)\b`, KeywordType, nil}, - {`\b(false|null|true)\b`, KeywordConstant, nil}, - {`[~!%^&*+=|?:<>/-]|as\b`, Operator, nil}, - {`[a-zA-Z_$]\w*:`, NameLabel, nil}, - {`[a-zA-Z_$]\w*`, Name, nil}, - {`[(){}\[\],.;]`, Punctuation, nil}, - {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`\d+(\.\d*)?([eE][+-]?\d+)?`, LiteralNumber, nil}, - {`\.\d+([eE][+-]?\d+)?`, LiteralNumber, nil}, - {`\n`, Text, nil}, - }, - "class": { - {`[a-zA-Z_$]\w*`, NameClass, Pop(1)}, - }, - "import_decl": { - Include("string_literal"), - {`\s+`, Text, nil}, - {`\b(as|show|hide)\b`, Keyword, nil}, - {`[a-zA-Z_$]\w*`, Name, nil}, - {`\,`, Punctuation, nil}, - {`\;`, Punctuation, Pop(1)}, - }, - "string_literal": { - {`r"""([\w\W]*?)"""`, LiteralStringDouble, nil}, - {`r'''([\w\W]*?)'''`, LiteralStringSingle, nil}, - {`r"(.*?)"`, LiteralStringDouble, nil}, - {`r'(.*?)'`, LiteralStringSingle, nil}, - {`"""`, LiteralStringDouble, Push("string_double_multiline")}, - {`'''`, LiteralStringSingle, Push("string_single_multiline")}, - {`"`, LiteralStringDouble, Push("string_double")}, - {`'`, LiteralStringSingle, Push("string_single")}, - }, - "string_common": { - {`\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]*\}|[a-z'\"$\\])`, LiteralStringEscape, nil}, - {`(\$)([a-zA-Z_]\w*)`, ByGroups(LiteralStringInterpol, Name), nil}, - {`(\$\{)(.*?)(\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil}, - }, - "string_double": { - {`"`, LiteralStringDouble, Pop(1)}, - {`[^"$\\\n]+`, LiteralStringDouble, nil}, - Include("string_common"), - {`\$+`, LiteralStringDouble, nil}, - }, - "string_double_multiline": { - {`"""`, LiteralStringDouble, Pop(1)}, - {`[^"$\\]+`, LiteralStringDouble, nil}, - Include("string_common"), - {`(\$|\")+`, LiteralStringDouble, nil}, - }, - "string_single": { - {`'`, LiteralStringSingle, Pop(1)}, - {`[^'$\\\n]+`, LiteralStringSingle, nil}, - Include("string_common"), - {`\$+`, LiteralStringSingle, nil}, - }, - "string_single_multiline": { - {`'''`, LiteralStringSingle, Pop(1)}, - {`[^\'$\\]+`, LiteralStringSingle, nil}, - Include("string_common"), - {`(\$|\')+`, LiteralStringSingle, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/d/diff.go b/vendor/github.com/alecthomas/chroma/lexers/d/diff.go deleted file mode 100644 index 264ed45c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/d/diff.go +++ /dev/null @@ -1,29 +0,0 @@ -package d - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Diff lexer. -var Diff = internal.Register(MustNewLexer( - &Config{ - Name: "Diff", - Aliases: []string{"diff", "udiff"}, - EnsureNL: true, - Filenames: []string{"*.diff", "*.patch"}, - MimeTypes: []string{"text/x-diff", "text/x-patch"}, - }, - Rules{ - "root": { - {` .*\n`, Text, nil}, - {`\+.*\n`, GenericInserted, nil}, - {`-.*\n`, GenericDeleted, nil}, - {`!.*\n`, GenericStrong, nil}, - {`@.*\n`, GenericSubheading, nil}, - {`([Ii]ndex|diff).*\n`, GenericHeading, nil}, - {`=.*\n`, GenericHeading, nil}, - {`.*\n`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/d/django.go b/vendor/github.com/alecthomas/chroma/lexers/d/django.go deleted file mode 100644 index d72d99a3..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/d/django.go +++ /dev/null @@ -1,53 +0,0 @@ -package d - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Django/Jinja lexer. -var DjangoJinja = internal.Register(MustNewLexer( - &Config{ - Name: "Django/Jinja", - Aliases: []string{"django", "jinja"}, - Filenames: []string{}, - MimeTypes: []string{"application/x-django-templating", "application/x-jinja"}, - DotAll: true, - }, - Rules{ - "root": { - {`[^{]+`, Other, nil}, - {`\{\{`, CommentPreproc, Push("var")}, - {`\{[*#].*?[*#]\}`, Comment, nil}, - {`(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endcomment)(\s*-?)(%\})`, ByGroups(CommentPreproc, Text, Keyword, Text, CommentPreproc, Comment, CommentPreproc, Text, Keyword, Text, CommentPreproc), nil}, - {`(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})`, ByGroups(CommentPreproc, Text, Keyword, Text, CommentPreproc, Text, CommentPreproc, Text, Keyword, Text, CommentPreproc), nil}, - {`(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)`, ByGroups(CommentPreproc, Text, Keyword, Text, NameFunction), Push("block")}, - {`(\{%)(-?\s*)([a-zA-Z_]\w*)`, ByGroups(CommentPreproc, Text, Keyword), Push("block")}, - {`\{`, Other, nil}, - }, - "varnames": { - {`(\|)(\s*)([a-zA-Z_]\w*)`, ByGroups(Operator, Text, NameFunction), nil}, - {`(is)(\s+)(not)?(\s+)?([a-zA-Z_]\w*)`, ByGroups(Keyword, Text, Keyword, Text, NameFunction), nil}, - {`(_|true|false|none|True|False|None)\b`, KeywordPseudo, nil}, - {`(in|as|reversed|recursive|not|and|or|is|if|else|import|with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\b`, Keyword, nil}, - {`(loop|block|super|forloop)\b`, NameBuiltin, nil}, - {`[a-zA-Z_][\w-]*`, NameVariable, nil}, - {`\.\w+`, NameVariable, nil}, - {`:?"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`:?'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`([{}()\[\]+\-*/,:~]|[><=]=?)`, Operator, nil}, - {`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - }, - "var": { - {`\s+`, Text, nil}, - {`(-?)(\}\})`, ByGroups(Text, CommentPreproc), Pop(1)}, - Include("varnames"), - }, - "block": { - {`\s+`, Text, nil}, - {`(-?)(%\})`, ByGroups(Text, CommentPreproc), Pop(1)}, - Include("varnames"), - {`.`, Punctuation, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/d/docker.go b/vendor/github.com/alecthomas/chroma/lexers/d/docker.go deleted file mode 100644 index a650eba5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/d/docker.go +++ /dev/null @@ -1,31 +0,0 @@ -package d - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/b" - "github.com/alecthomas/chroma/lexers/internal" - "github.com/alecthomas/chroma/lexers/j" -) - -// Docker lexer. -var Docker = internal.Register(MustNewLexer( - &Config{ - Name: "Docker", - Aliases: []string{"docker", "dockerfile"}, - Filenames: []string{"Dockerfile", "*.docker"}, - MimeTypes: []string{"text/x-dockerfile-config"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`#.*`, Comment, nil}, - {`(ONBUILD)((?:\s*\\?\s*))`, ByGroups(Keyword, Using(b.Bash)), nil}, - {`(HEALTHCHECK)(((?:\s*\\?\s*)--\w+=\w+(?:\s*\\?\s*))*)`, ByGroups(Keyword, Using(b.Bash)), nil}, - {`(VOLUME|ENTRYPOINT|CMD|SHELL)((?:\s*\\?\s*))(\[.*?\])`, ByGroups(Keyword, Using(b.Bash), Using(j.JSON)), nil}, - {`(LABEL|ENV|ARG)((?:(?:\s*\\?\s*)\w+=\w+(?:\s*\\?\s*))*)`, ByGroups(Keyword, Using(b.Bash)), nil}, - {`((?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)|VOLUME)\b(.*)`, ByGroups(Keyword, LiteralString), nil}, - {`((?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY))`, Keyword, nil}, - {`(.*\\\n)*.+`, Using(b.Bash), nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/d/dtd.go b/vendor/github.com/alecthomas/chroma/lexers/d/dtd.go deleted file mode 100644 index 99bf5d37..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/d/dtd.go +++ /dev/null @@ -1,69 +0,0 @@ -package d - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Dtd lexer. -var Dtd = internal.Register(MustNewLexer( - &Config{ - Name: "DTD", - Aliases: []string{"dtd"}, - Filenames: []string{"*.dtd"}, - MimeTypes: []string{"application/xml-dtd"}, - DotAll: true, - }, - Rules{ - "root": { - Include("common"), - {`(\s]+)`, ByGroups(Keyword, Text, NameTag), nil}, - {`PUBLIC|SYSTEM`, KeywordConstant, nil}, - {`[\[\]>]`, Keyword, nil}, - }, - "common": { - {`\s+`, Text, nil}, - {`(%|&)[^;]*;`, NameEntity, nil}, - {``, Comment, Pop(1)}, - {`-`, Comment, nil}, - }, - "element": { - Include("common"), - {`EMPTY|ANY|#PCDATA`, KeywordConstant, nil}, - {`[^>\s|()?+*,]+`, NameTag, nil}, - {`>`, Keyword, Pop(1)}, - }, - "attlist": { - Include("common"), - {`CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATION`, KeywordConstant, nil}, - {`#REQUIRED|#IMPLIED|#FIXED`, KeywordConstant, nil}, - {`xml:space|xml:lang`, KeywordReserved, nil}, - {`[^>\s|()?+*,]+`, NameAttribute, nil}, - {`>`, Keyword, Pop(1)}, - }, - "entity": { - Include("common"), - {`SYSTEM|PUBLIC|NDATA`, KeywordConstant, nil}, - {`[^>\s|()?+*,]+`, NameEntity, nil}, - {`>`, Keyword, Pop(1)}, - }, - "notation": { - Include("common"), - {`SYSTEM|PUBLIC`, KeywordConstant, nil}, - {`[^>\s|()?+*,]+`, NameAttribute, nil}, - {`>`, Keyword, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/e/ebnf.go b/vendor/github.com/alecthomas/chroma/lexers/e/ebnf.go deleted file mode 100644 index 42a3a379..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/e/ebnf.go +++ /dev/null @@ -1,51 +0,0 @@ -package e - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ebnf lexer. -var Ebnf = internal.Register(MustNewLexer( - &Config{ - Name: "EBNF", - Aliases: []string{"ebnf"}, - Filenames: []string{"*.ebnf"}, - MimeTypes: []string{"text/x-ebnf"}, - }, - Rules{ - "root": { - Include("whitespace"), - Include("comment_start"), - Include("identifier"), - {`=`, Operator, Push("production")}, - }, - "production": { - Include("whitespace"), - Include("comment_start"), - Include("identifier"), - {`"[^"]*"`, LiteralStringDouble, nil}, - {`'[^']*'`, LiteralStringSingle, nil}, - {`(\?[^?]*\?)`, NameEntity, nil}, - {`[\[\]{}(),|]`, Punctuation, nil}, - {`-`, Operator, nil}, - {`;`, Punctuation, Pop(1)}, - {`\.`, Punctuation, Pop(1)}, - }, - "whitespace": { - {`\s+`, Text, nil}, - }, - "comment_start": { - {`\(\*`, CommentMultiline, Push("comment")}, - }, - "comment": { - {`[^*)]`, CommentMultiline, nil}, - Include("comment_start"), - {`\*\)`, CommentMultiline, Pop(1)}, - {`[*)]`, CommentMultiline, nil}, - }, - "identifier": { - {`([a-zA-Z][\w \-]*)`, Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/e/elixir.go b/vendor/github.com/alecthomas/chroma/lexers/e/elixir.go deleted file mode 100644 index 40730290..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/e/elixir.go +++ /dev/null @@ -1,270 +0,0 @@ -package e - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Elixir lexer. -var Elixir = internal.Register(MustNewLexer( - &Config{ - Name: "Elixir", - Aliases: []string{"elixir", "ex", "exs"}, - Filenames: []string{"*.ex", "*.exs"}, - MimeTypes: []string{"text/x-elixir"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`#.*$`, CommentSingle, nil}, - {`(\?)(\\x\{)([\da-fA-F]+)(\})`, ByGroups(LiteralStringChar, LiteralStringEscape, LiteralNumberHex, LiteralStringEscape), nil}, - {`(\?)(\\x[\da-fA-F]{1,2})`, ByGroups(LiteralStringChar, LiteralStringEscape), nil}, - {`(\?)(\\[abdefnrstv])`, ByGroups(LiteralStringChar, LiteralStringEscape), nil}, - {`\?\\?.`, LiteralStringChar, nil}, - {`:::`, LiteralStringSymbol, nil}, - {`::`, Operator, nil}, - {`:(?:\.\.\.|<<>>|%\{\}|%|\{\})`, LiteralStringSymbol, nil}, - {`:(?:(?:\.\.\.|[a-z_]\w*[!?]?)|[A-Z]\w*(?:\.[A-Z]\w*)*|(?:\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>|\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~|\<|\>|\+|\-|\*|\/|\!|\^|\&))`, LiteralStringSymbol, nil}, - {`:"`, LiteralStringSymbol, Push("string_double_atom")}, - {`:'`, LiteralStringSymbol, Push("string_single_atom")}, - {`((?:\.\.\.|<<>>|%\{\}|%|\{\})|(?:(?:\.\.\.|[a-z_]\w*[!?]?)|[A-Z]\w*(?:\.[A-Z]\w*)*|(?:\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>|\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~|\<|\>|\+|\-|\*|\/|\!|\^|\&)))(:)(?=\s|\n)`, ByGroups(LiteralStringSymbol, Punctuation), nil}, - {`@(?:\.\.\.|[a-z_]\w*[!?]?)`, NameAttribute, nil}, - {`(?:\.\.\.|[a-z_]\w*[!?]?)`, Name, nil}, - {`(%?)([A-Z]\w*(?:\.[A-Z]\w*)*)`, ByGroups(Punctuation, NameClass), nil}, - {`\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>`, Operator, nil}, - {`\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~`, Operator, nil}, - {`\\\\|\<\<|\>\>|\=\>|\(|\)|\:|\;|\,|\[|\]`, Punctuation, nil}, - {`&\d`, NameEntity, nil}, - {`\<|\>|\+|\-|\*|\/|\!|\^|\&`, Operator, nil}, - {`0b[01](_?[01])*`, LiteralNumberBin, nil}, - {`0o[0-7](_?[0-7])*`, LiteralNumberOct, nil}, - {`0x[\da-fA-F](_?[\dA-Fa-f])*`, LiteralNumberHex, nil}, - {`\d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?`, LiteralNumberFloat, nil}, - {`\d(_?\d)*`, LiteralNumberInteger, nil}, - {`"""\s*`, LiteralStringHeredoc, Push("heredoc_double")}, - {`'''\s*$`, LiteralStringHeredoc, Push("heredoc_single")}, - {`"`, LiteralStringDouble, Push("string_double")}, - {`'`, LiteralStringSingle, Push("string_single")}, - Include("sigils"), - {`%\{`, Punctuation, Push("map_key")}, - {`\{`, Punctuation, Push("tuple")}, - }, - "heredoc_double": { - {`^\s*"""`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_interpol"), - }, - "heredoc_single": { - {`^\s*'''`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_interpol"), - }, - "heredoc_interpol": { - {`[^#\\\n]+`, LiteralStringHeredoc, nil}, - Include("escapes"), - {`\\.`, LiteralStringHeredoc, nil}, - {`\n+`, LiteralStringHeredoc, nil}, - Include("interpol"), - }, - "heredoc_no_interpol": { - {`[^\\\n]+`, LiteralStringHeredoc, nil}, - {`\\.`, LiteralStringHeredoc, nil}, - {`\n+`, LiteralStringHeredoc, nil}, - }, - "escapes": { - {`(\\x\{)([\da-fA-F]+)(\})`, ByGroups(LiteralStringEscape, LiteralNumberHex, LiteralStringEscape), nil}, - {`(\\x[\da-fA-F]{1,2})`, LiteralStringEscape, nil}, - {`(\\[abdefnrstv])`, LiteralStringEscape, nil}, - }, - "interpol": { - {`#\{`, LiteralStringInterpol, Push("interpol_string")}, - }, - "interpol_string": { - {`\}`, LiteralStringInterpol, Pop(1)}, - Include("root"), - }, - "map_key": { - Include("root"), - {`:`, Punctuation, Push("map_val")}, - {`=>`, Punctuation, Push("map_val")}, - {`\}`, Punctuation, Pop(1)}, - }, - "map_val": { - Include("root"), - {`,`, Punctuation, Pop(1)}, - {`(?=\})`, Punctuation, Pop(1)}, - }, - "tuple": { - Include("root"), - {`\}`, Punctuation, Pop(1)}, - }, - "string_double": { - {`[^#"\\]+`, LiteralStringDouble, nil}, - Include("escapes"), - {`\\.`, LiteralStringDouble, nil}, - {`(")`, ByGroups(LiteralStringDouble), Pop(1)}, - Include("interpol"), - }, - "string_single": { - {`[^#'\\]+`, LiteralStringSingle, nil}, - Include("escapes"), - {`\\.`, LiteralStringSingle, nil}, - {`(')`, ByGroups(LiteralStringSingle), Pop(1)}, - Include("interpol"), - }, - "string_double_atom": { - {`[^#"\\]+`, LiteralStringSymbol, nil}, - Include("escapes"), - {`\\.`, LiteralStringSymbol, nil}, - {`(")`, ByGroups(LiteralStringSymbol), Pop(1)}, - Include("interpol"), - }, - "string_single_atom": { - {`[^#'\\]+`, LiteralStringSymbol, nil}, - Include("escapes"), - {`\\.`, LiteralStringSymbol, nil}, - {`(')`, ByGroups(LiteralStringSymbol), Pop(1)}, - Include("interpol"), - }, - "sigils": { - {`(~[a-z])(""")`, ByGroups(LiteralStringOther, LiteralStringHeredoc), Push("triquot-end", "triquot-intp")}, - {`(~[A-Z])(""")`, ByGroups(LiteralStringOther, LiteralStringHeredoc), Push("triquot-end", "triquot-no-intp")}, - {`(~[a-z])(''')`, ByGroups(LiteralStringOther, LiteralStringHeredoc), Push("triapos-end", "triapos-intp")}, - {`(~[A-Z])(''')`, ByGroups(LiteralStringOther, LiteralStringHeredoc), Push("triapos-end", "triapos-no-intp")}, - {`~[a-z]\{`, LiteralStringOther, Push("cb-intp")}, - {`~[A-Z]\{`, LiteralStringOther, Push("cb-no-intp")}, - {`~[a-z]\[`, LiteralStringOther, Push("sb-intp")}, - {`~[A-Z]\[`, LiteralStringOther, Push("sb-no-intp")}, - {`~[a-z]\(`, LiteralStringOther, Push("pa-intp")}, - {`~[A-Z]\(`, LiteralStringOther, Push("pa-no-intp")}, - {`~[a-z]<`, LiteralStringOther, Push("ab-intp")}, - {`~[A-Z]<`, LiteralStringOther, Push("ab-no-intp")}, - {`~[a-z]/`, LiteralStringOther, Push("slas-intp")}, - {`~[A-Z]/`, LiteralStringOther, Push("slas-no-intp")}, - {`~[a-z]\|`, LiteralStringOther, Push("pipe-intp")}, - {`~[A-Z]\|`, LiteralStringOther, Push("pipe-no-intp")}, - {`~[a-z]"`, LiteralStringOther, Push("quot-intp")}, - {`~[A-Z]"`, LiteralStringOther, Push("quot-no-intp")}, - {`~[a-z]'`, LiteralStringOther, Push("apos-intp")}, - {`~[A-Z]'`, LiteralStringOther, Push("apos-no-intp")}, - }, - "triquot-end": { - {`[a-zA-Z]+`, LiteralStringOther, Pop(1)}, - Default(Pop(1)), - }, - "triquot-intp": { - {`^\s*"""`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_interpol"), - }, - "triquot-no-intp": { - {`^\s*"""`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_no_interpol"), - }, - "triapos-end": { - {`[a-zA-Z]+`, LiteralStringOther, Pop(1)}, - Default(Pop(1)), - }, - "triapos-intp": { - {`^\s*'''`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_interpol"), - }, - "triapos-no-intp": { - {`^\s*'''`, LiteralStringHeredoc, Pop(1)}, - Include("heredoc_no_interpol"), - }, - "cb-intp": { - {`[^#\}\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`\}[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "cb-no-intp": { - {`[^\}\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`\}[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "sb-intp": { - {`[^#\]\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`\][a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "sb-no-intp": { - {`[^\]\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`\][a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "pa-intp": { - {`[^#\)\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`\)[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "pa-no-intp": { - {`[^\)\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`\)[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "ab-intp": { - {`[^#>\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`>[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "ab-no-intp": { - {`[^>\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`>[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "slas-intp": { - {`[^#/\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`/[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "slas-no-intp": { - {`[^/\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`/[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "pipe-intp": { - {`[^#\|\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`\|[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "pipe-no-intp": { - {`[^\|\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`\|[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "quot-intp": { - {`[^#"\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`"[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "quot-no-intp": { - {`[^"\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`"[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - "apos-intp": { - {`[^#'\\]+`, LiteralStringOther, nil}, - Include("escapes"), - {`\\.`, LiteralStringOther, nil}, - {`'[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - Include("interpol"), - }, - "apos-no-intp": { - {`[^'\\]+`, LiteralStringOther, nil}, - {`\\.`, LiteralStringOther, nil}, - {`'[a-zA-Z]*`, LiteralStringOther, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/e/elm.go b/vendor/github.com/alecthomas/chroma/lexers/e/elm.go deleted file mode 100644 index a71c6270..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/e/elm.go +++ /dev/null @@ -1,59 +0,0 @@ -package e - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Elm lexer. -var Elm = internal.Register(MustNewLexer( - &Config{ - Name: "Elm", - Aliases: []string{"elm"}, - Filenames: []string{"*.elm"}, - MimeTypes: []string{"text/x-elm"}, - }, - Rules{ - "root": { - {`\{-`, CommentMultiline, Push("comment")}, - {`--.*`, CommentSingle, nil}, - {`\s+`, Text, nil}, - {`"`, LiteralString, Push("doublequote")}, - {`^\s*module\s*`, KeywordNamespace, Push("imports")}, - {`^\s*import\s*`, KeywordNamespace, Push("imports")}, - {`\[glsl\|.*`, NameEntity, Push("shader")}, - {Words(``, `\b`, `alias`, `as`, `case`, `else`, `if`, `import`, `in`, `let`, `module`, `of`, `port`, `then`, `type`, `where`), KeywordReserved, nil}, - {`[A-Z]\w*`, KeywordType, nil}, - {`^main `, KeywordReserved, nil}, - {Words(`\(`, `\)`, `~`, `||`, `|>`, `|`, "`", `^`, `\`, `'`, `>>`, `>=`, `>`, `==`, `=`, `<~`, `<|`, `<=`, `<<`, `<-`, `<`, `::`, `:`, `/=`, `//`, `/`, `..`, `.`, `->`, `-`, `++`, `+`, `*`, `&&`, `%`), NameFunction, nil}, - {Words(``, ``, `~`, `||`, `|>`, `|`, "`", `^`, `\`, `'`, `>>`, `>=`, `>`, `==`, `=`, `<~`, `<|`, `<=`, `<<`, `<-`, `<`, `::`, `:`, `/=`, `//`, `/`, `..`, `.`, `->`, `-`, `++`, `+`, `*`, `&&`, `%`), NameFunction, nil}, - Include("numbers"), - {`[a-z_][a-zA-Z_\']*`, NameVariable, nil}, - {`[,()\[\]{}]`, Punctuation, nil}, - }, - "comment": { - {`-(?!\})`, CommentMultiline, nil}, - {`\{-`, CommentMultiline, Push("comment")}, - {`[^-}]`, CommentMultiline, nil}, - {`-\}`, CommentMultiline, Pop(1)}, - }, - "doublequote": { - {`\\u[0-9a-fA-F]{4}`, LiteralStringEscape, nil}, - {`\\[nrfvb\\"]`, LiteralStringEscape, nil}, - {`[^"]`, LiteralString, nil}, - {`"`, LiteralString, Pop(1)}, - }, - "imports": { - {`\w+(\.\w+)*`, NameClass, Pop(1)}, - }, - "numbers": { - {`_?\d+\.(?=\d+)`, LiteralNumberFloat, nil}, - {`_?\d+`, LiteralNumberInteger, nil}, - }, - "shader": { - {`\|(?!\])`, NameEntity, nil}, - {`\|\]`, NameEntity, Pop(1)}, - {`.*\n`, NameEntity, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/e/emacs.go b/vendor/github.com/alecthomas/chroma/lexers/e/emacs.go deleted file mode 100644 index 78ffda12..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/e/emacs.go +++ /dev/null @@ -1,582 +0,0 @@ -package e - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var ( - emacsMacros = []string{ - "atomic-change-group", "case", "block", "cl-block", "cl-callf", "cl-callf2", - "cl-case", "cl-decf", "cl-declaim", "cl-declare", - "cl-define-compiler-macro", "cl-defmacro", "cl-defstruct", - "cl-defsubst", "cl-deftype", "cl-defun", "cl-destructuring-bind", - "cl-do", "cl-do*", "cl-do-all-symbols", "cl-do-symbols", "cl-dolist", - "cl-dotimes", "cl-ecase", "cl-etypecase", "eval-when", "cl-eval-when", "cl-flet", - "cl-flet*", "cl-function", "cl-incf", "cl-labels", "cl-letf", - "cl-letf*", "cl-load-time-value", "cl-locally", "cl-loop", - "cl-macrolet", "cl-multiple-value-bind", "cl-multiple-value-setq", - "cl-progv", "cl-psetf", "cl-psetq", "cl-pushnew", "cl-remf", - "cl-return", "cl-return-from", "cl-rotatef", "cl-shiftf", - "cl-symbol-macrolet", "cl-tagbody", "cl-the", "cl-typecase", - "combine-after-change-calls", "condition-case-unless-debug", "decf", - "declaim", "declare", "declare-function", "def-edebug-spec", - "defadvice", "defclass", "defcustom", "defface", "defgeneric", - "defgroup", "define-advice", "define-alternatives", - "define-compiler-macro", "define-derived-mode", "define-generic-mode", - "define-global-minor-mode", "define-globalized-minor-mode", - "define-minor-mode", "define-modify-macro", - "define-obsolete-face-alias", "define-obsolete-function-alias", - "define-obsolete-variable-alias", "define-setf-expander", - "define-skeleton", "defmacro", "defmethod", "defsetf", "defstruct", - "defsubst", "deftheme", "deftype", "defun", "defvar-local", - "delay-mode-hooks", "destructuring-bind", "do", "do*", - "do-all-symbols", "do-symbols", "dolist", "dont-compile", "dotimes", - "dotimes-with-progress-reporter", "ecase", "ert-deftest", "etypecase", - "eval-and-compile", "eval-when-compile", "flet", "ignore-errors", - "incf", "labels", "lambda", "letrec", "lexical-let", "lexical-let*", - "loop", "multiple-value-bind", "multiple-value-setq", "noreturn", - "oref", "oref-default", "oset", "oset-default", "pcase", - "pcase-defmacro", "pcase-dolist", "pcase-exhaustive", "pcase-let", - "pcase-let*", "pop", "psetf", "psetq", "push", "pushnew", "remf", - "return", "rotatef", "rx", "save-match-data", "save-selected-window", - "save-window-excursion", "setf", "setq-local", "shiftf", - "track-mouse", "typecase", "unless", "use-package", "when", - "while-no-input", "with-case-table", "with-category-table", - "with-coding-priority", "with-current-buffer", "with-demoted-errors", - "with-eval-after-load", "with-file-modes", "with-local-quit", - "with-output-to-string", "with-output-to-temp-buffer", - "with-parsed-tramp-file-name", "with-selected-frame", - "with-selected-window", "with-silent-modifications", "with-slots", - "with-syntax-table", "with-temp-buffer", "with-temp-file", - "with-temp-message", "with-timeout", "with-tramp-connection-property", - "with-tramp-file-property", "with-tramp-progress-reporter", - "with-wrapper-hook", "load-time-value", "locally", "macrolet", "progv", - "return-from", - } - - emacsSpecialForms = []string{ - "and", "catch", "cond", "condition-case", "defconst", "defvar", - "function", "if", "interactive", "let", "let*", "or", "prog1", - "prog2", "progn", "quote", "save-current-buffer", "save-excursion", - "save-restriction", "setq", "setq-default", "subr-arity", - "unwind-protect", "while", - } - - emacsBuiltinFunction = []string{ - "%", "*", "+", "-", "/", "/=", "1+", "1-", "<", "<=", "=", ">", ">=", - "Snarf-documentation", "abort-recursive-edit", "abs", - "accept-process-output", "access-file", "accessible-keymaps", "acos", - "active-minibuffer-window", "add-face-text-property", - "add-name-to-file", "add-text-properties", "all-completions", - "append", "apply", "apropos-internal", "aref", "arrayp", "aset", - "ash", "asin", "assoc", "assoc-string", "assq", "atan", "atom", - "autoload", "autoload-do-load", "backtrace", "backtrace--locals", - "backtrace-debug", "backtrace-eval", "backtrace-frame", - "backward-char", "backward-prefix-chars", "barf-if-buffer-read-only", - "base64-decode-region", "base64-decode-string", - "base64-encode-region", "base64-encode-string", "beginning-of-line", - "bidi-find-overridden-directionality", "bidi-resolved-levels", - "bitmap-spec-p", "bobp", "bolp", "bool-vector", - "bool-vector-count-consecutive", "bool-vector-count-population", - "bool-vector-exclusive-or", "bool-vector-intersection", - "bool-vector-not", "bool-vector-p", "bool-vector-set-difference", - "bool-vector-subsetp", "bool-vector-union", "boundp", - "buffer-base-buffer", "buffer-chars-modified-tick", - "buffer-enable-undo", "buffer-file-name", "buffer-has-markers-at", - "buffer-list", "buffer-live-p", "buffer-local-value", - "buffer-local-variables", "buffer-modified-p", "buffer-modified-tick", - "buffer-name", "buffer-size", "buffer-string", "buffer-substring", - "buffer-substring-no-properties", "buffer-swap-text", "bufferp", - "bury-buffer-internal", "byte-code", "byte-code-function-p", - "byte-to-position", "byte-to-string", "byteorder", - "call-interactively", "call-last-kbd-macro", "call-process", - "call-process-region", "cancel-kbd-macro-events", "capitalize", - "capitalize-region", "capitalize-word", "car", "car-less-than-car", - "car-safe", "case-table-p", "category-docstring", - "category-set-mnemonics", "category-table", "category-table-p", - "ccl-execute", "ccl-execute-on-string", "ccl-program-p", "cdr", - "cdr-safe", "ceiling", "char-after", "char-before", - "char-category-set", "char-charset", "char-equal", "char-or-string-p", - "char-resolve-modifiers", "char-syntax", "char-table-extra-slot", - "char-table-p", "char-table-parent", "char-table-range", - "char-table-subtype", "char-to-string", "char-width", "characterp", - "charset-after", "charset-id-internal", "charset-plist", - "charset-priority-list", "charsetp", "check-coding-system", - "check-coding-systems-region", "clear-buffer-auto-save-failure", - "clear-charset-maps", "clear-face-cache", "clear-font-cache", - "clear-image-cache", "clear-string", "clear-this-command-keys", - "close-font", "clrhash", "coding-system-aliases", - "coding-system-base", "coding-system-eol-type", "coding-system-p", - "coding-system-plist", "coding-system-priority-list", - "coding-system-put", "color-distance", "color-gray-p", - "color-supported-p", "combine-after-change-execute", - "command-error-default-function", "command-remapping", "commandp", - "compare-buffer-substrings", "compare-strings", - "compare-window-configurations", "completing-read", - "compose-region-internal", "compose-string-internal", - "composition-get-gstring", "compute-motion", "concat", "cons", - "consp", "constrain-to-field", "continue-process", - "controlling-tty-p", "coordinates-in-window-p", "copy-alist", - "copy-category-table", "copy-file", "copy-hash-table", "copy-keymap", - "copy-marker", "copy-sequence", "copy-syntax-table", "copysign", - "cos", "current-active-maps", "current-bidi-paragraph-direction", - "current-buffer", "current-case-table", "current-column", - "current-global-map", "current-idle-time", "current-indentation", - "current-input-mode", "current-local-map", "current-message", - "current-minor-mode-maps", "current-time", "current-time-string", - "current-time-zone", "current-window-configuration", - "cygwin-convert-file-name-from-windows", - "cygwin-convert-file-name-to-windows", "daemon-initialized", - "daemonp", "dbus--init-bus", "dbus-get-unique-name", - "dbus-message-internal", "debug-timer-check", "declare-equiv-charset", - "decode-big5-char", "decode-char", "decode-coding-region", - "decode-coding-string", "decode-sjis-char", "decode-time", - "default-boundp", "default-file-modes", "default-printer-name", - "default-toplevel-value", "default-value", "define-category", - "define-charset-alias", "define-charset-internal", - "define-coding-system-alias", "define-coding-system-internal", - "define-fringe-bitmap", "define-hash-table-test", "define-key", - "define-prefix-command", "delete", - "delete-all-overlays", "delete-and-extract-region", "delete-char", - "delete-directory-internal", "delete-field", "delete-file", - "delete-frame", "delete-other-windows-internal", "delete-overlay", - "delete-process", "delete-region", "delete-terminal", - "delete-window-internal", "delq", "describe-buffer-bindings", - "describe-vector", "destroy-fringe-bitmap", "detect-coding-region", - "detect-coding-string", "ding", "directory-file-name", - "directory-files", "directory-files-and-attributes", "discard-input", - "display-supports-face-attributes-p", "do-auto-save", "documentation", - "documentation-property", "downcase", "downcase-region", - "downcase-word", "draw-string", "dump-colors", "dump-emacs", - "dump-face", "dump-frame-glyph-matrix", "dump-glyph-matrix", - "dump-glyph-row", "dump-redisplay-history", "dump-tool-bar-row", - "elt", "emacs-pid", "encode-big5-char", "encode-char", - "encode-coding-region", "encode-coding-string", "encode-sjis-char", - "encode-time", "end-kbd-macro", "end-of-line", "eobp", "eolp", "eq", - "eql", "equal", "equal-including-properties", "erase-buffer", - "error-message-string", "eval", "eval-buffer", "eval-region", - "event-convert-list", "execute-kbd-macro", "exit-recursive-edit", - "exp", "expand-file-name", "expt", "external-debugging-output", - "face-attribute-relative-p", "face-attributes-as-vector", "face-font", - "fboundp", "fceiling", "fetch-bytecode", "ffloor", - "field-beginning", "field-end", "field-string", - "field-string-no-properties", "file-accessible-directory-p", - "file-acl", "file-attributes", "file-attributes-lessp", - "file-directory-p", "file-executable-p", "file-exists-p", - "file-locked-p", "file-modes", "file-name-absolute-p", - "file-name-all-completions", "file-name-as-directory", - "file-name-completion", "file-name-directory", - "file-name-nondirectory", "file-newer-than-file-p", "file-readable-p", - "file-regular-p", "file-selinux-context", "file-symlink-p", - "file-system-info", "file-system-info", "file-writable-p", - "fillarray", "find-charset-region", "find-charset-string", - "find-coding-systems-region-internal", "find-composition-internal", - "find-file-name-handler", "find-font", "find-operation-coding-system", - "float", "float-time", "floatp", "floor", "fmakunbound", - "following-char", "font-at", "font-drive-otf", "font-face-attributes", - "font-family-list", "font-get", "font-get-glyphs", - "font-get-system-font", "font-get-system-normal-font", "font-info", - "font-match-p", "font-otf-alternates", "font-put", - "font-shape-gstring", "font-spec", "font-variation-glyphs", - "font-xlfd-name", "fontp", "fontset-font", "fontset-info", - "fontset-list", "fontset-list-all", "force-mode-line-update", - "force-window-update", "format", "format-mode-line", - "format-network-address", "format-time-string", "forward-char", - "forward-comment", "forward-line", "forward-word", - "frame-border-width", "frame-bottom-divider-width", - "frame-can-run-window-configuration-change-hook", "frame-char-height", - "frame-char-width", "frame-face-alist", "frame-first-window", - "frame-focus", "frame-font-cache", "frame-fringe-width", "frame-list", - "frame-live-p", "frame-or-buffer-changed-p", "frame-parameter", - "frame-parameters", "frame-pixel-height", "frame-pixel-width", - "frame-pointer-visible-p", "frame-right-divider-width", - "frame-root-window", "frame-scroll-bar-height", - "frame-scroll-bar-width", "frame-selected-window", "frame-terminal", - "frame-text-cols", "frame-text-height", "frame-text-lines", - "frame-text-width", "frame-total-cols", "frame-total-lines", - "frame-visible-p", "framep", "frexp", "fringe-bitmaps-at-pos", - "fround", "fset", "ftruncate", "funcall", "funcall-interactively", - "function-equal", "functionp", "gap-position", "gap-size", - "garbage-collect", "gc-status", "generate-new-buffer-name", "get", - "get-buffer", "get-buffer-create", "get-buffer-process", - "get-buffer-window", "get-byte", "get-char-property", - "get-char-property-and-overlay", "get-file-buffer", "get-file-char", - "get-internal-run-time", "get-load-suffixes", "get-pos-property", - "get-process", "get-screen-color", "get-text-property", - "get-unicode-property-internal", "get-unused-category", - "get-unused-iso-final-char", "getenv-internal", "gethash", - "gfile-add-watch", "gfile-rm-watch", "global-key-binding", - "gnutls-available-p", "gnutls-boot", "gnutls-bye", "gnutls-deinit", - "gnutls-error-fatalp", "gnutls-error-string", "gnutls-errorp", - "gnutls-get-initstage", "gnutls-peer-status", - "gnutls-peer-status-warning-describe", "goto-char", "gpm-mouse-start", - "gpm-mouse-stop", "group-gid", "group-real-gid", - "handle-save-session", "handle-switch-frame", "hash-table-count", - "hash-table-p", "hash-table-rehash-size", - "hash-table-rehash-threshold", "hash-table-size", "hash-table-test", - "hash-table-weakness", "iconify-frame", "identity", "image-flush", - "image-mask-p", "image-metadata", "image-size", "imagemagick-types", - "imagep", "indent-to", "indirect-function", "indirect-variable", - "init-image-library", "inotify-add-watch", "inotify-rm-watch", - "input-pending-p", "insert", "insert-and-inherit", - "insert-before-markers", "insert-before-markers-and-inherit", - "insert-buffer-substring", "insert-byte", "insert-char", - "insert-file-contents", "insert-startup-screen", "int86", - "integer-or-marker-p", "integerp", "interactive-form", "intern", - "intern-soft", "internal--track-mouse", "internal-char-font", - "internal-complete-buffer", "internal-copy-lisp-face", - "internal-default-process-filter", - "internal-default-process-sentinel", "internal-describe-syntax-value", - "internal-event-symbol-parse-modifiers", - "internal-face-x-get-resource", "internal-get-lisp-face-attribute", - "internal-lisp-face-attribute-values", "internal-lisp-face-empty-p", - "internal-lisp-face-equal-p", "internal-lisp-face-p", - "internal-make-lisp-face", "internal-make-var-non-special", - "internal-merge-in-global-face", - "internal-set-alternative-font-family-alist", - "internal-set-alternative-font-registry-alist", - "internal-set-font-selection-order", - "internal-set-lisp-face-attribute", - "internal-set-lisp-face-attribute-from-resource", - "internal-show-cursor", "internal-show-cursor-p", "interrupt-process", - "invisible-p", "invocation-directory", "invocation-name", "isnan", - "iso-charset", "key-binding", "key-description", - "keyboard-coding-system", "keymap-parent", "keymap-prompt", "keymapp", - "keywordp", "kill-all-local-variables", "kill-buffer", "kill-emacs", - "kill-local-variable", "kill-process", "last-nonminibuffer-frame", - "lax-plist-get", "lax-plist-put", "ldexp", "length", - "libxml-parse-html-region", "libxml-parse-xml-region", - "line-beginning-position", "line-end-position", "line-pixel-height", - "list", "list-fonts", "list-system-processes", "listp", "load", - "load-average", "local-key-binding", "local-variable-if-set-p", - "local-variable-p", "locale-info", "locate-file-internal", - "lock-buffer", "log", "logand", "logb", "logior", "lognot", "logxor", - "looking-at", "lookup-image", "lookup-image-map", "lookup-key", - "lower-frame", "lsh", "macroexpand", "make-bool-vector", - "make-byte-code", "make-category-set", "make-category-table", - "make-char", "make-char-table", "make-directory-internal", - "make-frame-invisible", "make-frame-visible", "make-hash-table", - "make-indirect-buffer", "make-keymap", "make-list", - "make-local-variable", "make-marker", "make-network-process", - "make-overlay", "make-serial-process", "make-sparse-keymap", - "make-string", "make-symbol", "make-symbolic-link", "make-temp-name", - "make-terminal-frame", "make-variable-buffer-local", - "make-variable-frame-local", "make-vector", "makunbound", - "map-char-table", "map-charset-chars", "map-keymap", - "map-keymap-internal", "mapatoms", "mapc", "mapcar", "mapconcat", - "maphash", "mark-marker", "marker-buffer", "marker-insertion-type", - "marker-position", "markerp", "match-beginning", "match-data", - "match-end", "matching-paren", "max", "max-char", "md5", "member", - "memory-info", "memory-limit", "memory-use-counts", "memq", "memql", - "menu-bar-menu-at-x-y", "menu-or-popup-active-p", - "menu-or-popup-active-p", "merge-face-attribute", "message", - "message-box", "message-or-box", "min", - "minibuffer-completion-contents", "minibuffer-contents", - "minibuffer-contents-no-properties", "minibuffer-depth", - "minibuffer-prompt", "minibuffer-prompt-end", - "minibuffer-selected-window", "minibuffer-window", "minibufferp", - "minor-mode-key-binding", "mod", "modify-category-entry", - "modify-frame-parameters", "modify-syntax-entry", - "mouse-pixel-position", "mouse-position", "move-overlay", - "move-point-visually", "move-to-column", "move-to-window-line", - "msdos-downcase-filename", "msdos-long-file-names", "msdos-memget", - "msdos-memput", "msdos-mouse-disable", "msdos-mouse-enable", - "msdos-mouse-init", "msdos-mouse-p", "msdos-remember-default-colors", - "msdos-set-keyboard", "msdos-set-mouse-buttons", - "multibyte-char-to-unibyte", "multibyte-string-p", "narrow-to-region", - "natnump", "nconc", "network-interface-info", - "network-interface-list", "new-fontset", "newline-cache-check", - "next-char-property-change", "next-frame", "next-overlay-change", - "next-property-change", "next-read-file-uses-dialog-p", - "next-single-char-property-change", "next-single-property-change", - "next-window", "nlistp", "nreverse", "nth", "nthcdr", "null", - "number-or-marker-p", "number-to-string", "numberp", - "open-dribble-file", "open-font", "open-termscript", - "optimize-char-table", "other-buffer", "other-window-for-scrolling", - "overlay-buffer", "overlay-end", "overlay-get", "overlay-lists", - "overlay-properties", "overlay-put", "overlay-recenter", - "overlay-start", "overlayp", "overlays-at", "overlays-in", - "parse-partial-sexp", "play-sound-internal", "plist-get", - "plist-member", "plist-put", "point", "point-marker", "point-max", - "point-max-marker", "point-min", "point-min-marker", - "pos-visible-in-window-p", "position-bytes", "posix-looking-at", - "posix-search-backward", "posix-search-forward", "posix-string-match", - "posn-at-point", "posn-at-x-y", "preceding-char", - "prefix-numeric-value", "previous-char-property-change", - "previous-frame", "previous-overlay-change", - "previous-property-change", "previous-single-char-property-change", - "previous-single-property-change", "previous-window", "prin1", - "prin1-to-string", "princ", "print", "process-attributes", - "process-buffer", "process-coding-system", "process-command", - "process-connection", "process-contact", "process-datagram-address", - "process-exit-status", "process-filter", "process-filter-multibyte-p", - "process-id", "process-inherit-coding-system-flag", "process-list", - "process-mark", "process-name", "process-plist", - "process-query-on-exit-flag", "process-running-child-p", - "process-send-eof", "process-send-region", "process-send-string", - "process-sentinel", "process-status", "process-tty-name", - "process-type", "processp", "profiler-cpu-log", - "profiler-cpu-running-p", "profiler-cpu-start", "profiler-cpu-stop", - "profiler-memory-log", "profiler-memory-running-p", - "profiler-memory-start", "profiler-memory-stop", "propertize", - "purecopy", "put", "put-text-property", - "put-unicode-property-internal", "puthash", "query-font", - "query-fontset", "quit-process", "raise-frame", "random", "rassoc", - "rassq", "re-search-backward", "re-search-forward", "read", - "read-buffer", "read-char", "read-char-exclusive", - "read-coding-system", "read-command", "read-event", - "read-from-minibuffer", "read-from-string", "read-function", - "read-key-sequence", "read-key-sequence-vector", - "read-no-blanks-input", "read-non-nil-coding-system", "read-string", - "read-variable", "recent-auto-save-p", "recent-doskeys", - "recent-keys", "recenter", "recursion-depth", "recursive-edit", - "redirect-debugging-output", "redirect-frame-focus", "redisplay", - "redraw-display", "redraw-frame", "regexp-quote", "region-beginning", - "region-end", "register-ccl-program", "register-code-conversion-map", - "remhash", "remove-list-of-text-properties", "remove-text-properties", - "rename-buffer", "rename-file", "replace-match", - "reset-this-command-lengths", "resize-mini-window-internal", - "restore-buffer-modified-p", "resume-tty", "reverse", "round", - "run-hook-with-args", "run-hook-with-args-until-failure", - "run-hook-with-args-until-success", "run-hook-wrapped", "run-hooks", - "run-window-configuration-change-hook", "run-window-scroll-functions", - "safe-length", "scan-lists", "scan-sexps", "scroll-down", - "scroll-left", "scroll-other-window", "scroll-right", "scroll-up", - "search-backward", "search-forward", "secure-hash", "select-frame", - "select-window", "selected-frame", "selected-window", - "self-insert-command", "send-string-to-terminal", "sequencep", - "serial-process-configure", "set", "set-buffer", - "set-buffer-auto-saved", "set-buffer-major-mode", - "set-buffer-modified-p", "set-buffer-multibyte", "set-case-table", - "set-category-table", "set-char-table-extra-slot", - "set-char-table-parent", "set-char-table-range", "set-charset-plist", - "set-charset-priority", "set-coding-system-priority", - "set-cursor-size", "set-default", "set-default-file-modes", - "set-default-toplevel-value", "set-file-acl", "set-file-modes", - "set-file-selinux-context", "set-file-times", "set-fontset-font", - "set-frame-height", "set-frame-position", "set-frame-selected-window", - "set-frame-size", "set-frame-width", "set-fringe-bitmap-face", - "set-input-interrupt-mode", "set-input-meta-mode", "set-input-mode", - "set-keyboard-coding-system-internal", "set-keymap-parent", - "set-marker", "set-marker-insertion-type", "set-match-data", - "set-message-beep", "set-minibuffer-window", - "set-mouse-pixel-position", "set-mouse-position", - "set-network-process-option", "set-output-flow-control", - "set-process-buffer", "set-process-coding-system", - "set-process-datagram-address", "set-process-filter", - "set-process-filter-multibyte", - "set-process-inherit-coding-system-flag", "set-process-plist", - "set-process-query-on-exit-flag", "set-process-sentinel", - "set-process-window-size", "set-quit-char", - "set-safe-terminal-coding-system-internal", "set-screen-color", - "set-standard-case-table", "set-syntax-table", - "set-terminal-coding-system-internal", "set-terminal-local-value", - "set-terminal-parameter", "set-text-properties", "set-time-zone-rule", - "set-visited-file-modtime", "set-window-buffer", - "set-window-combination-limit", "set-window-configuration", - "set-window-dedicated-p", "set-window-display-table", - "set-window-fringes", "set-window-hscroll", "set-window-margins", - "set-window-new-normal", "set-window-new-pixel", - "set-window-new-total", "set-window-next-buffers", - "set-window-parameter", "set-window-point", "set-window-prev-buffers", - "set-window-redisplay-end-trigger", "set-window-scroll-bars", - "set-window-start", "set-window-vscroll", "setcar", "setcdr", - "setplist", "show-face-resources", "signal", "signal-process", "sin", - "single-key-description", "skip-chars-backward", "skip-chars-forward", - "skip-syntax-backward", "skip-syntax-forward", "sleep-for", "sort", - "sort-charsets", "special-variable-p", "split-char", - "split-window-internal", "sqrt", "standard-case-table", - "standard-category-table", "standard-syntax-table", "start-kbd-macro", - "start-process", "stop-process", "store-kbd-macro-event", "string", - "string-as-multibyte", "string-as-unibyte", "string-bytes", - "string-collate-equalp", "string-collate-lessp", "string-equal", - "string-lessp", "string-make-multibyte", "string-make-unibyte", - "string-match", "string-to-char", "string-to-multibyte", - "string-to-number", "string-to-syntax", "string-to-unibyte", - "string-width", "stringp", "subr-name", "subrp", - "subst-char-in-region", "substitute-command-keys", - "substitute-in-file-name", "substring", "substring-no-properties", - "suspend-emacs", "suspend-tty", "suspicious-object", "sxhash", - "symbol-function", "symbol-name", "symbol-plist", "symbol-value", - "symbolp", "syntax-table", "syntax-table-p", "system-groups", - "system-move-file-to-trash", "system-name", "system-users", "tan", - "terminal-coding-system", "terminal-list", "terminal-live-p", - "terminal-local-value", "terminal-name", "terminal-parameter", - "terminal-parameters", "terpri", "test-completion", - "text-char-description", "text-properties-at", "text-property-any", - "text-property-not-all", "this-command-keys", - "this-command-keys-vector", "this-single-command-keys", - "this-single-command-raw-keys", "time-add", "time-less-p", - "time-subtract", "tool-bar-get-system-style", "tool-bar-height", - "tool-bar-pixel-width", "top-level", "trace-redisplay", - "trace-to-stderr", "translate-region-internal", "transpose-regions", - "truncate", "try-completion", "tty-display-color-cells", - "tty-display-color-p", "tty-no-underline", - "tty-suppress-bold-inverse-default-colors", "tty-top-frame", - "tty-type", "type-of", "undo-boundary", "unencodable-char-position", - "unhandled-file-name-directory", "unibyte-char-to-multibyte", - "unibyte-string", "unicode-property-table-internal", "unify-charset", - "unintern", "unix-sync", "unlock-buffer", "upcase", "upcase-initials", - "upcase-initials-region", "upcase-region", "upcase-word", - "use-global-map", "use-local-map", "user-full-name", - "user-login-name", "user-real-login-name", "user-real-uid", - "user-uid", "variable-binding-locus", "vconcat", "vector", - "vector-or-char-table-p", "vectorp", "verify-visited-file-modtime", - "vertical-motion", "visible-frame-list", "visited-file-modtime", - "w16-get-clipboard-data", "w16-selection-exists-p", - "w16-set-clipboard-data", "w32-battery-status", - "w32-default-color-map", "w32-define-rgb-color", - "w32-display-monitor-attributes-list", "w32-frame-menu-bar-size", - "w32-frame-rect", "w32-get-clipboard-data", - "w32-get-codepage-charset", "w32-get-console-codepage", - "w32-get-console-output-codepage", "w32-get-current-locale-id", - "w32-get-default-locale-id", "w32-get-keyboard-layout", - "w32-get-locale-info", "w32-get-valid-codepages", - "w32-get-valid-keyboard-layouts", "w32-get-valid-locale-ids", - "w32-has-winsock", "w32-long-file-name", "w32-reconstruct-hot-key", - "w32-register-hot-key", "w32-registered-hot-keys", - "w32-selection-exists-p", "w32-send-sys-command", - "w32-set-clipboard-data", "w32-set-console-codepage", - "w32-set-console-output-codepage", "w32-set-current-locale", - "w32-set-keyboard-layout", "w32-set-process-priority", - "w32-shell-execute", "w32-short-file-name", "w32-toggle-lock-key", - "w32-unload-winsock", "w32-unregister-hot-key", "w32-window-exists-p", - "w32notify-add-watch", "w32notify-rm-watch", - "waiting-for-user-input-p", "where-is-internal", "widen", - "widget-apply", "widget-get", "widget-put", - "window-absolute-pixel-edges", "window-at", "window-body-height", - "window-body-width", "window-bottom-divider-width", "window-buffer", - "window-combination-limit", "window-configuration-frame", - "window-configuration-p", "window-dedicated-p", - "window-display-table", "window-edges", "window-end", "window-frame", - "window-fringes", "window-header-line-height", "window-hscroll", - "window-inside-absolute-pixel-edges", "window-inside-edges", - "window-inside-pixel-edges", "window-left-child", - "window-left-column", "window-line-height", "window-list", - "window-list-1", "window-live-p", "window-margins", - "window-minibuffer-p", "window-mode-line-height", "window-new-normal", - "window-new-pixel", "window-new-total", "window-next-buffers", - "window-next-sibling", "window-normal-size", "window-old-point", - "window-parameter", "window-parameters", "window-parent", - "window-pixel-edges", "window-pixel-height", "window-pixel-left", - "window-pixel-top", "window-pixel-width", "window-point", - "window-prev-buffers", "window-prev-sibling", - "window-redisplay-end-trigger", "window-resize-apply", - "window-resize-apply-total", "window-right-divider-width", - "window-scroll-bar-height", "window-scroll-bar-width", - "window-scroll-bars", "window-start", "window-system", - "window-text-height", "window-text-pixel-size", "window-text-width", - "window-top-child", "window-top-line", "window-total-height", - "window-total-width", "window-use-time", "window-valid-p", - "window-vscroll", "windowp", "write-char", "write-region", - "x-backspace-delete-keys-p", "x-change-window-property", - "x-change-window-property", "x-close-connection", - "x-close-connection", "x-create-frame", "x-create-frame", - "x-delete-window-property", "x-delete-window-property", - "x-disown-selection-internal", "x-display-backing-store", - "x-display-backing-store", "x-display-color-cells", - "x-display-color-cells", "x-display-grayscale-p", - "x-display-grayscale-p", "x-display-list", "x-display-list", - "x-display-mm-height", "x-display-mm-height", "x-display-mm-width", - "x-display-mm-width", "x-display-monitor-attributes-list", - "x-display-pixel-height", "x-display-pixel-height", - "x-display-pixel-width", "x-display-pixel-width", "x-display-planes", - "x-display-planes", "x-display-save-under", "x-display-save-under", - "x-display-screens", "x-display-screens", "x-display-visual-class", - "x-display-visual-class", "x-family-fonts", "x-file-dialog", - "x-file-dialog", "x-file-dialog", "x-focus-frame", "x-frame-geometry", - "x-frame-geometry", "x-get-atom-name", "x-get-resource", - "x-get-selection-internal", "x-hide-tip", "x-hide-tip", - "x-list-fonts", "x-load-color-file", "x-menu-bar-open-internal", - "x-menu-bar-open-internal", "x-open-connection", "x-open-connection", - "x-own-selection-internal", "x-parse-geometry", "x-popup-dialog", - "x-popup-menu", "x-register-dnd-atom", "x-select-font", - "x-select-font", "x-selection-exists-p", "x-selection-owner-p", - "x-send-client-message", "x-server-max-request-size", - "x-server-max-request-size", "x-server-vendor", "x-server-vendor", - "x-server-version", "x-server-version", "x-show-tip", "x-show-tip", - "x-synchronize", "x-synchronize", "x-uses-old-gtk-dialog", - "x-window-property", "x-window-property", "x-wm-set-size-hint", - "xw-color-defined-p", "xw-color-defined-p", "xw-color-values", - "xw-color-values", "xw-display-color-p", "xw-display-color-p", - "yes-or-no-p", "zlib-available-p", "zlib-decompress-region", - "forward-point", - } - - emacsBuiltinFunctionHighlighted = []string{ - "defvaralias", "provide", "require", - "with-no-warnings", "define-widget", "with-electric-help", - "throw", "defalias", "featurep", - } - - emacsLambdaListKeywords = []string{ - "&allow-other-keys", "&aux", "&body", "&environment", "&key", "&optional", - "&rest", "&whole", - } - - emacsErrorKeywords = []string{ - "cl-assert", "cl-check-type", "error", "signal", - "user-error", "warn", - } -) - -// EmacsLisp lexer. -var EmacsLisp = internal.Register(TypeRemappingLexer(MustNewLexer( - &Config{ - Name: "EmacsLisp", - Aliases: []string{"emacs", "elisp", "emacs-lisp"}, - Filenames: []string{"*.el"}, - MimeTypes: []string{"text/x-elisp", "application/x-elisp"}, - }, - Rules{ - "root": { - Default(Push("body")), - }, - "body": { - {`\s+`, Text, nil}, - {`;.*$`, CommentSingle, nil}, - {`"`, LiteralString, Push("string")}, - {`\?([^\\]|\\.)`, LiteralStringChar, nil}, - {`:((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)`, NameBuiltin, nil}, - {`::((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)`, LiteralStringSymbol, nil}, - {`'((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)`, LiteralStringSymbol, nil}, - {`'`, Operator, nil}, - {"`", Operator, nil}, - {"[-+]?\\d+\\.?(?=[ \"()\\]\\'\\n,;`])", LiteralNumberInteger, nil}, - {"[-+]?\\d+/\\d+(?=[ \"()\\]\\'\\n,;`])", LiteralNumber, nil}, - {"[-+]?(\\d*\\.\\d+([defls][-+]?\\d+)?|\\d+(\\.\\d*)?[defls][-+]?\\d+)(?=[ \"()\\]\\'\\n,;`])", LiteralNumberFloat, nil}, - {`\[|\]`, Punctuation, nil}, - {`#:((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)`, LiteralStringSymbol, nil}, - {`#\^\^?`, Operator, nil}, - {`#\'`, NameFunction, nil}, - {`#[bB][+-]?[01]+(/[01]+)?`, LiteralNumberBin, nil}, - {`#[oO][+-]?[0-7]+(/[0-7]+)?`, LiteralNumberOct, nil}, - {`#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?`, LiteralNumberHex, nil}, - {`#\d+r[+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?`, LiteralNumber, nil}, - {`#\d+=`, Operator, nil}, - {`#\d+#`, Operator, nil}, - {`(,@|,|\.|:)`, Operator, nil}, - {"(t|nil)(?=[ \"()\\]\\'\\n,;`])", NameConstant, nil}, - {`\*((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)\*`, NameVariableGlobal, nil}, - {`((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)`, NameVariable, nil}, - {`#\(`, Operator, Push("body")}, - {`\(`, Punctuation, Push("body")}, - {`\)`, Punctuation, Pop(1)}, - }, - "string": { - {"[^\"\\\\`]+", LiteralString, nil}, - {"`((?:\\\\.|[\\w!$%&*+-/<=>?@^{}~|])(?:\\\\.|[\\w!$%&*+-/<=>?@^{}~|]|[#.:])*)\\'", LiteralStringSymbol, nil}, - {"`", LiteralString, nil}, - {`\\.`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`"`, LiteralString, Pop(1)}, - }, - }, -), TypeMapping{ - {NameVariable, NameFunction, emacsBuiltinFunction}, - {NameVariable, NameBuiltin, emacsSpecialForms}, - {NameVariable, NameException, emacsErrorKeywords}, - {NameVariable, NameBuiltin, append(emacsBuiltinFunctionHighlighted, emacsMacros...)}, - {NameVariable, KeywordPseudo, emacsLambdaListKeywords}, -})) diff --git a/vendor/github.com/alecthomas/chroma/lexers/e/erlang.go b/vendor/github.com/alecthomas/chroma/lexers/e/erlang.go deleted file mode 100644 index 63cd59a4..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/e/erlang.go +++ /dev/null @@ -1,66 +0,0 @@ -package e - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Erlang lexer. -var Erlang = internal.Register(MustNewLexer( - &Config{ - Name: "Erlang", - Aliases: []string{"erlang"}, - Filenames: []string{"*.erl", "*.hrl", "*.es", "*.escript"}, - MimeTypes: []string{"text/x-erlang"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`%.*\n`, Comment, nil}, - {Words(``, `\b`, `after`, `begin`, `case`, `catch`, `cond`, `end`, `fun`, `if`, `let`, `of`, `query`, `receive`, `try`, `when`), Keyword, nil}, - {Words(``, `\b`, `abs`, `append_element`, `apply`, `atom_to_list`, `binary_to_list`, `bitstring_to_list`, `binary_to_term`, `bit_size`, `bump_reductions`, `byte_size`, `cancel_timer`, `check_process_code`, `delete_module`, `demonitor`, `disconnect_node`, `display`, `element`, `erase`, `exit`, `float`, `float_to_list`, `fun_info`, `fun_to_list`, `function_exported`, `garbage_collect`, `get`, `get_keys`, `group_leader`, `hash`, `hd`, `integer_to_list`, `iolist_to_binary`, `iolist_size`, `is_atom`, `is_binary`, `is_bitstring`, `is_boolean`, `is_builtin`, `is_float`, `is_function`, `is_integer`, `is_list`, `is_number`, `is_pid`, `is_port`, `is_process_alive`, `is_record`, `is_reference`, `is_tuple`, `length`, `link`, `list_to_atom`, `list_to_binary`, `list_to_bitstring`, `list_to_existing_atom`, `list_to_float`, `list_to_integer`, `list_to_pid`, `list_to_tuple`, `load_module`, `localtime_to_universaltime`, `make_tuple`, `md5`, `md5_final`, `md5_update`, `memory`, `module_loaded`, `monitor`, `monitor_node`, `node`, `nodes`, `open_port`, `phash`, `phash2`, `pid_to_list`, `port_close`, `port_command`, `port_connect`, `port_control`, `port_call`, `port_info`, `port_to_list`, `process_display`, `process_flag`, `process_info`, `purge_module`, `put`, `read_timer`, `ref_to_list`, `register`, `resume_process`, `round`, `send`, `send_after`, `send_nosuspend`, `set_cookie`, `setelement`, `size`, `spawn`, `spawn_link`, `spawn_monitor`, `spawn_opt`, `split_binary`, `start_timer`, `statistics`, `suspend_process`, `system_flag`, `system_info`, `system_monitor`, `system_profile`, `term_to_binary`, `tl`, `trace`, `trace_delivered`, `trace_info`, `trace_pattern`, `trunc`, `tuple_size`, `tuple_to_list`, `universaltime_to_localtime`, `unlink`, `unregister`, `whereis`), NameBuiltin, nil}, - {Words(``, `\b`, `and`, `andalso`, `band`, `bnot`, `bor`, `bsl`, `bsr`, `bxor`, `div`, `not`, `or`, `orelse`, `rem`, `xor`), OperatorWord, nil}, - {`^-`, Punctuation, Push("directive")}, - {`(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)`, Operator, nil}, - {`"`, LiteralString, Push("string")}, - {`<<`, NameLabel, nil}, - {`>>`, NameLabel, nil}, - {`((?:[a-z]\w*|'[^\n']*[^\\]'))(:)`, ByGroups(NameNamespace, Punctuation), nil}, - {`(?:^|(?<=:))((?:[a-z]\w*|'[^\n']*[^\\]'))(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[+-]?(?:[2-9]|[12][0-9]|3[0-6])#[0-9a-zA-Z]+`, LiteralNumberInteger, nil}, - {`[+-]?\d+`, LiteralNumberInteger, nil}, - {`[+-]?\d+.\d+`, LiteralNumberFloat, nil}, - {`[]\[:_@\".{}()|;,]`, Punctuation, nil}, - {`(?:[A-Z_]\w*)`, NameVariable, nil}, - {`(?:[a-z]\w*|'[^\n']*[^\\]')`, Name, nil}, - {`\?(?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]'))`, NameConstant, nil}, - {`\$(?:(?:\\(?:[bdefnrstv\'"\\]|[0-7][0-7]?[0-7]?|(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})|\^[a-zA-Z]))|\\[ %]|[^\\])`, LiteralStringChar, nil}, - {`#(?:[a-z]\w*|'[^\n']*[^\\]')(:?\.(?:[a-z]\w*|'[^\n']*[^\\]'))?`, NameLabel, nil}, - {`\A#!.+\n`, CommentHashbang, nil}, - {`#\{`, Punctuation, Push("map_key")}, - }, - "string": { - {`(?:\\(?:[bdefnrstv\'"\\]|[0-7][0-7]?[0-7]?|(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})|\^[a-zA-Z]))`, LiteralStringEscape, nil}, - {`"`, LiteralString, Pop(1)}, - {`~[0-9.*]*[~#+BPWXb-ginpswx]`, LiteralStringInterpol, nil}, - {`[^"\\~]+`, LiteralString, nil}, - {`~`, LiteralString, nil}, - }, - "directive": { - {`(define)(\s*)(\()((?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]')))`, ByGroups(NameEntity, Text, Punctuation, NameConstant), Pop(1)}, - {`(record)(\s*)(\()((?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]')))`, ByGroups(NameEntity, Text, Punctuation, NameLabel), Pop(1)}, - {`(?:[a-z]\w*|'[^\n']*[^\\]')`, NameEntity, Pop(1)}, - }, - "map_key": { - Include("root"), - {`=>`, Punctuation, Push("map_val")}, - {`:=`, Punctuation, Push("map_val")}, - {`\}`, Punctuation, Pop(1)}, - }, - "map_val": { - Include("root"), - {`,`, Punctuation, Pop(1)}, - {`(?=\})`, Punctuation, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/f/factor.go b/vendor/github.com/alecthomas/chroma/lexers/f/factor.go deleted file mode 100644 index 26c0d562..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/f/factor.go +++ /dev/null @@ -1,115 +0,0 @@ -package f - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Factor lexer. -var Factor = internal.Register(MustNewLexer( - &Config{ - Name: "Factor", - Aliases: []string{"factor"}, - Filenames: []string{"*.factor"}, - MimeTypes: []string{"text/x-factor"}, - }, - Rules{ - "root": { - {`#!.*$`, CommentPreproc, nil}, - Default(Push("base")), - }, - "base": { - {`\s+`, Text, nil}, - {`((?:MACRO|MEMO|TYPED)?:[:]?)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`(M:[:]?)(\s+)(\S+)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass, Text, NameFunction), nil}, - {`(C:)(\s+)(\S+)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction, Text, NameClass), nil}, - {`(GENERIC:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction, Text, NameFunction), nil}, - {`\(\s`, NameFunction, Push("stackeffect")}, - {`;\s`, Keyword, nil}, - {`(USING:)(\s+)`, ByGroups(KeywordNamespace, Text), Push("vocabs")}, - {`(USE:|UNUSE:|IN:|QUALIFIED:)(\s+)(\S+)`, ByGroups(KeywordNamespace, Text, NameNamespace), nil}, - {`(QUALIFIED-WITH:)(\s+)(\S+)(\s+)(\S+)`, ByGroups(KeywordNamespace, Text, NameNamespace, Text, NameNamespace), nil}, - {`(FROM:|EXCLUDE:)(\s+)(\S+)(\s+=>\s)`, ByGroups(KeywordNamespace, Text, NameNamespace, Text), Push("words")}, - {`(RENAME:)(\s+)(\S+)(\s+)(\S+)(\s+=>\s+)(\S+)`, ByGroups(KeywordNamespace, Text, NameFunction, Text, NameNamespace, Text, NameFunction), nil}, - {`(ALIAS:|TYPEDEF:)(\s+)(\S+)(\s+)(\S+)`, ByGroups(KeywordNamespace, Text, NameFunction, Text, NameFunction), nil}, - {`(DEFER:|FORGET:|POSTPONE:)(\s+)(\S+)`, ByGroups(KeywordNamespace, Text, NameFunction), nil}, - {`(TUPLE:|ERROR:)(\s+)(\S+)(\s+<\s+)(\S+)`, ByGroups(Keyword, Text, NameClass, Text, NameClass), Push("slots")}, - {`(TUPLE:|ERROR:|BUILTIN:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass), Push("slots")}, - {`(MIXIN:|UNION:|INTERSECTION:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass), nil}, - {`(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)`, ByGroups(Keyword, Text, NameClass, Text, NameClass), nil}, - {`(C:)(\s+)(\S+)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction, Text, NameClass), nil}, - {`(INSTANCE:)(\s+)(\S+)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass, Text, NameClass), nil}, - {`(SLOT:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`(SINGLETON:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass), nil}, - {`SINGLETONS:`, Keyword, Push("classes")}, - {`(CONSTANT:|SYMBOL:|MAIN:|HELP:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameFunction), nil}, - {`SYMBOLS:\s`, Keyword, Push("words")}, - {`SYNTAX:\s`, Keyword, nil}, - {`ALIEN:\s`, Keyword, nil}, - {`(STRUCT:)(\s+)(\S+)`, ByGroups(Keyword, Text, NameClass), nil}, - {`(FUNCTION:)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)`, ByGroups(KeywordNamespace, Text, NameFunction, Text), nil}, - {`(FUNCTION-ALIAS:)(\s+)(\S+)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)`, ByGroups(KeywordNamespace, Text, NameFunction, Text, NameFunction, Text), nil}, - {`(?:)\s`, KeywordNamespace, nil}, - {`"""\s+(?:.|\n)*?\s+"""`, LiteralString, nil}, - {`"(?:\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`\S+"\s+(?:\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`CHAR:\s+(?:\\[\\abfnrstv]|[^\\]\S*)\s`, LiteralStringChar, nil}, - {`!\s+.*$`, Comment, nil}, - {`#!\s+.*$`, Comment, nil}, - {`/\*\s+(?:.|\n)*?\s\*/\s`, Comment, nil}, - {`[tf]\s`, NameConstant, nil}, - {`[\\$]\s+\S+`, NameConstant, nil}, - {`M\\\s+\S+\s+\S+`, NameConstant, nil}, - {`[+-]?(?:[\d,]*\d)?\.(?:\d([\d,]*\d)?)?(?:[eE][+-]?\d+)?\s`, LiteralNumber, nil}, - {`[+-]?\d(?:[\d,]*\d)?(?:[eE][+-]?\d+)?\s`, LiteralNumber, nil}, - {`0x[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s`, LiteralNumber, nil}, - {`NAN:\s+[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s`, LiteralNumber, nil}, - {`0b[01]+\s`, LiteralNumberBin, nil}, - {`0o[0-7]+\s`, LiteralNumberOct, nil}, - {`(?:\d([\d,]*\d)?)?\+\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s`, LiteralNumber, nil}, - {`(?:\-\d([\d,]*\d)?)?\-\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s`, LiteralNumber, nil}, - {`(?:deprecated|final|foldable|flushable|inline|recursive)\s`, Keyword, nil}, - {Words(``, `\s`, `-rot`, `2bi`, `2bi@`, `2bi*`, `2curry`, `2dip`, `2drop`, `2dup`, `2keep`, `2nip`, `2over`, `2tri`, `2tri@`, `2tri*`, `3bi`, `3curry`, `3dip`, `3drop`, `3dup`, `3keep`, `3tri`, `4dip`, `4drop`, `4dup`, `4keep`, ``, `=`, `>boolean`, `clone`, `?`, `?execute`, `?if`, `and`, `assert`, `assert=`, `assert?`, `bi`, `bi-curry`, `bi-curry@`, `bi-curry*`, `bi@`, `bi*`, `boa`, `boolean`, `boolean?`, `both?`, `build`, `call`, `callstack`, `callstack>array`, `callstack?`, `clear`, `(clone)`, `compose`, `compose?`, `curry`, `curry?`, `datastack`, `die`, `dip`, `do`, `drop`, `dup`, `dupd`, `either?`, `eq?`, `equal?`, `execute`, `hashcode`, `hashcode*`, `identity-hashcode`, `identity-tuple`, `identity-tuple?`, `if`, `if*`, `keep`, `loop`, `most`, `new`, `nip`, `not`, `null`, `object`, `or`, `over`, `pick`, `prepose`, `retainstack`, `rot`, `same?`, `swap`, `swapd`, `throw`, `tri`, `tri-curry`, `tri-curry@`, `tri-curry*`, `tri@`, `tri*`, `tuple`, `tuple?`, `unless`, `unless*`, `until`, `when`, `when*`, `while`, `with`, `wrapper`, `wrapper?`, `xor`), NameBuiltin, nil}, - {Words(``, `\s`, `2cache`, ``, `>alist`, `?at`, `?of`, `assoc`, `assoc-all?`, `assoc-any?`, `assoc-clone-like`, `assoc-combine`, `assoc-diff`, `assoc-diff!`, `assoc-differ`, `assoc-each`, `assoc-empty?`, `assoc-filter`, `assoc-filter!`, `assoc-filter-as`, `assoc-find`, `assoc-hashcode`, `assoc-intersect`, `assoc-like`, `assoc-map`, `assoc-map-as`, `assoc-partition`, `assoc-refine`, `assoc-size`, `assoc-stack`, `assoc-subset?`, `assoc-union`, `assoc-union!`, `assoc=`, `assoc>map`, `assoc?`, `at`, `at+`, `at*`, `cache`, `change-at`, `clear-assoc`, `delete-at`, `delete-at*`, `enum`, `enum?`, `extract-keys`, `inc-at`, `key?`, `keys`, `map>assoc`, `maybe-set-at`, `new-assoc`, `of`, `push-at`, `rename-at`, `set-at`, `sift-keys`, `sift-values`, `substitute`, `unzip`, `value-at`, `value-at*`, `value?`, `values`, `zip`), NameBuiltin, nil}, - {Words(``, `\s`, `2cleave`, `2cleave>quot`, `3cleave`, `3cleave>quot`, `4cleave`, `4cleave>quot`, `alist>quot`, `call-effect`, `case`, `case-find`, `case>quot`, `cleave`, `cleave>quot`, `cond`, `cond>quot`, `deep-spread>quot`, `execute-effect`, `linear-case-quot`, `no-case`, `no-case?`, `no-cond`, `no-cond?`, `recursive-hashcode`, `shallow-spread>quot`, `spread`, `to-fixed-point`, `wrong-values`, `wrong-values?`), NameBuiltin, nil}, - {Words(``, `\s`, `-`, `/`, `/f`, `/i`, `/mod`, `2/`, `2^`, `<`, `<=`, ``, `>`, `>=`, `>bignum`, `>fixnum`, `>float`, `>integer`, `(all-integers?)`, `(each-integer)`, `(find-integer)`, `*`, `+`, `?1+`, `abs`, `align`, `all-integers?`, `bignum`, `bignum?`, `bit?`, `bitand`, `bitnot`, `bitor`, `bits>double`, `bits>float`, `bitxor`, `complex`, `complex?`, `denominator`, `double>bits`, `each-integer`, `even?`, `find-integer`, `find-last-integer`, `fixnum`, `fixnum?`, `float`, `float>bits`, `float?`, `fp-bitwise=`, `fp-infinity?`, `fp-nan-payload`, `fp-nan?`, `fp-qnan?`, `fp-sign`, `fp-snan?`, `fp-special?`, `if-zero`, `imaginary-part`, `integer`, `integer>fixnum`, `integer>fixnum-strict`, `integer?`, `log2`, `log2-expects-positive`, `log2-expects-positive?`, `mod`, `neg`, `neg?`, `next-float`, `next-power-of-2`, `number`, `number=`, `number?`, `numerator`, `odd?`, `out-of-fixnum-range`, `out-of-fixnum-range?`, `power-of-2?`, `prev-float`, `ratio`, `ratio?`, `rational`, `rational?`, `real`, `real-part`, `real?`, `recip`, `rem`, `sgn`, `shift`, `sq`, `times`, `u<`, `u<=`, `u>`, `u>=`, `unless-zero`, `unordered?`, `when-zero`, `zero?`), NameBuiltin, nil}, - {Words(``, `\s`, `1sequence`, `2all?`, `2each`, `2map`, `2map-as`, `2map-reduce`, `2reduce`, `2selector`, `2sequence`, `3append`, `3append-as`, `3each`, `3map`, `3map-as`, `3sequence`, `4sequence`, ``, ``, ``, `?first`, `?last`, `?nth`, `?second`, `?set-nth`, `accumulate`, `accumulate!`, `accumulate-as`, `all?`, `any?`, `append`, `append!`, `append-as`, `assert-sequence`, `assert-sequence=`, `assert-sequence?`, `binary-reduce`, `bounds-check`, `bounds-check?`, `bounds-error`, `bounds-error?`, `but-last`, `but-last-slice`, `cartesian-each`, `cartesian-map`, `cartesian-product`, `change-nth`, `check-slice`, `check-slice-error`, `clone-like`, `collapse-slice`, `collector`, `collector-for`, `concat`, `concat-as`, `copy`, `count`, `cut`, `cut-slice`, `cut*`, `delete-all`, `delete-slice`, `drop-prefix`, `each`, `each-from`, `each-index`, `empty?`, `exchange`, `filter`, `filter!`, `filter-as`, `find`, `find-from`, `find-index`, `find-index-from`, `find-last`, `find-last-from`, `first`, `first2`, `first3`, `first4`, `flip`, `follow`, `fourth`, `glue`, `halves`, `harvest`, `head`, `head-slice`, `head-slice*`, `head*`, `head?`, `if-empty`, `immutable`, `immutable-sequence`, `immutable-sequence?`, `immutable?`, `index`, `index-from`, `indices`, `infimum`, `infimum-by`, `insert-nth`, `interleave`, `iota`, `iota-tuple`, `iota-tuple?`, `join`, `join-as`, `last`, `last-index`, `last-index-from`, `length`, `lengthen`, `like`, `longer`, `longer?`, `longest`, `map`, `map!`, `map-as`, `map-find`, `map-find-last`, `map-index`, `map-integers`, `map-reduce`, `map-sum`, `max-length`, `member-eq?`, `member?`, `midpoint@`, `min-length`, `mismatch`, `move`, `new-like`, `new-resizable`, `new-sequence`, `non-negative-integer-expected`, `non-negative-integer-expected?`, `nth`, `nths`, `pad-head`, `pad-tail`, `padding`, `partition`, `pop`, `pop*`, `prefix`, `prepend`, `prepend-as`, `produce`, `produce-as`, `product`, `push`, `push-all`, `push-either`, `push-if`, `reduce`, `reduce-index`, `remove`, `remove!`, `remove-eq`, `remove-eq!`, `remove-nth`, `remove-nth!`, `repetition`, `repetition?`, `replace-slice`, `replicate`, `replicate-as`, `rest`, `rest-slice`, `reverse`, `reverse!`, `reversed`, `reversed?`, `second`, `selector`, `selector-for`, `sequence`, `sequence-hashcode`, `sequence=`, `sequence?`, `set-first`, `set-fourth`, `set-last`, `set-length`, `set-nth`, `set-second`, `set-third`, `short`, `shorten`, `shorter`, `shorter?`, `shortest`, `sift`, `slice`, `slice-error`, `slice-error?`, `slice?`, `snip`, `snip-slice`, `start`, `start*`, `subseq`, `subseq?`, `suffix`, `suffix!`, `sum`, `sum-lengths`, `supremum`, `supremum-by`, `surround`, `tail`, `tail-slice`, `tail-slice*`, `tail*`, `tail?`, `third`, `trim`, `trim-head`, `trim-head-slice`, `trim-slice`, `trim-tail`, `trim-tail-slice`, `unclip`, `unclip-last`, `unclip-last-slice`, `unclip-slice`, `unless-empty`, `virtual-exemplar`, `virtual-sequence`, `virtual-sequence?`, `virtual@`, `when-empty`), NameBuiltin, nil}, - {Words(``, `\s`, `+@`, `change`, `change-global`, `counter`, `dec`, `get`, `get-global`, `global`, `inc`, `init-namespaces`, `initialize`, `is-global`, `make-assoc`, `namespace`, `namestack`, `off`, `on`, `set`, `set-global`, `set-namestack`, `toggle`, `with-global`, `with-scope`, `with-variable`, `with-variables`), NameBuiltin, nil}, - {Words(``, `\s`, `1array`, `2array`, `3array`, `4array`, ``, `>array`, `array`, `array?`, `pair`, `pair?`, `resize-array`), NameBuiltin, nil}, - {Words(``, `\s`, `(each-stream-block-slice)`, `(each-stream-block)`, `(stream-contents-by-block)`, `(stream-contents-by-element)`, `(stream-contents-by-length-or-block)`, `(stream-contents-by-length)`, `+byte+`, `+character+`, `bad-seek-type`, `bad-seek-type?`, `bl`, `contents`, `each-block`, `each-block-size`, `each-block-slice`, `each-line`, `each-morsel`, `each-stream-block`, `each-stream-block-slice`, `each-stream-line`, `error-stream`, `flush`, `input-stream`, `input-stream?`, `invalid-read-buffer`, `invalid-read-buffer?`, `lines`, `nl`, `output-stream`, `output-stream?`, `print`, `read`, `read-into`, `read-partial`, `read-partial-into`, `read-until`, `read1`, `readln`, `seek-absolute`, `seek-absolute?`, `seek-end`, `seek-end?`, `seek-input`, `seek-output`, `seek-relative`, `seek-relative?`, `stream-bl`, `stream-contents`, `stream-contents*`, `stream-copy`, `stream-copy*`, `stream-element-type`, `stream-flush`, `stream-length`, `stream-lines`, `stream-nl`, `stream-print`, `stream-read`, `stream-read-into`, `stream-read-partial`, `stream-read-partial-into`, `stream-read-partial-unsafe`, `stream-read-unsafe`, `stream-read-until`, `stream-read1`, `stream-readln`, `stream-seek`, `stream-seekable?`, `stream-tell`, `stream-write`, `stream-write1`, `tell-input`, `tell-output`, `with-error-stream`, `with-error-stream*`, `with-error>output`, `with-input-output+error-streams`, `with-input-output+error-streams*`, `with-input-stream`, `with-input-stream*`, `with-output-stream`, `with-output-stream*`, `with-output>error`, `with-output+error-stream`, `with-output+error-stream*`, `with-streams`, `with-streams*`, `write`, `write1`), NameBuiltin, nil}, - {Words(``, `\s`, `1string`, ``, `>string`, `resize-string`, `string`, `string?`), NameBuiltin, nil}, - {Words(``, `\s`, `1vector`, ``, `>vector`, `?push`, `vector`, `vector?`), NameBuiltin, nil}, - {Words(``, `\s`, ``, ``, ``, `attempt-all`, `attempt-all-error`, `attempt-all-error?`, `callback-error-hook`, `callcc0`, `callcc1`, `cleanup`, `compute-restarts`, `condition`, `condition?`, `continuation`, `continuation?`, `continue`, `continue-restart`, `continue-with`, `current-continuation`, `error`, `error-continuation`, `error-in-thread`, `error-thread`, `ifcc`, `ignore-errors`, `in-callback?`, `original-error`, `recover`, `restart`, `restart?`, `restarts`, `rethrow`, `rethrow-restarts`, `return`, `return-continuation`, `thread-error-hook`, `throw-continue`, `throw-restarts`, `with-datastack`, `with-return`), NameBuiltin, nil}, - {`\S+`, Text, nil}, - }, - "stackeffect": { - {`\s+`, Text, nil}, - {`\(\s+`, NameFunction, Push("stackeffect")}, - {`\)\s`, NameFunction, Pop(1)}, - {`--\s`, NameFunction, nil}, - {`\S+`, NameVariable, nil}, - }, - "slots": { - {`\s+`, Text, nil}, - {`;\s`, Keyword, Pop(1)}, - {`(\{\s+)(\S+)(\s+[^}]+\s+\}\s)`, ByGroups(Text, NameVariable, Text), nil}, - {`\S+`, NameVariable, nil}, - }, - "vocabs": { - {`\s+`, Text, nil}, - {`;\s`, Keyword, Pop(1)}, - {`\S+`, NameNamespace, nil}, - }, - "classes": { - {`\s+`, Text, nil}, - {`;\s`, Keyword, Pop(1)}, - {`\S+`, NameClass, nil}, - }, - "words": { - {`\s+`, Text, nil}, - {`;\s`, Keyword, Pop(1)}, - {`\S+`, NameFunction, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/f/fish.go b/vendor/github.com/alecthomas/chroma/lexers/f/fish.go deleted file mode 100644 index 185fc92b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/f/fish.go +++ /dev/null @@ -1,65 +0,0 @@ -package f - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Fish lexer. -var Fish = internal.Register(MustNewLexer( - &Config{ - Name: "Fish", - Aliases: []string{"fish", "fishshell"}, - Filenames: []string{"*.fish", "*.load"}, - MimeTypes: []string{"application/x-fish"}, - }, - Rules{ - "root": { - Include("basic"), - Include("data"), - Include("interp"), - }, - "interp": { - {`\$\(\(`, Keyword, Push("math")}, - {`\(`, Keyword, Push("paren")}, - {`\$#?(\w+|.)`, NameVariable, nil}, - }, - "basic": { - {`\b(begin|end|if|else|while|break|for|in|return|function|block|case|continue|switch|not|and|or|set|echo|exit|pwd|true|false|cd|count|test)(\s*)\b`, ByGroups(Keyword, Text), nil}, - {`\b(alias|bg|bind|breakpoint|builtin|command|commandline|complete|contains|dirh|dirs|emit|eval|exec|fg|fish|fish_config|fish_indent|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|isatty|jobs|math|mimedb|nextd|open|popd|prevd|psub|pushd|random|read|set_color|source|status|trap|type|ulimit|umask|vared|fc|getopts|hash|kill|printf|time|wait)\s*\b(?!\.)`, NameBuiltin, nil}, - {`#.*\n`, Comment, nil}, - {`\\[\w\W]`, LiteralStringEscape, nil}, - {`(\b\w+)(\s*)(=)`, ByGroups(NameVariable, Text, Operator), nil}, - {`[\[\]()=]`, Operator, nil}, - {`<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2`, LiteralString, nil}, - }, - "data": { - {`(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'`, LiteralStringSingle, nil}, - {`(?s)'.*?'`, LiteralStringSingle, nil}, - {`;`, Punctuation, nil}, - {`&|\||\^|<|>`, Operator, nil}, - {`\s+`, Text, nil}, - {`\d+(?= |\Z)`, LiteralNumber, nil}, - {"[^=\\s\\[\\]{}()$\"\\'`\\\\<&|;]+", Text, nil}, - }, - "string": { - {`"`, LiteralStringDouble, Pop(1)}, - {`(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+`, LiteralStringDouble, nil}, - Include("interp"), - }, - "paren": { - {`\)`, Keyword, Pop(1)}, - Include("root"), - }, - "math": { - {`\)\)`, Keyword, Pop(1)}, - {`[-+*/%^|&]|\*\*|\|\|`, Operator, nil}, - {`\d+#\d+`, LiteralNumber, nil}, - {`\d+#(?! )`, LiteralNumber, nil}, - {`\d+`, LiteralNumber, nil}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/f/forth.go b/vendor/github.com/alecthomas/chroma/lexers/f/forth.go deleted file mode 100644 index 47de6365..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/f/forth.go +++ /dev/null @@ -1,40 +0,0 @@ -package f - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Forth lexer. -var Forth = internal.Register(MustNewLexer( - &Config{ - Name: "Forth", - Aliases: []string{"forth"}, - Filenames: []string{"*.frt", "*.fth", "*.fs"}, - MimeTypes: []string{"application/x-forth"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`\\.*?\n`, CommentSingle, nil}, - {`\([\s].*?\)`, CommentSingle, nil}, - {`(:|variable|constant|value|buffer:)(\s+)`, ByGroups(KeywordNamespace, Text), Push("worddef")}, - {`([.sc]")(\s+?)`, ByGroups(LiteralString, Text), Push("stringdef")}, - {`(blk|block|buffer|evaluate|flush|load|save-buffers|update|empty-buffers|list|refill|scr|thru|\#s|\*\/mod|\+loop|\/mod|0<|0=|1\+|1-|2!|2\*|2\/|2@|2drop|2dup|2over|2swap|>body|>in|>number|>r|\?dup|abort|abort\"|abs|accept|align|aligned|allot|and|base|begin|bl|c!|c,|c@|cell\+|cells|char|char\+|chars|constant|count|cr|create|decimal|depth|do|does>|drop|dup|else|emit|environment\?|evaluate|execute|exit|fill|find|fm\/mod|here|hold|i|if|immediate|invert|j|key|leave|literal|loop|lshift|m\*|max|min|mod|move|negate|or|over|postpone|quit|r>|r@|recurse|repeat|rot|rshift|s\"|s>d|sign|sm\/rem|source|space|spaces|state|swap|then|type|u\.|u\<|um\*|um\/mod|unloop|until|variable|while|word|xor|\[char\]|\[\'\]|@|!|\#|<\#|\#>|:|;|\+|-|\*|\/|,|<|>|\|1\+|1-|\.|\.r|0<>|0>|2>r|2r>|2r@|:noname|\?do|again|c\"|case|compile,|endcase|endof|erase|false|hex|marker|nip|of|pad|parse|pick|refill|restore-input|roll|save-input|source-id|to|true|tuck|u\.r|u>|unused|value|within|\[compile\]|\#tib|convert|expect|query|span|tib|2constant|2literal|2variable|d\+|d-|d\.|d\.r|d0<|d0=|d2\*|d2\/|d<|d=|d>s|dabs|dmax|dmin|dnegate|m\*\/|m\+|2rot|du<|catch|throw|abort|abort\"|at-xy|key\?|page|ekey|ekey>char|ekey\?|emit\?|ms|time&date|BIN|CLOSE-FILE|CREATE-FILE|DELETE-FILE|FILE-POSITION|FILE-SIZE|INCLUDE-FILE|INCLUDED|OPEN-FILE|R\/O|R\/W|READ-FILE|READ-LINE|REPOSITION-FILE|RESIZE-FILE|S\"|SOURCE-ID|W/O|WRITE-FILE|WRITE-LINE|FILE-STATUS|FLUSH-FILE|REFILL|RENAME-FILE|>float|d>f|f!|f\*|f\+|f-|f\/|f0<|f0=|f<|f>d|f@|falign|faligned|fconstant|fdepth|fdrop|fdup|fliteral|float\+|floats|floor|fmax|fmin|fnegate|fover|frot|fround|fswap|fvariable|represent|df!|df@|dfalign|dfaligned|dfloat\+|dfloats|f\*\*|f\.|fabs|facos|facosh|falog|fasin|fasinh|fatan|fatan2|fatanh|fcos|fcosh|fe\.|fexp|fexpm1|fln|flnp1|flog|fs\.|fsin|fsincos|fsinh|fsqrt|ftan|ftanh|f~|precision|set-precision|sf!|sf@|sfalign|sfaligned|sfloat\+|sfloats|\(local\)|to|locals\||allocate|free|resize|definitions|find|forth-wordlist|get-current|get-order|search-wordlist|set-current|set-order|wordlist|also|forth|only|order|previous|-trailing|\/string|blank|cmove|cmove>|compare|search|sliteral|.s|dump|see|words|;code|ahead|assembler|bye|code|cs-pick|cs-roll|editor|state|\[else\]|\[if\]|\[then\]|forget|defer|defer@|defer!|action-of|begin-structure|field:|buffer:|parse-name|buffer:|traverse-wordlist|n>r|nr>|2value|fvalue|name>interpret|name>compile|name>string|cfield:|end-structure)\s`, Keyword, nil}, - {`(\$[0-9A-F]+)`, LiteralNumberHex, nil}, - {`(\#|%|&|\-|\+)?[0-9]+`, LiteralNumberInteger, nil}, - {`(\#|%|&|\-|\+)?[0-9.]+`, KeywordType, nil}, - {`(@i|!i|@e|!e|pause|noop|turnkey|sleep|itype|icompare|sp@|sp!|rp@|rp!|up@|up!|>a|a>|a@|a!|a@+|a@-|>b|b>|b@|b!|b@+|b@-|find-name|1ms|sp0|rp0|\(evaluate\)|int-trap|int!)\s`, NameConstant, nil}, - {`(do-recognizer|r:fail|recognizer:|get-recognizers|set-recognizers|r:float|r>comp|r>int|r>post|r:name|r:word|r:dnum|r:num|recognizer|forth-recognizer|rec:num|rec:float|rec:word)\s`, NameDecorator, nil}, - {`(Evalue|Rvalue|Uvalue|Edefer|Rdefer|Udefer)(\s+)`, ByGroups(KeywordNamespace, Text), Push("worddef")}, - {`[^\s]+(?=[\s])`, NameFunction, nil}, - }, - "worddef": { - {`\S+`, NameClass, Pop(1)}, - }, - "stringdef": { - {`[^"]+`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/f/fortran.go b/vendor/github.com/alecthomas/chroma/lexers/f/fortran.go deleted file mode 100644 index 6c57afa6..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/f/fortran.go +++ /dev/null @@ -1,47 +0,0 @@ -package f - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Fortran lexer. -var Fortran = internal.Register(MustNewLexer( - &Config{ - Name: "Fortran", - Aliases: []string{"fortran"}, - Filenames: []string{"*.f03", "*.f90", "*.F03", "*.F90"}, - MimeTypes: []string{"text/x-fortran"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`^#.*\n`, CommentPreproc, nil}, - {`!.*\n`, Comment, nil}, - Include("strings"), - Include("core"), - {`[a-z][\w$]*`, Name, nil}, - Include("nums"), - {`[\s]+`, Text, nil}, - }, - "core": { - {Words(`\b`, `\s*\b`, `ABSTRACT`, `ACCEPT`, `ALL`, `ALLSTOP`, `ALLOCATABLE`, `ALLOCATE`, `ARRAY`, `ASSIGN`, `ASSOCIATE`, `ASYNCHRONOUS`, `BACKSPACE`, `BIND`, `BLOCK`, `BLOCKDATA`, `BYTE`, `CALL`, `CASE`, `CLASS`, `CLOSE`, `CODIMENSION`, `COMMON`, `CONCURRRENT`, `CONTIGUOUS`, `CONTAINS`, `CONTINUE`, `CRITICAL`, `CYCLE`, `DATA`, `DEALLOCATE`, `DECODE`, `DEFERRED`, `DIMENSION`, `DO`, `ELEMENTAL`, `ELSE`, `ENCODE`, `END`, `ENTRY`, `ENUM`, `ENUMERATOR`, `EQUIVALENCE`, `EXIT`, `EXTENDS`, `EXTERNAL`, `EXTRINSIC`, `FILE`, `FINAL`, `FORALL`, `FORMAT`, `FUNCTION`, `GENERIC`, `GOTO`, `IF`, `IMAGES`, `IMPLICIT`, `IMPORT`, `IMPURE`, `INCLUDE`, `INQUIRE`, `INTENT`, `INTERFACE`, `INTRINSIC`, `IS`, `LOCK`, `MEMORY`, `MODULE`, `NAMELIST`, `NULLIFY`, `NONE`, `NON_INTRINSIC`, `NON_OVERRIDABLE`, `NOPASS`, `OPEN`, `OPTIONAL`, `OPTIONS`, `PARAMETER`, `PASS`, `PAUSE`, `POINTER`, `PRINT`, `PRIVATE`, `PROGRAM`, `PROCEDURE`, `PROTECTED`, `PUBLIC`, `PURE`, `READ`, `RECURSIVE`, `RESULT`, `RETURN`, `REWIND`, `SAVE`, `SELECT`, `SEQUENCE`, `STOP`, `SUBMODULE`, `SUBROUTINE`, `SYNC`, `SYNCALL`, `SYNCIMAGES`, `SYNCMEMORY`, `TARGET`, `THEN`, `TYPE`, `UNLOCK`, `USE`, `VALUE`, `VOLATILE`, `WHERE`, `WRITE`, `WHILE`), Keyword, nil}, - {Words(`\b`, `\s*\b`, `CHARACTER`, `COMPLEX`, `DOUBLE PRECISION`, `DOUBLE COMPLEX`, `INTEGER`, `LOGICAL`, `REAL`, `C_INT`, `C_SHORT`, `C_LONG`, `C_LONG_LONG`, `C_SIGNED_CHAR`, `C_SIZE_T`, `C_INT8_T`, `C_INT16_T`, `C_INT32_T`, `C_INT64_T`, `C_INT_LEAST8_T`, `C_INT_LEAST16_T`, `C_INT_LEAST32_T`, `C_INT_LEAST64_T`, `C_INT_FAST8_T`, `C_INT_FAST16_T`, `C_INT_FAST32_T`, `C_INT_FAST64_T`, `C_INTMAX_T`, `C_INTPTR_T`, `C_FLOAT`, `C_DOUBLE`, `C_LONG_DOUBLE`, `C_FLOAT_COMPLEX`, `C_DOUBLE_COMPLEX`, `C_LONG_DOUBLE_COMPLEX`, `C_BOOL`, `C_CHAR`, `C_PTR`, `C_FUNPTR`), KeywordType, nil}, - {`(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)`, Operator, nil}, - {`(::)`, KeywordDeclaration, nil}, - {`[()\[\],:&%;.]`, Punctuation, nil}, - {Words(`\b`, `\s*\b`, `Abort`, `Abs`, `Access`, `AChar`, `ACos`, `ACosH`, `AdjustL`, `AdjustR`, `AImag`, `AInt`, `Alarm`, `All`, `Allocated`, `ALog`, `AMax`, `AMin`, `AMod`, `And`, `ANInt`, `Any`, `ASin`, `ASinH`, `Associated`, `ATan`, `ATanH`, `Atomic_Define`, `Atomic_Ref`, `BesJ`, `BesJN`, `Bessel_J0`, `Bessel_J1`, `Bessel_JN`, `Bessel_Y0`, `Bessel_Y1`, `Bessel_YN`, `BesY`, `BesYN`, `BGE`, `BGT`, `BLE`, `BLT`, `Bit_Size`, `BTest`, `CAbs`, `CCos`, `Ceiling`, `CExp`, `Char`, `ChDir`, `ChMod`, `CLog`, `Cmplx`, `Command_Argument_Count`, `Complex`, `Conjg`, `Cos`, `CosH`, `Count`, `CPU_Time`, `CShift`, `CSin`, `CSqRt`, `CTime`, `C_Loc`, `C_Associated`, `C_Null_Ptr`, `C_Null_Funptr`, `C_F_Pointer`, `C_F_ProcPointer`, `C_Null_Char`, `C_Alert`, `C_Backspace`, `C_Form_Feed`, `C_FunLoc`, `C_Sizeof`, `C_New_Line`, `C_Carriage_Return`, `C_Horizontal_Tab`, `C_Vertical_Tab`, `DAbs`, `DACos`, `DASin`, `DATan`, `Date_and_Time`, `DbesJ`, `DbesJN`, `DbesY`, `DbesYN`, `Dble`, `DCos`, `DCosH`, `DDiM`, `DErF`, `DErFC`, `DExp`, `Digits`, `DiM`, `DInt`, `DLog`, `DMax`, `DMin`, `DMod`, `DNInt`, `Dot_Product`, `DProd`, `DSign`, `DSinH`, `DShiftL`, `DShiftR`, `DSin`, `DSqRt`, `DTanH`, `DTan`, `DTime`, `EOShift`, `Epsilon`, `ErF`, `ErFC`, `ErFC_Scaled`, `ETime`, `Execute_Command_Line`, `Exit`, `Exp`, `Exponent`, `Extends_Type_Of`, `FDate`, `FGet`, `FGetC`, `FindLoc`, `Float`, `Floor`, `Flush`, `FNum`, `FPutC`, `FPut`, `Fraction`, `FSeek`, `FStat`, `FTell`, `Gamma`, `GError`, `GetArg`, `Get_Command`, `Get_Command_Argument`, `Get_Environment_Variable`, `GetCWD`, `GetEnv`, `GetGId`, `GetLog`, `GetPId`, `GetUId`, `GMTime`, `HostNm`, `Huge`, `Hypot`, `IAbs`, `IAChar`, `IAll`, `IAnd`, `IAny`, `IArgC`, `IBClr`, `IBits`, `IBSet`, `IChar`, `IDate`, `IDiM`, `IDInt`, `IDNInt`, `IEOr`, `IErrNo`, `IFix`, `Imag`, `ImagPart`, `Image_Index`, `Index`, `Int`, `IOr`, `IParity`, `IRand`, `IsaTty`, `IShft`, `IShftC`, `ISign`, `Iso_C_Binding`, `Is_Contiguous`, `Is_Iostat_End`, `Is_Iostat_Eor`, `ITime`, `Kill`, `Kind`, `LBound`, `LCoBound`, `Len`, `Len_Trim`, `LGe`, `LGt`, `Link`, `LLe`, `LLt`, `LnBlnk`, `Loc`, `Log`, `Log_Gamma`, `Logical`, `Long`, `LShift`, `LStat`, `LTime`, `MaskL`, `MaskR`, `MatMul`, `Max`, `MaxExponent`, `MaxLoc`, `MaxVal`, `MClock`, `Merge`, `Merge_Bits`, `Move_Alloc`, `Min`, `MinExponent`, `MinLoc`, `MinVal`, `Mod`, `Modulo`, `MvBits`, `Nearest`, `New_Line`, `NInt`, `Norm2`, `Not`, `Null`, `Num_Images`, `Or`, `Pack`, `Parity`, `PError`, `Precision`, `Present`, `Product`, `Radix`, `Rand`, `Random_Number`, `Random_Seed`, `Range`, `Real`, `RealPart`, `Rename`, `Repeat`, `Reshape`, `RRSpacing`, `RShift`, `Same_Type_As`, `Scale`, `Scan`, `Second`, `Selected_Char_Kind`, `Selected_Int_Kind`, `Selected_Real_Kind`, `Set_Exponent`, `Shape`, `ShiftA`, `ShiftL`, `ShiftR`, `Short`, `Sign`, `Signal`, `SinH`, `Sin`, `Sleep`, `Sngl`, `Spacing`, `Spread`, `SqRt`, `SRand`, `Stat`, `Storage_Size`, `Sum`, `SymLnk`, `System`, `System_Clock`, `Tan`, `TanH`, `Time`, `This_Image`, `Tiny`, `TrailZ`, `Transfer`, `Transpose`, `Trim`, `TtyNam`, `UBound`, `UCoBound`, `UMask`, `Unlink`, `Unpack`, `Verify`, `XOr`, `ZAbs`, `ZCos`, `ZExp`, `ZLog`, `ZSin`, `ZSqRt`), NameBuiltin, nil}, - {`\.(true|false)\.`, NameBuiltin, nil}, - {`\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.`, OperatorWord, nil}, - }, - "strings": { - {`(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"`, LiteralStringDouble, nil}, - {`(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'`, LiteralStringSingle, nil}, - }, - "nums": { - {`\d+(?![.e])(_[a-z]\w+)?`, LiteralNumberInteger, nil}, - {`[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?`, LiteralNumberFloat, nil}, - {`[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?`, LiteralNumberFloat, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/f/fsharp.go b/vendor/github.com/alecthomas/chroma/lexers/f/fsharp.go deleted file mode 100644 index d00f63dd..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/f/fsharp.go +++ /dev/null @@ -1,94 +0,0 @@ -package f - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Fsharp lexer. -var Fsharp = internal.Register(MustNewLexer( - &Config{ - Name: "FSharp", - Aliases: []string{"fsharp"}, - Filenames: []string{"*.fs", "*.fsi"}, - MimeTypes: []string{"text/x-fsharp"}, - }, - Rules{ - "escape-sequence": { - {`\\[\\"\'ntbrafv]`, LiteralStringEscape, nil}, - {`\\[0-9]{3}`, LiteralStringEscape, nil}, - {`\\u[0-9a-fA-F]{4}`, LiteralStringEscape, nil}, - {`\\U[0-9a-fA-F]{8}`, LiteralStringEscape, nil}, - }, - "root": { - {`\s+`, Text, nil}, - {`\(\)|\[\]`, NameBuiltinPseudo, nil}, - {`\b(?|-|\\.\\.|\\.|::|:=|:>|:|;;|;|<-|<\\]|<|>\\]|>|\\?\\?|\\?|\\[<|\\[\\||\\[|\\]|_|`|\\{|\\|\\]|\\||\\}|~|<@@|<@|=|@>|@@>)", Operator, nil}, - {`([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]`, Operator, nil}, - {`\b(and|or|not)\b`, OperatorWord, nil}, - {`\b(sbyte|byte|char|nativeint|unativeint|float32|single|float|double|int8|uint8|int16|uint16|int32|uint32|int64|uint64|decimal|unit|bool|string|list|exn|obj|enum)\b`, KeywordType, nil}, - {`#[ \t]*(if|endif|else|line|nowarn|light|\d+)\b.*?\n`, CommentPreproc, nil}, - {`[^\W\d][\w']*`, Name, nil}, - {`\d[\d_]*[uU]?[yslLnQRZINGmM]?`, LiteralNumberInteger, nil}, - {`0[xX][\da-fA-F][\da-fA-F_]*[uU]?[yslLn]?[fF]?`, LiteralNumberHex, nil}, - {`0[oO][0-7][0-7_]*[uU]?[yslLn]?`, LiteralNumberOct, nil}, - {`0[bB][01][01_]*[uU]?[yslLn]?`, LiteralNumberBin, nil}, - {`-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)[fFmM]?`, LiteralNumberFloat, nil}, - {`'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'B?`, LiteralStringChar, nil}, - {`'.'`, LiteralStringChar, nil}, - {`'`, Keyword, nil}, - {`@?"`, LiteralStringDouble, Push("string")}, - {`[~?][a-z][\w\']*:`, NameVariable, nil}, - }, - "dotted": { - {`\s+`, Text, nil}, - {`\.`, Punctuation, nil}, - {`[A-Z][\w\']*(?=\s*\.)`, NameNamespace, nil}, - {`[A-Z][\w\']*`, Name, Pop(1)}, - {`[a-z_][\w\']*`, Name, Pop(1)}, - Default(Pop(1)), - }, - "comment": { - {`[^(*)@"]+`, Comment, nil}, - {`\(\*`, Comment, Push()}, - {`\*\)`, Comment, Pop(1)}, - {`@"`, LiteralString, Push("lstring")}, - {`"""`, LiteralString, Push("tqs")}, - {`"`, LiteralString, Push("string")}, - {`[(*)@]`, Comment, nil}, - }, - "string": { - {`[^\\"]+`, LiteralString, nil}, - Include("escape-sequence"), - {`\\\n`, LiteralString, nil}, - {`\n`, LiteralString, nil}, - {`"B?`, LiteralString, Pop(1)}, - }, - "lstring": { - {`[^"]+`, LiteralString, nil}, - {`\n`, LiteralString, nil}, - {`""`, LiteralString, nil}, - {`"B?`, LiteralString, Pop(1)}, - }, - "tqs": { - {`[^"]+`, LiteralString, nil}, - {`\n`, LiteralString, nil}, - {`"""B?`, LiteralString, Pop(1)}, - {`"`, LiteralString, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/gas.go b/vendor/github.com/alecthomas/chroma/lexers/g/gas.go deleted file mode 100644 index a9228068..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/gas.go +++ /dev/null @@ -1,55 +0,0 @@ -package g - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Gas lexer. -var Gas = internal.Register(MustNewLexer( - &Config{ - Name: "GAS", - Aliases: []string{"gas", "asm"}, - Filenames: []string{"*.s", "*.S"}, - MimeTypes: []string{"text/x-gas"}, - }, - Rules{ - "root": { - Include("whitespace"), - {`(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+):`, NameLabel, nil}, - {`\.(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameAttribute, Push("directive-args")}, - {`lock|rep(n?z)?|data\d+`, NameAttribute, nil}, - {`(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameFunction, Push("instruction-args")}, - {`[\r\n]+`, Text, nil}, - }, - "directive-args": { - {`(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameConstant, nil}, - {`"(\\"|[^"])*"`, LiteralString, nil}, - {`@(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameAttribute, nil}, - {`(?:0[xX][a-zA-Z0-9]+|\d+)`, LiteralNumberInteger, nil}, - {`[\r\n]+`, Text, Pop(1)}, - Include("punctuation"), - Include("whitespace"), - }, - "instruction-args": { - {`([a-z0-9]+)( )(<)((?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+))(>)`, ByGroups(LiteralNumberHex, Text, Punctuation, NameConstant, Punctuation), nil}, - {`([a-z0-9]+)( )(<)((?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+))([-+])((?:0[xX][a-zA-Z0-9]+|\d+))(>)`, ByGroups(LiteralNumberHex, Text, Punctuation, NameConstant, Punctuation, LiteralNumberInteger, Punctuation), nil}, - {`(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameConstant, nil}, - {`(?:0[xX][a-zA-Z0-9]+|\d+)`, LiteralNumberInteger, nil}, - {`%(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)`, NameVariable, nil}, - {`$(?:0[xX][a-zA-Z0-9]+|\d+)`, LiteralNumberInteger, nil}, - {`$'(.|\\')'`, LiteralStringChar, nil}, - {`[\r\n]+`, Text, Pop(1)}, - Include("punctuation"), - Include("whitespace"), - }, - "whitespace": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`[;#].*?\n`, Comment, nil}, - }, - "punctuation": { - {`[-*,.()\[\]!:]+`, Punctuation, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/gdscript.go b/vendor/github.com/alecthomas/chroma/lexers/g/gdscript.go deleted file mode 100644 index bfe30637..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/gdscript.go +++ /dev/null @@ -1,124 +0,0 @@ -package g - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// GDScript lexer. -var GDScript = internal.Register(MustNewLexer( - &Config{ - Name: "GDScript", - Aliases: []string{"gdscript", "gd"}, - Filenames: []string{"*.gd"}, - MimeTypes: []string{"text/x-gdscript", "application/x-gdscript"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")`, ByGroups(Text, LiteralStringAffix, LiteralStringDoc), nil}, - {`^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')`, ByGroups(Text, LiteralStringAffix, LiteralStringDoc), nil}, - {`[^\S\n]+`, Text, nil}, - {`#.*$`, CommentSingle, nil}, - {`[]{}:(),;[]`, Punctuation, nil}, - {`\\\n`, Text, nil}, - {`\\`, Text, nil}, - {`(in|and|or|not)\b`, OperatorWord, nil}, - {`!=|==|<<|>>|&&|\+=|-=|\*=|/=|%=|&=|\|=|\|\||[-~+/*%=<>&^.!|$]`, Operator, nil}, - Include("keywords"), - {`(def)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("funcname")}, - {`(class)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("classname")}, - Include("builtins"), - {`([rR]|[uUbB][rR]|[rR][uUbB])(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("tdqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("tsqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("dqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("sqs")}, - {`([uUbB]?)(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "tdqs")}, - {`([uUbB]?)(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "tsqs")}, - {`([uUbB]?)(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "dqs")}, - {`([uUbB]?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "sqs")}, - Include("name"), - Include("numbers"), - }, - "keywords": { - {Words(``, `\b`, - `if`, `elif`, `else`, `for`, `do`, - `while`, `switch`, `case`, `break`, `continue`, - `pass`, `return`, `class`, `extends`, `tool`, - `signal`, `func`, `static`, `const`, `enum`, - `var`, `onready`, `export`, `setget`, `breakpoint`), Keyword, nil}, - }, - "builtins": { - {Words(`(?)`, ByGroups(CommentPreproc, Using(Python), CommentPreproc), nil}, - {`<\s*(script|style)\s*.*?>.*?<\s*/\1\s*>`, Other, nil}, - {`<\s*py:[a-zA-Z0-9]+`, NameTag, Push("pytag")}, - {`<\s*[a-zA-Z0-9:.]+`, NameTag, Push("tag")}, - Include("variable"), - {`[<$]`, Other, nil}, - }, - "pytag": { - {`\s+`, Text, nil}, - {`[\w:-]+\s*=`, NameAttribute, Push("pyattr")}, - {`/?\s*>`, NameTag, Pop(1)}, - }, - "pyattr": { - {`(")(.*?)(")`, ByGroups(LiteralString, Using(Python), LiteralString), Pop(1)}, - {`(')(.*?)(')`, ByGroups(LiteralString, Using(Python), LiteralString), Pop(1)}, - {`[^\s>]+`, LiteralString, Pop(1)}, - }, - "tag": { - {`\s+`, Text, nil}, - {`py:[\w-]+\s*=`, NameAttribute, Push("pyattr")}, - {`[\w:-]+\s*=`, NameAttribute, Push("attr")}, - {`/?\s*>`, NameTag, Pop(1)}, - }, - "attr": { - {`"`, LiteralString, Push("attr-dstring")}, - {`'`, LiteralString, Push("attr-sstring")}, - {`[^\s>]*`, LiteralString, Pop(1)}, - }, - "attr-dstring": { - {`"`, LiteralString, Pop(1)}, - Include("strings"), - {`'`, LiteralString, nil}, - }, - "attr-sstring": { - {`'`, LiteralString, Pop(1)}, - Include("strings"), - {`'`, LiteralString, nil}, - }, - "strings": { - {`[^"'$]+`, LiteralString, nil}, - Include("variable"), - }, - "variable": { - {`(?>|<=?|>=?|==?|&&?|\^|\|\|?`, Operator, nil}, - {`[?:]`, Operator, nil}, - {`\bdefined\b`, Operator, nil}, - {`[;{}(),\[\]]`, Punctuation, nil}, - {`[+-]?\d*\.\d+([eE][-+]?\d+)?`, LiteralNumberFloat, nil}, - {`[+-]?\d+\.\d*([eE][-+]?\d+)?`, LiteralNumberFloat, nil}, - {`0[xX][0-9a-fA-F]*`, LiteralNumberHex, nil}, - {`0[0-7]*`, LiteralNumberOct, nil}, - {`[1-9][0-9]*`, LiteralNumberInteger, nil}, - {Words(`\b`, `\b`, `attribute`, `const`, `uniform`, `varying`, `centroid`, `break`, `continue`, `do`, `for`, `while`, `if`, `else`, `in`, `out`, `inout`, `float`, `int`, `void`, `bool`, `true`, `false`, `invariant`, `discard`, `return`, `mat2`, `mat3mat4`, `mat2x2`, `mat3x2`, `mat4x2`, `mat2x3`, `mat3x3`, `mat4x3`, `mat2x4`, `mat3x4`, `mat4x4`, `vec2`, `vec3`, `vec4`, `ivec2`, `ivec3`, `ivec4`, `bvec2`, `bvec3`, `bvec4`, `sampler1D`, `sampler2D`, `sampler3DsamplerCube`, `sampler1DShadow`, `sampler2DShadow`, `struct`), Keyword, nil}, - {Words(`\b`, `\b`, `asm`, `class`, `union`, `enum`, `typedef`, `template`, `this`, `packed`, `goto`, `switch`, `default`, `inline`, `noinline`, `volatile`, `public`, `static`, `extern`, `external`, `interface`, `long`, `short`, `double`, `half`, `fixed`, `unsigned`, `lowp`, `mediump`, `highp`, `precision`, `input`, `output`, `hvec2`, `hvec3`, `hvec4`, `dvec2`, `dvec3`, `dvec4`, `fvec2`, `fvec3`, `fvec4`, `sampler2DRect`, `sampler3DRect`, `sampler2DRectShadow`, `sizeof`, `cast`, `namespace`, `using`), Keyword, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - {`\.`, Punctuation, nil}, - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/gnuplot.go b/vendor/github.com/alecthomas/chroma/lexers/g/gnuplot.go deleted file mode 100644 index 77c6363c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/gnuplot.go +++ /dev/null @@ -1,117 +0,0 @@ -package g - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Gnuplot lexer. -var Gnuplot = internal.Register(MustNewLexer( - &Config{ - Name: "Gnuplot", - Aliases: []string{"gnuplot"}, - Filenames: []string{"*.plot", "*.plt"}, - MimeTypes: []string{"text/x-gnuplot"}, - }, - Rules{ - "root": { - Include("whitespace"), - {`bind\b|bin\b|bi\b`, Keyword, Push("bind")}, - {`exit\b|exi\b|ex\b|quit\b|qui\b|qu\b|q\b`, Keyword, Push("quit")}, - {`fit\b|fi\b|f\b`, Keyword, Push("fit")}, - {`(if)(\s*)(\()`, ByGroups(Keyword, Text, Punctuation), Push("if")}, - {`else\b`, Keyword, nil}, - {`pause\b|paus\b|pau\b|pa\b`, Keyword, Push("pause")}, - {`plot\b|plo\b|pl\b|p\b|replot\b|replo\b|repl\b|rep\b|splot\b|splo\b|spl\b|sp\b`, Keyword, Push("plot")}, - {`save\b|sav\b|sa\b`, Keyword, Push("save")}, - {`set\b|se\b`, Keyword, Push("genericargs", "optionarg")}, - {`show\b|sho\b|sh\b|unset\b|unse\b|uns\b`, Keyword, Push("noargs", "optionarg")}, - {`lower\b|lowe\b|low\b|raise\b|rais\b|rai\b|ra\b|call\b|cal\b|ca\b|cd\b|clear\b|clea\b|cle\b|cl\b|help\b|hel\b|he\b|h\b|\?\b|history\b|histor\b|histo\b|hist\b|his\b|hi\b|load\b|loa\b|lo\b|l\b|print\b|prin\b|pri\b|pr\b|pwd\b|reread\b|rerea\b|rere\b|rer\b|re\b|reset\b|rese\b|res\b|screendump\b|screendum\b|screendu\b|screend\b|screen\b|scree\b|scre\b|scr\b|shell\b|shel\b|she\b|system\b|syste\b|syst\b|sys\b|sy\b|update\b|updat\b|upda\b|upd\b|up\b`, Keyword, Push("genericargs")}, - {`pwd\b|reread\b|rerea\b|rere\b|rer\b|re\b|reset\b|rese\b|res\b|screendump\b|screendum\b|screendu\b|screend\b|screen\b|scree\b|scre\b|scr\b|shell\b|shel\b|she\b|test\b`, Keyword, Push("noargs")}, - {`([a-zA-Z_]\w*)(\s*)(=)`, ByGroups(NameVariable, Text, Operator), Push("genericargs")}, - {`([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)`, ByGroups(NameFunction, Text, Operator), Push("genericargs")}, - {`@[a-zA-Z_]\w*`, NameConstant, nil}, - {`;`, Keyword, nil}, - }, - "comment": { - {`[^\\\n]`, Comment, nil}, - {`\\\n`, Comment, nil}, - {`\\`, Comment, nil}, - Default(Pop(1)), - }, - "whitespace": { - {`#`, Comment, Push("comment")}, - {`[ \t\v\f]+`, Text, nil}, - }, - "noargs": { - Include("whitespace"), - {`;`, Punctuation, Pop(1)}, - {`\n`, Text, Pop(1)}, - }, - "dqstring": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - {`\n`, LiteralString, Pop(1)}, - }, - "sqstring": { - {`''`, LiteralString, nil}, - {`'`, LiteralString, Pop(1)}, - {`[^\\'\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - {`\n`, LiteralString, Pop(1)}, - }, - "genericargs": { - Include("noargs"), - {`"`, LiteralString, Push("dqstring")}, - {`'`, LiteralString, Push("sqstring")}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+)`, LiteralNumberFloat, nil}, - {`-?\d+`, LiteralNumberInteger, nil}, - {`[,.~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[{}()\[\]]`, Punctuation, nil}, - {`(eq|ne)\b`, OperatorWord, nil}, - {`([a-zA-Z_]\w*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - {`@[a-zA-Z_]\w*`, NameConstant, nil}, - {`\\\n`, Text, nil}, - }, - "optionarg": { - Include("whitespace"), - {`all\b|al\b|a\b|angles\b|angle\b|angl\b|ang\b|an\b|arrow\b|arro\b|arr\b|ar\b|autoscale\b|autoscal\b|autosca\b|autosc\b|autos\b|auto\b|aut\b|au\b|bars\b|bar\b|ba\b|b\b|border\b|borde\b|bord\b|bor\b|boxwidth\b|boxwidt\b|boxwid\b|boxwi\b|boxw\b|box\b|clabel\b|clabe\b|clab\b|cla\b|cl\b|clip\b|cli\b|cl\b|c\b|cntrparam\b|cntrpara\b|cntrpar\b|cntrpa\b|cntrp\b|cntr\b|cnt\b|cn\b|contour\b|contou\b|conto\b|cont\b|con\b|co\b|data\b|dat\b|da\b|datafile\b|datafil\b|datafi\b|dataf\b|data\b|dgrid3d\b|dgrid3\b|dgrid\b|dgri\b|dgr\b|dg\b|dummy\b|dumm\b|dum\b|du\b|encoding\b|encodin\b|encodi\b|encod\b|enco\b|enc\b|decimalsign\b|decimalsig\b|decimalsi\b|decimals\b|decimal\b|decima\b|decim\b|deci\b|dec\b|fit\b|fontpath\b|fontpat\b|fontpa\b|fontp\b|font\b|format\b|forma\b|form\b|for\b|fo\b|function\b|functio\b|functi\b|funct\b|func\b|fun\b|fu\b|functions\b|function\b|functio\b|functi\b|funct\b|func\b|fun\b|fu\b|grid\b|gri\b|gr\b|g\b|hidden3d\b|hidden3\b|hidden\b|hidde\b|hidd\b|hid\b|historysize\b|historysiz\b|historysi\b|historys\b|history\b|histor\b|histo\b|hist\b|his\b|isosamples\b|isosample\b|isosampl\b|isosamp\b|isosam\b|isosa\b|isos\b|iso\b|is\b|key\b|ke\b|k\b|keytitle\b|keytitl\b|keytit\b|keyti\b|keyt\b|label\b|labe\b|lab\b|la\b|linestyle\b|linestyl\b|linesty\b|linest\b|lines\b|line\b|lin\b|li\b|ls\b|loadpath\b|loadpat\b|loadpa\b|loadp\b|load\b|loa\b|locale\b|local\b|loca\b|loc\b|logscale\b|logscal\b|logsca\b|logsc\b|logs\b|log\b|macros\b|macro\b|macr\b|mac\b|mapping\b|mappin\b|mappi\b|mapp\b|map\b|mapping3d\b|mapping3\b|mapping\b|mappin\b|mappi\b|mapp\b|map\b|margin\b|margi\b|marg\b|mar\b|lmargin\b|lmargi\b|lmarg\b|lmar\b|rmargin\b|rmargi\b|rmarg\b|rmar\b|tmargin\b|tmargi\b|tmarg\b|tmar\b|bmargin\b|bmargi\b|bmarg\b|bmar\b|mouse\b|mous\b|mou\b|mo\b|multiplot\b|multiplo\b|multipl\b|multip\b|multi\b|mxtics\b|mxtic\b|mxti\b|mxt\b|nomxtics\b|nomxtic\b|nomxti\b|nomxt\b|mx2tics\b|mx2tic\b|mx2ti\b|mx2t\b|nomx2tics\b|nomx2tic\b|nomx2ti\b|nomx2t\b|mytics\b|mytic\b|myti\b|myt\b|nomytics\b|nomytic\b|nomyti\b|nomyt\b|my2tics\b|my2tic\b|my2ti\b|my2t\b|nomy2tics\b|nomy2tic\b|nomy2ti\b|nomy2t\b|mztics\b|mztic\b|mzti\b|mzt\b|nomztics\b|nomztic\b|nomzti\b|nomzt\b|mcbtics\b|mcbtic\b|mcbti\b|mcbt\b|nomcbtics\b|nomcbtic\b|nomcbti\b|nomcbt\b|offsets\b|offset\b|offse\b|offs\b|off\b|of\b|origin\b|origi\b|orig\b|ori\b|or\b|output\b|outpu\b|outp\b|out\b|ou\b|o\b|parametric\b|parametri\b|parametr\b|paramet\b|parame\b|param\b|para\b|par\b|pa\b|pm3d\b|pm3\b|pm\b|palette\b|palett\b|palet\b|pale\b|pal\b|colorbox\b|colorbo\b|colorb\b|plot\b|plo\b|pl\b|p\b|pointsize\b|pointsiz\b|pointsi\b|points\b|point\b|poin\b|poi\b|polar\b|pola\b|pol\b|print\b|prin\b|pri\b|pr\b|object\b|objec\b|obje\b|obj\b|samples\b|sample\b|sampl\b|samp\b|sam\b|sa\b|size\b|siz\b|si\b|style\b|styl\b|sty\b|st\b|surface\b|surfac\b|surfa\b|surf\b|sur\b|su\b|table\b|terminal\b|termina\b|termin\b|termi\b|term\b|ter\b|te\b|t\b|termoptions\b|termoption\b|termoptio\b|termopti\b|termopt\b|termop\b|termo\b|tics\b|tic\b|ti\b|ticscale\b|ticscal\b|ticsca\b|ticsc\b|ticslevel\b|ticsleve\b|ticslev\b|ticsle\b|ticsl\b|timefmt\b|timefm\b|timef\b|timestamp\b|timestam\b|timesta\b|timest\b|times\b|time\b|tim\b|title\b|titl\b|tit\b|variables\b|variable\b|variabl\b|variab\b|varia\b|vari\b|var\b|va\b|v\b|version\b|versio\b|versi\b|vers\b|ver\b|ve\b|view\b|vie\b|vi\b|xyplane\b|xyplan\b|xypla\b|xypl\b|xyp\b|xdata\b|xdat\b|xda\b|x2data\b|x2dat\b|x2da\b|ydata\b|ydat\b|yda\b|y2data\b|y2dat\b|y2da\b|zdata\b|zdat\b|zda\b|cbdata\b|cbdat\b|cbda\b|xlabel\b|xlabe\b|xlab\b|xla\b|xl\b|x2label\b|x2labe\b|x2lab\b|x2la\b|x2l\b|ylabel\b|ylabe\b|ylab\b|yla\b|yl\b|y2label\b|y2labe\b|y2lab\b|y2la\b|y2l\b|zlabel\b|zlabe\b|zlab\b|zla\b|zl\b|cblabel\b|cblabe\b|cblab\b|cbla\b|cbl\b|xtics\b|xtic\b|xti\b|noxtics\b|noxtic\b|noxti\b|x2tics\b|x2tic\b|x2ti\b|nox2tics\b|nox2tic\b|nox2ti\b|ytics\b|ytic\b|yti\b|noytics\b|noytic\b|noyti\b|y2tics\b|y2tic\b|y2ti\b|noy2tics\b|noy2tic\b|noy2ti\b|ztics\b|ztic\b|zti\b|noztics\b|noztic\b|nozti\b|cbtics\b|cbtic\b|cbti\b|nocbtics\b|nocbtic\b|nocbti\b|xdtics\b|xdtic\b|xdti\b|noxdtics\b|noxdtic\b|noxdti\b|x2dtics\b|x2dtic\b|x2dti\b|nox2dtics\b|nox2dtic\b|nox2dti\b|ydtics\b|ydtic\b|ydti\b|noydtics\b|noydtic\b|noydti\b|y2dtics\b|y2dtic\b|y2dti\b|noy2dtics\b|noy2dtic\b|noy2dti\b|zdtics\b|zdtic\b|zdti\b|nozdtics\b|nozdtic\b|nozdti\b|cbdtics\b|cbdtic\b|cbdti\b|nocbdtics\b|nocbdtic\b|nocbdti\b|xmtics\b|xmtic\b|xmti\b|noxmtics\b|noxmtic\b|noxmti\b|x2mtics\b|x2mtic\b|x2mti\b|nox2mtics\b|nox2mtic\b|nox2mti\b|ymtics\b|ymtic\b|ymti\b|noymtics\b|noymtic\b|noymti\b|y2mtics\b|y2mtic\b|y2mti\b|noy2mtics\b|noy2mtic\b|noy2mti\b|zmtics\b|zmtic\b|zmti\b|nozmtics\b|nozmtic\b|nozmti\b|cbmtics\b|cbmtic\b|cbmti\b|nocbmtics\b|nocbmtic\b|nocbmti\b|xrange\b|xrang\b|xran\b|xra\b|xr\b|x2range\b|x2rang\b|x2ran\b|x2ra\b|x2r\b|yrange\b|yrang\b|yran\b|yra\b|yr\b|y2range\b|y2rang\b|y2ran\b|y2ra\b|y2r\b|zrange\b|zrang\b|zran\b|zra\b|zr\b|cbrange\b|cbrang\b|cbran\b|cbra\b|cbr\b|rrange\b|rrang\b|rran\b|rra\b|rr\b|trange\b|trang\b|tran\b|tra\b|tr\b|urange\b|urang\b|uran\b|ura\b|ur\b|vrange\b|vrang\b|vran\b|vra\b|vr\b|xzeroaxis\b|xzeroaxi\b|xzeroax\b|xzeroa\b|x2zeroaxis\b|x2zeroaxi\b|x2zeroax\b|x2zeroa\b|yzeroaxis\b|yzeroaxi\b|yzeroax\b|yzeroa\b|y2zeroaxis\b|y2zeroaxi\b|y2zeroax\b|y2zeroa\b|zzeroaxis\b|zzeroaxi\b|zzeroax\b|zzeroa\b|zeroaxis\b|zeroaxi\b|zeroax\b|zeroa\b|zero\b|zer\b|ze\b|z\b`, NameBuiltin, Pop(1)}, - }, - "bind": { - {`!`, Keyword, Pop(1)}, - {`allwindows\b|allwindow\b|allwindo\b|allwind\b|allwin\b|allwi\b|allw\b|all\b`, NameBuiltin, nil}, - Include("genericargs"), - }, - "quit": { - {`gnuplot\b`, Keyword, nil}, - Include("noargs"), - }, - "fit": { - {`via\b`, NameBuiltin, nil}, - Include("plot"), - }, - "if": { - {`\)`, Punctuation, Pop(1)}, - Include("genericargs"), - }, - "pause": { - {`(mouse|any|button1|button2|button3)\b`, NameBuiltin, nil}, - {`keypress\b|keypres\b|keypre\b|keypr\b|keyp\b|key\b`, NameBuiltin, nil}, - Include("genericargs"), - }, - "plot": { - {`axes\b|axe\b|ax\b|axis\b|axi\b|binary\b|binar\b|bina\b|bin\b|every\b|ever\b|eve\b|ev\b|index\b|inde\b|ind\b|in\b|i\b|matrix\b|matri\b|matr\b|mat\b|smooth\b|smoot\b|smoo\b|smo\b|sm\b|s\b|thru\b|title\b|titl\b|tit\b|ti\b|t\b|notitle\b|notitl\b|notit\b|noti\b|not\b|using\b|usin\b|usi\b|us\b|u\b|with\b|wit\b|wi\b|w\b`, NameBuiltin, nil}, - Include("genericargs"), - }, - "save": { - {`functions\b|function\b|functio\b|functi\b|funct\b|func\b|fun\b|fu\b|f\b|set\b|se\b|s\b|terminal\b|termina\b|termin\b|termi\b|term\b|ter\b|te\b|t\b|variables\b|variable\b|variabl\b|variab\b|varia\b|vari\b|var\b|va\b|v\b`, NameBuiltin, nil}, - Include("genericargs"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/go.go b/vendor/github.com/alecthomas/chroma/lexers/g/go.go deleted file mode 100644 index a93fa8bb..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/go.go +++ /dev/null @@ -1,114 +0,0 @@ -package g - -import ( - "strings" - - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/h" - "github.com/alecthomas/chroma/lexers/internal" -) - -// Go lexer. -var Go = internal.Register(MustNewLexer( - &Config{ - Name: "Go", - Aliases: []string{"go", "golang"}, - Filenames: []string{"*.go"}, - MimeTypes: []string{"text/x-gosrc"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//(.*?)\n`, CommentSingle, nil}, - {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, - {`(import|package)\b`, KeywordNamespace, nil}, - {`(var|func|struct|map|chan|type|interface|const)\b`, KeywordDeclaration, nil}, - {Words(``, `\b`, `break`, `default`, `select`, `case`, `defer`, `go`, `else`, `goto`, `switch`, `fallthrough`, `if`, `range`, `continue`, `for`, `return`), Keyword, nil}, - {`(true|false|iota|nil)\b`, KeywordConstant, nil}, - {Words(``, `\b(\()`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `int`, `int8`, `int16`, `int32`, `int64`, `float`, `float32`, `float64`, `complex64`, `complex128`, `byte`, `rune`, `string`, `bool`, `error`, `uintptr`, `print`, `println`, `panic`, `recover`, `close`, `complex`, `real`, `imag`, `len`, `cap`, `append`, `copy`, `delete`, `new`, `make`), ByGroups(NameBuiltin, Punctuation), nil}, - {Words(``, `\b`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `int`, `int8`, `int16`, `int32`, `int64`, `float`, `float32`, `float64`, `complex64`, `complex128`, `byte`, `rune`, `string`, `bool`, `error`, `uintptr`), KeywordType, nil}, - {`\d+i`, LiteralNumber, nil}, - {`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\.\d+([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\d+[Ee][-+]\d+i`, LiteralNumber, nil}, - {`\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil}, - {`\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`(0|[1-9][0-9]*)`, LiteralNumberInteger, nil}, - {`'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'`, LiteralStringChar, nil}, - {"(`)([^`]*)(`)", ByGroups(LiteralString, Using(TypeRemappingLexer(GoTextTemplate, TypeMapping{{Other, LiteralString, nil}})), LiteralString), nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`(<<=|>>=|<<|>>|<=|>=|&\^=|&\^|\+=|-=|\*=|/=|%=|&=|\|=|&&|\|\||<-|\+\+|--|==|!=|:=|\.\.\.|[+\-*/%&])`, Operator, nil}, - {`([a-zA-Z_]\w*)(\s*)(\()`, ByGroups(NameFunction, UsingSelf("root"), Punctuation), nil}, - {`[|^<>=!()\[\]{}.,;:]`, Punctuation, nil}, - {`[^\W\d]\w*`, NameOther, nil}, - }, - }, -).SetAnalyser(func(text string) float32 { - if strings.Contains(text, "fmt.") && strings.Contains(text, "package ") { - return 0.5 - } - if strings.Contains(text, "package ") { - return 0.1 - } - return 0.0 -})) - -var goTemplateRules = Rules{ - "root": { - {`{{[-]?`, CommentPreproc, Push("template")}, - {`[^{]+`, Other, nil}, - {`{`, Other, nil}, - }, - "template": { - {`[-]?}}`, CommentPreproc, Pop(1)}, - {`/\*.*?\*/`, Comment, nil}, - {`(?=}})`, CommentPreproc, Pop(1)}, // Terminate the pipeline - {`\(`, Operator, Push("subexpression")}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - Include("expression"), - }, - "subexpression": { - {`\)`, Operator, Pop(1)}, - Include("expression"), - }, - "expression": { - {`\s+`, Whitespace, nil}, - {`\(`, Operator, Push("subexpression")}, - {`(range|if|else|while|with|template|end|true|false|nil|and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\b`, Keyword, nil}, - {`\||:=`, Operator, nil}, - {`[$]?[^\W\d]\w*`, NameOther, nil}, - {`[$]?\.(?:[^\W\d]\w*)?`, NameAttribute, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`\d+i`, LiteralNumber, nil}, - {`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\.\d+([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\d+[Ee][-+]\d+i`, LiteralNumber, nil}, - {`\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil}, - {`\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`(0|[1-9][0-9]*)`, LiteralNumberInteger, nil}, - {`'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'`, LiteralStringChar, nil}, - {"`[^`]*`", LiteralString, nil}, - }, -} - -var GoHTMLTemplate = internal.Register(DelegatingLexer(h.HTML, MustNewLexer( - &Config{ - Name: "Go HTML Template", - Aliases: []string{"go-html-template"}, - }, - goTemplateRules, -))) - -var GoTextTemplate = internal.Register(MustNewLexer( - &Config{ - Name: "Go Text Template", - Aliases: []string{"go-text-template"}, - }, - goTemplateRules, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/graphql.go b/vendor/github.com/alecthomas/chroma/lexers/g/graphql.go deleted file mode 100644 index a57e693a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/graphql.go +++ /dev/null @@ -1,45 +0,0 @@ -package g - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Go lexer. -var Graphql = internal.Register(MustNewLexer( - &Config{ - Name: "GraphQL", - Aliases: []string{"graphql", "graphqls", "gql"}, - Filenames: []string{"*.graphql", "*.graphqls"}, - }, - Rules{ - "root": { - {`(query|mutation|subscription|fragment|scalar|implements|interface|union|enum|input|type)`, KeywordDeclaration, Push("type")}, - {`(on|extend|schema|directive|\.\.\.)`, KeywordDeclaration, nil}, - {`(QUERY|MUTATION|SUBSCRIPTION|FIELD|FRAGMENT_DEFINITION|FRAGMENT_SPREAD|INLINE_FRAGMENT|SCHEMA|SCALAR|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|UNION|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION)\b`, KeywordConstant, nil}, - {`[^\W\d]\w*`, NameProperty, nil}, - {`\@\w+`, NameDecorator, nil}, - {`:`, Punctuation, Push("type")}, - {`[\(\)\{\}\[\],!\|=]`, Punctuation, nil}, - {`\$\w+`, NameVariable, nil}, - {`\d+i`, LiteralNumber, nil}, - {`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\.\d+([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\d+[Ee][-+]\d+i`, LiteralNumber, nil}, - {`\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil}, - {`\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil}, - {`(0|[1-9][0-9]*)`, LiteralNumberInteger, nil}, - {`"""[\x00-\x7F]*?"""`, LiteralString, nil}, - {`"(\\["\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])"`, LiteralStringChar, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`"(true|false|null)*"`, Literal, nil}, - {`[\r\n\s]+`, Whitespace, nil}, - {`#[^\r\n]*`, Comment, nil}, - }, - // Treats the next word as a class, default rules it would be a property - "type": { - {`[^\W\d]\w*`, NameClass, Pop(1)}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/groovy.go b/vendor/github.com/alecthomas/chroma/lexers/g/groovy.go deleted file mode 100644 index a395415a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/g/groovy.go +++ /dev/null @@ -1,58 +0,0 @@ -package g - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Groovy lexer. -var Groovy = internal.Register(MustNewLexer( - &Config{ - Name: "Groovy", - Aliases: []string{"groovy"}, - Filenames: []string{"*.groovy", "*.gradle"}, - MimeTypes: []string{"text/x-groovy"}, - DotAll: true, - }, - Rules{ - "root": { - {`#!(.*?)$`, CommentPreproc, Push("base")}, - Default(Push("base")), - }, - "base": { - {`^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)([a-zA-Z_]\w*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil}, - {`[^\S\n]+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`@[a-zA-Z_][\w.]*`, NameDecorator, nil}, - {`(as|assert|break|case|catch|continue|default|do|else|finally|for|if|in|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b`, Keyword, nil}, - {`(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b`, KeywordDeclaration, nil}, - {`(def|boolean|byte|char|double|float|int|long|short|void)\b`, KeywordType, nil}, - {`(package)(\s+)`, ByGroups(KeywordNamespace, Text), nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(class|interface)(\s+)`, ByGroups(KeywordDeclaration, Text), Push("class")}, - {`(import)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`""".*?"""`, LiteralStringDouble, nil}, - {`'''.*?'''`, LiteralStringSingle, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`\$/((?!/\$).)*/\$`, LiteralString, nil}, - {`/(\\\\|\\"|[^/])*/`, LiteralString, nil}, - {`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil}, - {`(\.)([a-zA-Z_]\w*)`, ByGroups(Operator, NameAttribute), nil}, - {`[a-zA-Z_]\w*:`, NameLabel, nil}, - {`[a-zA-Z_$]\w*`, Name, nil}, - {`[~^*!%&\[\](){}<>|+=:;,./?-]`, Operator, nil}, - {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+L?`, LiteralNumberInteger, nil}, - {`\n`, Text, nil}, - }, - "class": { - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - }, - "import": { - {`[\w.]+\*?`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/handlebars.go b/vendor/github.com/alecthomas/chroma/lexers/h/handlebars.go deleted file mode 100644 index 07072da5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/handlebars.go +++ /dev/null @@ -1,56 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Handlebars lexer. -var Handlebars = internal.Register(MustNewLexer( - &Config{ - Name: "Handlebars", - Aliases: []string{"handlebars"}, - Filenames: []string{"*.handlebars"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`[^{]+`, Other, nil}, - {`\{\{!.*\}\}`, Comment, nil}, - {`(\{\{\{)(\s*)`, ByGroups(CommentSpecial, Text), Push("tag")}, - {`(\{\{)(\s*)`, ByGroups(CommentPreproc, Text), Push("tag")}, - }, - "tag": { - {`\s+`, Text, nil}, - {`\}\}\}`, CommentSpecial, Pop(1)}, - {`\}\}`, CommentPreproc, Pop(1)}, - {`([#/]*)(each|if|unless|else|with|log|in(?:line)?)`, ByGroups(Keyword, Keyword), nil}, - {`#\*inline`, Keyword, nil}, - {`([#/])([\w-]+)`, ByGroups(NameFunction, NameFunction), nil}, - {`([\w-]+)(=)`, ByGroups(NameAttribute, Operator), nil}, - {`(>)(\s*)(@partial-block)`, ByGroups(Keyword, Text, Keyword), nil}, - {`(#?>)(\s*)([\w-]+)`, ByGroups(Keyword, Text, NameVariable), nil}, - {`(>)(\s*)(\()`, ByGroups(Keyword, Text, Punctuation), Push("dynamic-partial")}, - Include("generic"), - }, - "dynamic-partial": { - {`\s+`, Text, nil}, - {`\)`, Punctuation, Pop(1)}, - {`(lookup)(\s+)(\.|this)(\s+)`, ByGroups(Keyword, Text, NameVariable, Text), nil}, - {`(lookup)(\s+)(\S+)`, ByGroups(Keyword, Text, UsingSelf("variable")), nil}, - {`[\w-]+`, NameFunction, nil}, - Include("generic"), - }, - "variable": { - {`[a-zA-Z][\w-]*`, NameVariable, nil}, - {`\.[\w-]+`, NameVariable, nil}, - {`(this\/|\.\/|(\.\.\/)+)[\w-]+`, NameVariable, nil}, - }, - "generic": { - Include("variable"), - {`:?"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`:?'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/haskell.go b/vendor/github.com/alecthomas/chroma/lexers/h/haskell.go deleted file mode 100644 index b018eab4..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/haskell.go +++ /dev/null @@ -1,99 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Haskell lexer. -var Haskell = internal.Register(MustNewLexer( - &Config{ - Name: "Haskell", - Aliases: []string{"haskell", "hs"}, - Filenames: []string{"*.hs"}, - MimeTypes: []string{"text/x-haskell"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`--(?![!#$%&*+./<=>?@^|_~:\\]).*?$`, CommentSingle, nil}, - {`\{-`, CommentMultiline, Push("comment")}, - {`\bimport\b`, KeywordReserved, Push("import")}, - {`\bmodule\b`, KeywordReserved, Push("module")}, - {`\berror\b`, NameException, nil}, - {`\b(case|class|data|default|deriving|do|else|family|if|in|infix[lr]?|instance|let|newtype|of|then|type|where|_)(?!\')\b`, KeywordReserved, nil}, - {`'[^\\]'`, LiteralStringChar, nil}, - {`^[_a-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķ-ĸĺļľŀłńņň-ʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌ-ƍƒƕƙ-ƛƞơƣƥƨƪ-ƫƭưƴƶƹ-ƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜ-ǝǟǡǣǥǧǩǫǭǯ-ǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿ-ɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐ-ϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻ-ϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎ-ӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶ-ᾷιῂ-ῄῆ-ῇῐ-ΐῖ-ῗῠ-ῧῲ-ῴῶ-ῷℊℎ-ℏℓℯℴℹℼ-ℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥ-ⱦⱨⱪⱬⱱⱳ-ⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ-ⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺff-stﬓ-ﬗa-z𐐨-𐑏𝐚-𝐳𝑎-𝑔𝑖-𝑧𝒂-𝒛𝒶-𝒹𝒻𝒽-𝓃𝓅-𝓏𝓪-𝔃𝔞-𝔷𝕒-𝕫𝖆-𝖟𝖺-𝗓𝗮-𝘇𝘢-𝘻𝙖-𝙯𝚊-𝚥𝛂-𝛚𝛜-𝛡𝛼-𝜔𝜖-𝜛𝜶-𝝎𝝐-𝝕𝝰-𝞈𝞊-𝞏𝞪-𝟂𝟄-𝟉𝟋][\w\']*`, NameFunction, nil}, - {`'?[_a-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķ-ĸĺļľŀłńņň-ʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌ-ƍƒƕƙ-ƛƞơƣƥƨƪ-ƫƭưƴƶƹ-ƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜ-ǝǟǡǣǥǧǩǫǭǯ-ǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿ-ɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐ-ϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻ-ϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎ-ӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶ-ᾷιῂ-ῄῆ-ῇῐ-ΐῖ-ῗῠ-ῧῲ-ῴῶ-ῷℊℎ-ℏℓℯℴℹℼ-ℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥ-ⱦⱨⱪⱬⱱⱳ-ⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ-ⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺff-stﬓ-ﬗa-z𐐨-𐑏𝐚-𝐳𝑎-𝑔𝑖-𝑧𝒂-𝒛𝒶-𝒹𝒻𝒽-𝓃𝓅-𝓏𝓪-𝔃𝔞-𝔷𝕒-𝕫𝖆-𝖟𝖺-𝗓𝗮-𝘇𝘢-𝘻𝙖-𝙯𝚊-𝚥𝛂-𝛚𝛜-𝛡𝛼-𝜔𝜖-𝜛𝜶-𝝎𝝐-𝝕𝝰-𝞈𝞊-𝞏𝞪-𝟂𝟄-𝟉𝟋][\w']*`, Name, nil}, - {`('')?[A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w\']*`, KeywordType, nil}, - {`(')[A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w\']*`, KeywordType, nil}, - {`(')\[[^\]]*\]`, KeywordType, nil}, - {`(')\([^)]*\)`, KeywordType, nil}, - {`\\(?![:!#$%&*+.\\/<=>?@^|~-]+)`, NameFunction, nil}, - {`(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)`, OperatorWord, nil}, - {`:[:!#$%&*+.\\/<=>?@^|~-]*`, KeywordType, nil}, - {`[:!#$%&*+.\\/<=>?@^|~-]+`, Operator, nil}, - {`\d+[eE][+-]?\d+`, LiteralNumberFloat, nil}, - {`\d+\.\d+([eE][+-]?\d+)?`, LiteralNumberFloat, nil}, - {`0[oO][0-7]+`, LiteralNumberOct, nil}, - {`0[xX][\da-fA-F]+`, LiteralNumberHex, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`'`, LiteralStringChar, Push("character")}, - {`"`, LiteralString, Push("string")}, - {`\[\]`, KeywordType, nil}, - {`\(\)`, NameBuiltin, nil}, - {"[][(),;`{}]", Punctuation, nil}, - }, - "import": { - {`\s+`, Text, nil}, - {`"`, LiteralString, Push("string")}, - {`\)`, Punctuation, Pop(1)}, - {`qualified\b`, Keyword, nil}, - {`([A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*)(\s+)(as)(\s+)([A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*)`, ByGroups(NameNamespace, Text, Keyword, Text, Name), Pop(1)}, - {`([A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*)(\s+)(hiding)(\s+)(\()`, ByGroups(NameNamespace, Text, Keyword, Text, Punctuation), Push("funclist")}, - {`([A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*)(\s+)(\()`, ByGroups(NameNamespace, Text, Punctuation), Push("funclist")}, - {`[\w.]+`, NameNamespace, Pop(1)}, - }, - "module": { - {`\s+`, Text, nil}, - {`([A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*)(\s+)(\()`, ByGroups(NameNamespace, Text, Punctuation), Push("funclist")}, - {`[A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊][\w.]*`, NameNamespace, Pop(1)}, - }, - "funclist": { - {`\s+`, Text, nil}, - {`[A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊]\w*`, KeywordType, nil}, - {`(_[\w\']+|[a-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķ-ĸĺļľŀłńņň-ʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌ-ƍƒƕƙ-ƛƞơƣƥƨƪ-ƫƭưƴƶƹ-ƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜ-ǝǟǡǣǥǧǩǫǭǯ-ǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿ-ɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐ-ϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻ-ϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎ-ӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶ-ᾷιῂ-ῄῆ-ῇῐ-ΐῖ-ῗῠ-ῧῲ-ῴῶ-ῷℊℎ-ℏℓℯℴℹℼ-ℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥ-ⱦⱨⱪⱬⱱⱳ-ⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣ-ⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺff-stﬓ-ﬗa-z𐐨-𐑏𝐚-𝐳𝑎-𝑔𝑖-𝑧𝒂-𝒛𝒶-𝒹𝒻𝒽-𝓃𝓅-𝓏𝓪-𝔃𝔞-𝔷𝕒-𝕫𝖆-𝖟𝖺-𝗓𝗮-𝘇𝘢-𝘻𝙖-𝙯𝚊-𝚥𝛂-𝛚𝛜-𝛡𝛼-𝜔𝜖-𝜛𝜶-𝝎𝝐-𝝕𝝰-𝞈𝞊-𝞏𝞪-𝟂𝟄-𝟉𝟋][\w\']*)`, NameFunction, nil}, - {`--(?![!#$%&*+./<=>?@^|_~:\\]).*?$`, CommentSingle, nil}, - {`\{-`, CommentMultiline, Push("comment")}, - {`,`, Punctuation, nil}, - {`[:!#$%&*+.\\/<=>?@^|~-]+`, Operator, nil}, - {`\(`, Punctuation, Push("funclist", "funclist")}, - {`\)`, Punctuation, Pop(2)}, - }, - "comment": { - {`[^-{}]+`, CommentMultiline, nil}, - {`\{-`, CommentMultiline, Push()}, - {`-\}`, CommentMultiline, Pop(1)}, - {`[-{}]`, CommentMultiline, nil}, - }, - "character": { - {`[^\\']'`, LiteralStringChar, Pop(1)}, - {`\\`, LiteralStringEscape, Push("escape")}, - {`'`, LiteralStringChar, Pop(1)}, - }, - "string": { - {`[^\\"]+`, LiteralString, nil}, - {`\\`, LiteralStringEscape, Push("escape")}, - {`"`, LiteralString, Pop(1)}, - }, - "escape": { - {`[abfnrtv"\'&\\]`, LiteralStringEscape, Pop(1)}, - {`\^[][A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z𐐀-𐐧𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊@^_]`, LiteralStringEscape, Pop(1)}, - {`NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL`, LiteralStringEscape, Pop(1)}, - {`o[0-7]+`, LiteralStringEscape, Pop(1)}, - {`x[\da-fA-F]+`, LiteralStringEscape, Pop(1)}, - {`\d+`, LiteralStringEscape, Pop(1)}, - {`\s+\\`, LiteralStringEscape, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/haxe.go b/vendor/github.com/alecthomas/chroma/lexers/h/haxe.go deleted file mode 100644 index 59585431..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/haxe.go +++ /dev/null @@ -1,642 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Haxe lexer. -var Haxe = internal.Register(MustNewLexer( - &Config{ - Name: "Haxe", - Aliases: []string{"hx", "haxe", "hxsl"}, - Filenames: []string{"*.hx", "*.hxsl"}, - MimeTypes: []string{"text/haxe", "text/x-haxe", "text/x-hx"}, - DotAll: true, - }, - Rules{ - "root": { - Include("spaces"), - Include("meta"), - {`(?:package)\b`, KeywordNamespace, Push("semicolon", "package")}, - {`(?:import)\b`, KeywordNamespace, Push("semicolon", "import")}, - {`(?:using)\b`, KeywordNamespace, Push("semicolon", "using")}, - {`(?:extern|private)\b`, KeywordDeclaration, nil}, - {`(?:abstract)\b`, KeywordDeclaration, Push("abstract")}, - {`(?:class|interface)\b`, KeywordDeclaration, Push("class")}, - {`(?:enum)\b`, KeywordDeclaration, Push("enum")}, - {`(?:typedef)\b`, KeywordDeclaration, Push("typedef")}, - {`(?=.)`, Text, Push("expr-statement")}, - }, - "spaces": { - {`\s+`, Text, nil}, - {`//[^\n\r]*`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`(#)(if|elseif|else|end|error)\b`, CommentPreproc, MutatorFunc(haxePreProcMutator)}, - }, - "string-single-interpol": { - {`\$\{`, LiteralStringInterpol, Push("string-interpol-close", "expr")}, - {`\$\$`, LiteralStringEscape, nil}, - {`\$(?=(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+))`, LiteralStringInterpol, Push("ident")}, - Include("string-single"), - }, - "string-single": { - {`'`, LiteralStringSingle, Pop(1)}, - {`\\.`, LiteralStringEscape, nil}, - {`.`, LiteralStringSingle, nil}, - }, - "string-double": { - {`"`, LiteralStringDouble, Pop(1)}, - {`\\.`, LiteralStringEscape, nil}, - {`.`, LiteralStringDouble, nil}, - }, - "string-interpol-close": { - {`\$(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, LiteralStringInterpol, nil}, - {`\}`, LiteralStringInterpol, Pop(1)}, - }, - "package": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameNamespace, nil}, - {`\.`, Punctuation, Push("import-ident")}, - Default(Pop(1)), - }, - "import": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameNamespace, nil}, - {`\*`, Keyword, nil}, - {`\.`, Punctuation, Push("import-ident")}, - {`in`, KeywordNamespace, Push("ident")}, - Default(Pop(1)), - }, - "import-ident": { - Include("spaces"), - {`\*`, Keyword, Pop(1)}, - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameNamespace, Pop(1)}, - }, - "using": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameNamespace, nil}, - {`\.`, Punctuation, Push("import-ident")}, - Default(Pop(1)), - }, - "preproc-error": { - {`\s+`, CommentPreproc, nil}, - {`'`, LiteralStringSingle, Push("#pop", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "string-double")}, - Default(Pop(1)), - }, - "preproc-expr": { - {`\s+`, CommentPreproc, nil}, - {`\!`, CommentPreproc, nil}, - {`\(`, CommentPreproc, Push("#pop", "preproc-parenthesis")}, - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, CommentPreproc, Pop(1)}, - {`\.[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+[eE][+\-]?[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+\.[0-9]*[eE][+\-]?[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+\.[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+\.(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)|\.\.)`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`'`, LiteralStringSingle, Push("#pop", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "string-double")}, - }, - "preproc-parenthesis": { - {`\s+`, CommentPreproc, nil}, - {`\)`, CommentPreproc, Pop(1)}, - Default(Push("preproc-expr-in-parenthesis")), - }, - "preproc-expr-chain": { - {`\s+`, CommentPreproc, nil}, - {`(?:%=|&=|\|=|\^=|\+=|\-=|\*=|/=|<<=|>\s*>\s*=|>\s*>\s*>\s*=|==|!=|<=|>\s*=|&&|\|\||<<|>>>|>\s*>|\.\.\.|<|>|%|&|\||\^|\+|\*|/|\-|=>|=)`, CommentPreproc, Push("#pop", "preproc-expr-in-parenthesis")}, - Default(Pop(1)), - }, - "preproc-expr-in-parenthesis": { - {`\s+`, CommentPreproc, nil}, - {`\!`, CommentPreproc, nil}, - {`\(`, CommentPreproc, Push("#pop", "preproc-expr-chain", "preproc-parenthesis")}, - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, CommentPreproc, Push("#pop", "preproc-expr-chain")}, - {`\.[0-9]+`, LiteralNumberFloat, Push("#pop", "preproc-expr-chain")}, - {`[0-9]+[eE][+\-]?[0-9]+`, LiteralNumberFloat, Push("#pop", "preproc-expr-chain")}, - {`[0-9]+\.[0-9]*[eE][+\-]?[0-9]+`, LiteralNumberFloat, Push("#pop", "preproc-expr-chain")}, - {`[0-9]+\.[0-9]+`, LiteralNumberFloat, Push("#pop", "preproc-expr-chain")}, - {`[0-9]+\.(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)|\.\.)`, LiteralNumberFloat, Push("#pop", "preproc-expr-chain")}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, Push("#pop", "preproc-expr-chain")}, - {`[0-9]+`, LiteralNumberInteger, Push("#pop", "preproc-expr-chain")}, - {`'`, LiteralStringSingle, Push("#pop", "preproc-expr-chain", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "preproc-expr-chain", "string-double")}, - }, - "abstract": { - Include("spaces"), - Default(Pop(1), Push("abstract-body"), Push("abstract-relation"), Push("abstract-opaque"), Push("type-param-constraint"), Push("type-name")), - }, - "abstract-body": { - Include("spaces"), - {`\{`, Punctuation, Push("#pop", "class-body")}, - }, - "abstract-opaque": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "parenthesis-close", "type")}, - Default(Pop(1)), - }, - "abstract-relation": { - Include("spaces"), - {`(?:to|from)`, KeywordDeclaration, Push("type")}, - {`,`, Punctuation, nil}, - Default(Pop(1)), - }, - "meta": { - Include("spaces"), - {`@`, NameDecorator, Push("meta-body", "meta-ident", "meta-colon")}, - }, - "meta-colon": { - Include("spaces"), - {`:`, NameDecorator, Pop(1)}, - Default(Pop(1)), - }, - "meta-ident": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameDecorator, Pop(1)}, - }, - "meta-body": { - Include("spaces"), - {`\(`, NameDecorator, Push("#pop", "meta-call")}, - Default(Pop(1)), - }, - "meta-call": { - Include("spaces"), - {`\)`, NameDecorator, Pop(1)}, - Default(Pop(1), Push("meta-call-sep"), Push("expr")), - }, - "meta-call-sep": { - Include("spaces"), - {`\)`, NameDecorator, Pop(1)}, - {`,`, Punctuation, Push("#pop", "meta-call")}, - }, - "typedef": { - Include("spaces"), - Default(Pop(1), Push("typedef-body"), Push("type-param-constraint"), Push("type-name")), - }, - "typedef-body": { - Include("spaces"), - {`=`, Operator, Push("#pop", "optional-semicolon", "type")}, - }, - "enum": { - Include("spaces"), - Default(Pop(1), Push("enum-body"), Push("bracket-open"), Push("type-param-constraint"), Push("type-name")), - }, - "enum-body": { - Include("spaces"), - Include("meta"), - {`\}`, Punctuation, Pop(1)}, - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("enum-member", "type-param-constraint")}, - }, - "enum-member": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "semicolon", "flag", "function-param")}, - Default(Pop(1), Push("semicolon"), Push("flag")), - }, - "class": { - Include("spaces"), - Default(Pop(1), Push("class-body"), Push("bracket-open"), Push("extends"), Push("type-param-constraint"), Push("type-name")), - }, - "extends": { - Include("spaces"), - {`(?:extends|implements)\b`, KeywordDeclaration, Push("type")}, - {`,`, Punctuation, nil}, - Default(Pop(1)), - }, - "bracket-open": { - Include("spaces"), - {`\{`, Punctuation, Pop(1)}, - }, - "bracket-close": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - }, - "class-body": { - Include("spaces"), - Include("meta"), - {`\}`, Punctuation, Pop(1)}, - {`(?:static|public|private|override|dynamic|inline|macro)\b`, KeywordDeclaration, nil}, - Default(Push("class-member")), - }, - "class-member": { - Include("spaces"), - {`(var)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "var")}, - {`(function)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "class-method")}, - }, - "function-local": { - Include("spaces"), - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameFunction, Push("#pop", "optional-expr", "flag", "function-param", "parenthesis-open", "type-param-constraint")}, - Default(Pop(1), Push("optional-expr"), Push("flag"), Push("function-param"), Push("parenthesis-open"), Push("type-param-constraint")), - }, - "optional-expr": { - Include("spaces"), - Include("expr"), - Default(Pop(1)), - }, - "class-method": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, NameFunction, Push("#pop", "optional-expr", "flag", "function-param", "parenthesis-open", "type-param-constraint")}, - }, - "function-param": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - {`\?`, Punctuation, nil}, - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("#pop", "function-param-sep", "assign", "flag")}, - }, - "function-param-sep": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "function-param")}, - }, - "prop-get-set": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "parenthesis-close", "prop-get-set-opt", "comma", "prop-get-set-opt")}, - Default(Pop(1)), - }, - "prop-get-set-opt": { - Include("spaces"), - {`(?:default|null|never|dynamic|get|set)\b`, Keyword, Pop(1)}, - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Text, Pop(1)}, - }, - "expr-statement": { - Include("spaces"), - Default(Pop(1), Push("optional-semicolon"), Push("expr")), - }, - "expr": { - Include("spaces"), - {`@`, NameDecorator, Push("#pop", "optional-expr", "meta-body", "meta-ident", "meta-colon")}, - {`(?:\+\+|\-\-|~(?!/)|!|\-)`, Operator, nil}, - {`\(`, Punctuation, Push("#pop", "expr-chain", "parenthesis")}, - {`(?:static|public|private|override|dynamic|inline)\b`, KeywordDeclaration, nil}, - {`(?:function)\b`, KeywordDeclaration, Push("#pop", "expr-chain", "function-local")}, - {`\{`, Punctuation, Push("#pop", "expr-chain", "bracket")}, - {`(?:true|false|null)\b`, KeywordConstant, Push("#pop", "expr-chain")}, - {`(?:this)\b`, Keyword, Push("#pop", "expr-chain")}, - {`(?:cast)\b`, Keyword, Push("#pop", "expr-chain", "cast")}, - {`(?:try)\b`, Keyword, Push("#pop", "catch", "expr")}, - {`(?:var)\b`, KeywordDeclaration, Push("#pop", "var")}, - {`(?:new)\b`, Keyword, Push("#pop", "expr-chain", "new")}, - {`(?:switch)\b`, Keyword, Push("#pop", "switch")}, - {`(?:if)\b`, Keyword, Push("#pop", "if")}, - {`(?:do)\b`, Keyword, Push("#pop", "do")}, - {`(?:while)\b`, Keyword, Push("#pop", "while")}, - {`(?:for)\b`, Keyword, Push("#pop", "for")}, - {`(?:untyped|throw)\b`, Keyword, nil}, - {`(?:return)\b`, Keyword, Push("#pop", "optional-expr")}, - {`(?:macro)\b`, Keyword, Push("#pop", "macro")}, - {`(?:continue|break)\b`, Keyword, Pop(1)}, - {`(?:\$\s*[a-z]\b|\$(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)))`, Name, Push("#pop", "dollar")}, - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("#pop", "expr-chain")}, - {`\.[0-9]+`, LiteralNumberFloat, Push("#pop", "expr-chain")}, - {`[0-9]+[eE][+\-]?[0-9]+`, LiteralNumberFloat, Push("#pop", "expr-chain")}, - {`[0-9]+\.[0-9]*[eE][+\-]?[0-9]+`, LiteralNumberFloat, Push("#pop", "expr-chain")}, - {`[0-9]+\.[0-9]+`, LiteralNumberFloat, Push("#pop", "expr-chain")}, - {`[0-9]+\.(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)|\.\.)`, LiteralNumberFloat, Push("#pop", "expr-chain")}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, Push("#pop", "expr-chain")}, - {`[0-9]+`, LiteralNumberInteger, Push("#pop", "expr-chain")}, - {`'`, LiteralStringSingle, Push("#pop", "expr-chain", "string-single-interpol")}, - {`"`, LiteralStringDouble, Push("#pop", "expr-chain", "string-double")}, - {`~/(\\\\|\\/|[^/\n])*/[gimsu]*`, LiteralStringRegex, Push("#pop", "expr-chain")}, - {`\[`, Punctuation, Push("#pop", "expr-chain", "array-decl")}, - }, - "expr-chain": { - Include("spaces"), - {`(?:\+\+|\-\-)`, Operator, nil}, - {`(?:%=|&=|\|=|\^=|\+=|\-=|\*=|/=|<<=|>\s*>\s*=|>\s*>\s*>\s*=|==|!=|<=|>\s*=|&&|\|\||<<|>>>|>\s*>|\.\.\.|<|>|%|&|\||\^|\+|\*|/|\-|=>|=)`, Operator, Push("#pop", "expr")}, - {`(?:in)\b`, Keyword, Push("#pop", "expr")}, - {`\?`, Operator, Push("#pop", "expr", "ternary", "expr")}, - {`(\.)((?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+))`, ByGroups(Punctuation, Name), nil}, - {`\[`, Punctuation, Push("array-access")}, - {`\(`, Punctuation, Push("call")}, - Default(Pop(1)), - }, - "macro": { - Include("spaces"), - Include("meta"), - {`:`, Punctuation, Push("#pop", "type")}, - {`(?:extern|private)\b`, KeywordDeclaration, nil}, - {`(?:abstract)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "abstract")}, - {`(?:class|interface)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "macro-class")}, - {`(?:enum)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "enum")}, - {`(?:typedef)\b`, KeywordDeclaration, Push("#pop", "optional-semicolon", "typedef")}, - Default(Pop(1), Push("expr")), - }, - "macro-class": { - {`\{`, Punctuation, Push("#pop", "class-body")}, - Include("class"), - }, - "cast": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "parenthesis-close", "cast-type", "expr")}, - Default(Pop(1), Push("expr")), - }, - "cast-type": { - Include("spaces"), - {`,`, Punctuation, Push("#pop", "type")}, - Default(Pop(1)), - }, - "catch": { - Include("spaces"), - {`(?:catch)\b`, Keyword, Push("expr", "function-param", "parenthesis-open")}, - Default(Pop(1)), - }, - "do": { - Include("spaces"), - Default(Pop(1), Push("do-while"), Push("expr")), - }, - "do-while": { - Include("spaces"), - {`(?:while)\b`, Keyword, Push("#pop", "parenthesis", "parenthesis-open")}, - }, - "while": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "expr", "parenthesis")}, - }, - "for": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "expr", "parenthesis")}, - }, - "if": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "else", "optional-semicolon", "expr", "parenthesis")}, - }, - "else": { - Include("spaces"), - {`(?:else)\b`, Keyword, Push("#pop", "expr")}, - Default(Pop(1)), - }, - "switch": { - Include("spaces"), - Default(Pop(1), Push("switch-body"), Push("bracket-open"), Push("expr")), - }, - "switch-body": { - Include("spaces"), - {`(?:case|default)\b`, Keyword, Push("case-block", "case")}, - {`\}`, Punctuation, Pop(1)}, - }, - "case": { - Include("spaces"), - {`:`, Punctuation, Pop(1)}, - Default(Pop(1), Push("case-sep"), Push("case-guard"), Push("expr")), - }, - "case-sep": { - Include("spaces"), - {`:`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "case")}, - }, - "case-guard": { - Include("spaces"), - {`(?:if)\b`, Keyword, Push("#pop", "parenthesis", "parenthesis-open")}, - Default(Pop(1)), - }, - "case-block": { - Include("spaces"), - {`(?!(?:case|default)\b|\})`, Keyword, Push("expr-statement")}, - Default(Pop(1)), - }, - "new": { - Include("spaces"), - Default(Pop(1), Push("call"), Push("parenthesis-open"), Push("type")), - }, - "array-decl": { - Include("spaces"), - {`\]`, Punctuation, Pop(1)}, - Default(Pop(1), Push("array-decl-sep"), Push("expr")), - }, - "array-decl-sep": { - Include("spaces"), - {`\]`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "array-decl")}, - }, - "array-access": { - Include("spaces"), - Default(Pop(1), Push("array-access-close"), Push("expr")), - }, - "array-access-close": { - Include("spaces"), - {`\]`, Punctuation, Pop(1)}, - }, - "comma": { - Include("spaces"), - {`,`, Punctuation, Pop(1)}, - }, - "colon": { - Include("spaces"), - {`:`, Punctuation, Pop(1)}, - }, - "semicolon": { - Include("spaces"), - {`;`, Punctuation, Pop(1)}, - }, - "optional-semicolon": { - Include("spaces"), - {`;`, Punctuation, Pop(1)}, - Default(Pop(1)), - }, - "ident": { - Include("spaces"), - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Pop(1)}, - }, - "dollar": { - Include("spaces"), - {`\{`, Punctuation, Push("#pop", "expr-chain", "bracket-close", "expr")}, - Default(Pop(1), Push("expr-chain")), - }, - "type-name": { - Include("spaces"), - {`_*[A-Z]\w*`, Name, Pop(1)}, - }, - "type-full-name": { - Include("spaces"), - {`\.`, Punctuation, Push("ident")}, - Default(Pop(1)), - }, - "type": { - Include("spaces"), - {`\?`, Punctuation, nil}, - {`(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("#pop", "type-check", "type-full-name")}, - {`\{`, Punctuation, Push("#pop", "type-check", "type-struct")}, - {`\(`, Punctuation, Push("#pop", "type-check", "type-parenthesis")}, - }, - "type-parenthesis": { - Include("spaces"), - Default(Pop(1), Push("parenthesis-close"), Push("type")), - }, - "type-check": { - Include("spaces"), - {`->`, Punctuation, Push("#pop", "type")}, - {`<(?!=)`, Punctuation, Push("type-param")}, - Default(Pop(1)), - }, - "type-struct": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - {`\?`, Punctuation, nil}, - {`>`, Punctuation, Push("comma", "type")}, - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("#pop", "type-struct-sep", "type", "colon")}, - Include("class-body"), - }, - "type-struct-sep": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "type-struct")}, - }, - "type-param-type": { - {`\.[0-9]+`, LiteralNumberFloat, Pop(1)}, - {`[0-9]+[eE][+\-]?[0-9]+`, LiteralNumberFloat, Pop(1)}, - {`[0-9]+\.[0-9]*[eE][+\-]?[0-9]+`, LiteralNumberFloat, Pop(1)}, - {`[0-9]+\.[0-9]+`, LiteralNumberFloat, Pop(1)}, - {`[0-9]+\.(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)|\.\.)`, LiteralNumberFloat, Pop(1)}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, Pop(1)}, - {`[0-9]+`, LiteralNumberInteger, Pop(1)}, - {`'`, LiteralStringSingle, Push("#pop", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "string-double")}, - {`~/(\\\\|\\/|[^/\n])*/[gim]*`, LiteralStringRegex, Pop(1)}, - {`\[`, Operator, Push("#pop", "array-decl")}, - Include("type"), - }, - "type-param": { - Include("spaces"), - Default(Pop(1), Push("type-param-sep"), Push("type-param-type")), - }, - "type-param-sep": { - Include("spaces"), - {`>`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "type-param")}, - }, - "type-param-constraint": { - Include("spaces"), - {`<(?!=)`, Punctuation, Push("#pop", "type-param-constraint-sep", "type-param-constraint-flag", "type-name")}, - Default(Pop(1)), - }, - "type-param-constraint-sep": { - Include("spaces"), - {`>`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "type-param-constraint-sep", "type-param-constraint-flag", "type-name")}, - }, - "type-param-constraint-flag": { - Include("spaces"), - {`:`, Punctuation, Push("#pop", "type-param-constraint-flag-type")}, - Default(Pop(1)), - }, - "type-param-constraint-flag-type": { - Include("spaces"), - {`\(`, Punctuation, Push("#pop", "type-param-constraint-flag-type-sep", "type")}, - Default(Pop(1), Push("type")), - }, - "type-param-constraint-flag-type-sep": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("type")}, - }, - "parenthesis": { - Include("spaces"), - Default(Pop(1), Push("parenthesis-close"), Push("flag"), Push("expr")), - }, - "parenthesis-open": { - Include("spaces"), - {`\(`, Punctuation, Pop(1)}, - }, - "parenthesis-close": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - }, - "var": { - Include("spaces"), - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Text, Push("#pop", "var-sep", "assign", "flag", "prop-get-set")}, - }, - "var-sep": { - Include("spaces"), - {`,`, Punctuation, Push("#pop", "var")}, - Default(Pop(1)), - }, - "assign": { - Include("spaces"), - {`=`, Operator, Push("#pop", "expr")}, - Default(Pop(1)), - }, - "flag": { - Include("spaces"), - {`:`, Punctuation, Push("#pop", "type")}, - Default(Pop(1)), - }, - "ternary": { - Include("spaces"), - {`:`, Operator, Pop(1)}, - }, - "call": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - Default(Pop(1), Push("call-sep"), Push("expr")), - }, - "call-sep": { - Include("spaces"), - {`\)`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "call")}, - }, - "bracket": { - Include("spaces"), - {`(?!(?:\$\s*[a-z]\b|\$(?!(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+))))(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Push("#pop", "bracket-check")}, - {`'`, LiteralStringSingle, Push("#pop", "bracket-check", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "bracket-check", "string-double")}, - Default(Pop(1), Push("block")), - }, - "bracket-check": { - Include("spaces"), - {`:`, Punctuation, Push("#pop", "object-sep", "expr")}, - Default(Pop(1), Push("block"), Push("optional-semicolon"), Push("expr-chain")), - }, - "block": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - Default(Push("expr-statement")), - }, - "object": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - Default(Pop(1), Push("object-sep"), Push("expr"), Push("colon"), Push("ident-or-string")), - }, - "ident-or-string": { - Include("spaces"), - {`(?!(?:function|class|static|var|if|else|while|do|for|break|return|continue|extends|implements|import|switch|case|default|public|private|try|untyped|catch|new|this|throw|extern|enum|in|interface|cast|override|dynamic|typedef|package|inline|using|null|true|false|abstract)\b)(?:_*[a-z]\w*|_+[0-9]\w*|_*[A-Z]\w*|_+|\$\w+)`, Name, Pop(1)}, - {`'`, LiteralStringSingle, Push("#pop", "string-single")}, - {`"`, LiteralStringDouble, Push("#pop", "string-double")}, - }, - "object-sep": { - Include("spaces"), - {`\}`, Punctuation, Pop(1)}, - {`,`, Punctuation, Push("#pop", "object")}, - }, - }, -)) - -func haxePreProcMutator(state *LexerState) error { - stack, ok := state.Get("haxe-pre-proc").([][]string) - if !ok { - stack = [][]string{} - } - - proc := state.Groups[2] - switch proc { - case "if": - stack = append(stack, state.Stack) - case "else", "elseif": - if len(stack) > 0 { - state.Stack = stack[len(stack)-1] - } - case "end": - stack = stack[:len(stack)-1] - } - - if proc == "if" || proc == "elseif" { - state.Stack = append(state.Stack, "preproc-expr") - } - - if proc == "error" { - state.Stack = append(state.Stack, "preproc-error") - } - state.Set("haxe-pre-proc", stack) - return nil -} diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/hcl.go b/vendor/github.com/alecthomas/chroma/lexers/h/hcl.go deleted file mode 100644 index ce7064b5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/hcl.go +++ /dev/null @@ -1,69 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// HCL lexer. -var HCL = internal.Register(MustNewLexer( - &Config{ - Name: "HCL", - Aliases: []string{"hcl"}, - Filenames: []string{"*.hcl"}, - MimeTypes: []string{"application/x-hcl"}, - }, - Rules{ - "root": { - Include("string"), - Include("punctuation"), - Include("curly"), - Include("basic"), - Include("whitespace"), - {`[0-9]+`, LiteralNumber, nil}, - }, - "basic": { - {Words(`\b`, `\b`, `true`, `false`), KeywordType, nil}, - {`\s*/\*`, CommentMultiline, Push("comment")}, - {`\s*#.*\n`, CommentSingle, nil}, - {`(.*?)(\s*)(=)`, ByGroups(Name, Text, Operator), nil}, - {`\d+`, Number, nil}, - {`\b\w+\b`, Keyword, nil}, - {`\$\{`, LiteralStringInterpol, Push("var_builtin")}, - }, - "function": { - {`(\s+)(".*")(\s+)`, ByGroups(Text, LiteralString, Text), nil}, - Include("punctuation"), - Include("curly"), - }, - "var_builtin": { - {`\$\{`, LiteralStringInterpol, Push()}, - {Words(`\b`, `\b`, `concat`, `file`, `join`, `lookup`, `element`), NameBuiltin, nil}, - Include("string"), - Include("punctuation"), - {`\s+`, Text, nil}, - {`\}`, LiteralStringInterpol, Pop(1)}, - }, - "string": { - {`(".*")`, ByGroups(LiteralStringDouble), nil}, - }, - "punctuation": { - {`[\[\](),.]`, Punctuation, nil}, - }, - "curly": { - {`\{`, TextPunctuation, nil}, - {`\}`, TextPunctuation, nil}, - }, - "comment": { - {`[^*/]`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "whitespace": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/hexdump.go b/vendor/github.com/alecthomas/chroma/lexers/h/hexdump.go deleted file mode 100644 index 8b7e7bdd..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/hexdump.go +++ /dev/null @@ -1,67 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Hexdump lexer. -var Hexdump = internal.Register(MustNewLexer( - &Config{ - Name: "Hexdump", - Aliases: []string{"hexdump"}, - Filenames: []string{}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - Include("offset"), - {`([0-9A-Ha-h]{2})(\-)([0-9A-Ha-h]{2})`, ByGroups(LiteralNumberHex, Punctuation, LiteralNumberHex), nil}, - {`[0-9A-Ha-h]{2}`, LiteralNumberHex, nil}, - {`(\s{2,3})(\>)(.{16})(\<)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), Push("bracket-strings")}, - {`(\s{2,3})(\|)(.{16})(\|)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), Push("piped-strings")}, - {`(\s{2,3})(\>)(.{1,15})(\<)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), nil}, - {`(\s{2,3})(\|)(.{1,15})(\|)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), nil}, - {`(\s{2,3})(.{1,15})$`, ByGroups(Text, LiteralString), nil}, - {`(\s{2,3})(.{16}|.{20})$`, ByGroups(Text, LiteralString), Push("nonpiped-strings")}, - {`\s`, Text, nil}, - {`^\*`, Punctuation, nil}, - }, - "offset": { - {`^([0-9A-Ha-h]+)(:)`, ByGroups(NameLabel, Punctuation), Push("offset-mode")}, - {`^[0-9A-Ha-h]+`, NameLabel, nil}, - }, - "offset-mode": { - {`\s`, Text, Pop(1)}, - {`[0-9A-Ha-h]+`, NameLabel, nil}, - {`:`, Punctuation, nil}, - }, - "piped-strings": { - {`\n`, Text, nil}, - Include("offset"), - {`[0-9A-Ha-h]{2}`, LiteralNumberHex, nil}, - {`(\s{2,3})(\|)(.{1,16})(\|)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), nil}, - {`\s`, Text, nil}, - {`^\*`, Punctuation, nil}, - }, - "bracket-strings": { - {`\n`, Text, nil}, - Include("offset"), - {`[0-9A-Ha-h]{2}`, LiteralNumberHex, nil}, - {`(\s{2,3})(\>)(.{1,16})(\<)$`, ByGroups(Text, Punctuation, LiteralString, Punctuation), nil}, - {`\s`, Text, nil}, - {`^\*`, Punctuation, nil}, - }, - "nonpiped-strings": { - {`\n`, Text, nil}, - Include("offset"), - {`([0-9A-Ha-h]{2})(\-)([0-9A-Ha-h]{2})`, ByGroups(LiteralNumberHex, Punctuation, LiteralNumberHex), nil}, - {`[0-9A-Ha-h]{2}`, LiteralNumberHex, nil}, - {`(\s{19,})(.{1,20}?)$`, ByGroups(Text, LiteralString), nil}, - {`(\s{2,3})(.{1,20})$`, ByGroups(Text, LiteralString), nil}, - {`\s`, Text, nil}, - {`^\*`, Punctuation, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/html.go b/vendor/github.com/alecthomas/chroma/lexers/h/html.go deleted file mode 100644 index 07fc27ef..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/html.go +++ /dev/null @@ -1,59 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - . "github.com/alecthomas/chroma/lexers/c" // nolint - "github.com/alecthomas/chroma/lexers/internal" - . "github.com/alecthomas/chroma/lexers/j" // nolint -) - -// HTML lexer. -var HTML = internal.Register(MustNewLexer( - &Config{ - Name: "HTML", - Aliases: []string{"html"}, - Filenames: []string{"*.html", "*.htm", "*.xhtml", "*.xslt"}, - MimeTypes: []string{"text/html", "application/xhtml+xml"}, - NotMultiline: true, - DotAll: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`[^<&]+`, Text, nil}, - {`&\S*?;`, NameEntity, nil}, - {`\<\!\[CDATA\[.*?\]\]\>`, CommentPreproc, nil}, - {``, Comment, Pop(1)}, - {`-`, Comment, nil}, - }, - "tag": { - {`\s+`, Text, nil}, - {`([\w:-]+\s*)(=)(\s*)`, ByGroups(NameAttribute, Operator, Text), Push("attr")}, - {`[\w:-]+`, NameAttribute, nil}, - {`(/?)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation), Pop(1)}, - }, - "script-content": { - {`(<)(\s*)(/)(\s*)(script)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation, Text, NameTag, Text, Punctuation), Pop(1)}, - {`.+?(?=<\s*/\s*script\s*>)`, Using(Javascript), nil}, - }, - "style-content": { - {`(<)(\s*)(/)(\s*)(style)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation, Text, NameTag, Text, Punctuation), Pop(1)}, - {`.+?(?=<\s*/\s*style\s*>)`, Using(CSS), nil}, - }, - "attr": { - {`".*?"`, LiteralString, Pop(1)}, - {`'.*?'`, LiteralString, Pop(1)}, - {`[^\s>]+`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/http.go b/vendor/github.com/alecthomas/chroma/lexers/h/http.go deleted file mode 100644 index 0a1264cf..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/http.go +++ /dev/null @@ -1,128 +0,0 @@ -package h - -import ( - "strings" - - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// HTTP lexer. -var HTTP = internal.Register(httpBodyContentTypeLexer(MustNewLexer( - &Config{ - Name: "HTTP", - Aliases: []string{"http"}, - Filenames: []string{}, - MimeTypes: []string{}, - NotMultiline: true, - DotAll: true, - }, - Rules{ - "root": { - {`(GET|POST|PUT|DELETE|HEAD|OPTIONS|TRACE|PATCH|CONNECT)( +)([^ ]+)( +)(HTTP)(/)(1\.[01])(\r?\n|\Z)`, ByGroups(NameFunction, Text, NameNamespace, Text, KeywordReserved, Operator, LiteralNumber, Text), Push("headers")}, - {`(HTTP)(/)(1\.[01])( +)(\d{3})( +)([^\r\n]+)(\r?\n|\Z)`, ByGroups(KeywordReserved, Operator, LiteralNumber, Text, LiteralNumber, Text, NameException, Text), Push("headers")}, - }, - "headers": { - {`([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|\Z)`, EmitterFunc(httpHeaderBlock), nil}, - {`([\t ]+)([^\r\n]+)(\r?\n|\Z)`, EmitterFunc(httpContinuousHeaderBlock), nil}, - {`\r?\n`, Text, Push("content")}, - }, - "content": { - {`.+`, EmitterFunc(httpContentBlock), nil}, - }, - }, -))) - -func httpContentBlock(groups []string, lexer Lexer) Iterator { - tokens := []Token{ - {Generic, groups[0]}, - } - return Literator(tokens...) -} - -func httpHeaderBlock(groups []string, lexer Lexer) Iterator { - tokens := []Token{ - {Name, groups[1]}, - {Text, groups[2]}, - {Operator, groups[3]}, - {Text, groups[4]}, - {Literal, groups[5]}, - {Text, groups[6]}, - } - return Literator(tokens...) -} - -func httpContinuousHeaderBlock(groups []string, lexer Lexer) Iterator { - tokens := []Token{ - {Text, groups[1]}, - {Literal, groups[2]}, - {Text, groups[3]}, - } - return Literator(tokens...) -} - -func httpBodyContentTypeLexer(lexer Lexer) Lexer { return &httpBodyContentTyper{lexer} } - -type httpBodyContentTyper struct{ Lexer } - -func (d *httpBodyContentTyper) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { // nolint: gocognit - var contentType string - var isContentType bool - var subIterator Iterator - - it, err := d.Lexer.Tokenise(options, text) - if err != nil { - return nil, err - } - - return func() Token { - token := it() - - if token == EOF { - if subIterator != nil { - return subIterator() - } - return EOF - } - - switch { - case token.Type == Name && strings.ToLower(token.Value) == "content-type": - { - isContentType = true - } - case token.Type == Literal && isContentType: - { - isContentType = false - contentType = strings.TrimSpace(token.Value) - pos := strings.Index(contentType, ";") - if pos > 0 { - contentType = strings.TrimSpace(contentType[:pos]) - } - } - case token.Type == Generic && contentType != "": - { - lexer := internal.MatchMimeType(contentType) - - // application/calendar+xml can be treated as application/xml - // if there's not a better match. - if lexer == nil && strings.Contains(contentType, "+") { - slashPos := strings.Index(contentType, "/") - plusPos := strings.LastIndex(contentType, "+") - contentType = contentType[:slashPos+1] + contentType[plusPos+1:] - lexer = internal.MatchMimeType(contentType) - } - - if lexer == nil { - token.Type = Text - } else { - subIterator, err = lexer.Tokenise(nil, token.Value) - if err != nil { - panic(err) - } - return EOF - } - } - } - return token - }, nil -} diff --git a/vendor/github.com/alecthomas/chroma/lexers/h/hy.go b/vendor/github.com/alecthomas/chroma/lexers/h/hy.go deleted file mode 100644 index 17385e86..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/h/hy.go +++ /dev/null @@ -1,51 +0,0 @@ -package h - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Hy lexer. -var Hy = internal.Register(MustNewLexer( - &Config{ - Name: "Hy", - Aliases: []string{"hylang"}, - Filenames: []string{"*.hy"}, - MimeTypes: []string{"text/x-hy", "application/x-hy"}, - }, - Rules{ - "root": { - {`;.*$`, CommentSingle, nil}, - {`[,\s]+`, Text, nil}, - {`-?\d+\.\d+`, LiteralNumberFloat, nil}, - {`-?\d+`, LiteralNumberInteger, nil}, - {`0[0-7]+j?`, LiteralNumberOct, nil}, - {`0[xX][a-fA-F0-9]+`, LiteralNumberHex, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'(?!#)[\w!$%*+<=>?/.#-]+`, LiteralStringSymbol, nil}, - {`\\(.|[a-z]+)`, LiteralStringChar, nil}, - {`^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")`, ByGroups(Text, LiteralStringDoc), nil}, - {`^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')`, ByGroups(Text, LiteralStringDoc), nil}, - {`::?(?!#)[\w!$%*+<=>?/.#-]+`, LiteralStringSymbol, nil}, - {"~@|[`\\'#^~&@]", Operator, nil}, - Include("py-keywords"), - Include("py-builtins"), - {Words(``, ` `, `cond`, `for`, `->`, `->>`, `car`, `cdr`, `first`, `rest`, `let`, `when`, `unless`, `import`, `do`, `progn`, `get`, `slice`, `assoc`, `with-decorator`, `,`, `list_comp`, `kwapply`, `~`, `is`, `in`, `is-not`, `not-in`, `quasiquote`, `unquote`, `unquote-splice`, `quote`, `|`, `<<=`, `>>=`, `foreach`, `while`, `eval-and-compile`, `eval-when-compile`), Keyword, nil}, - {Words(``, ` `, `def`, `defn`, `defun`, `defmacro`, `defclass`, `lambda`, `fn`, `setv`), KeywordDeclaration, nil}, - {Words(``, ` `, `cycle`, `dec`, `distinct`, `drop`, `even?`, `filter`, `inc`, `instance?`, `iterable?`, `iterate`, `iterator?`, `neg?`, `none?`, `nth`, `numeric?`, `odd?`, `pos?`, `remove`, `repeat`, `repeatedly`, `take`, `take_nth`, `take_while`, `zero?`), NameBuiltin, nil}, - {`(?<=\()(?!#)[\w!$%*+<=>?/.#-]+`, NameFunction, nil}, - {`(?!#)[\w!$%*+<=>?/.#-]+`, NameVariable, nil}, - {`(\[|\])`, Punctuation, nil}, - {`(\{|\})`, Punctuation, nil}, - {`(\(|\))`, Punctuation, nil}, - }, - "py-keywords": { - {Words(``, `\b`, `assert`, `break`, `continue`, `del`, `elif`, `else`, `except`, `exec`, `finally`, `for`, `global`, `if`, `lambda`, `pass`, `print`, `raise`, `return`, `try`, `while`, `yield`, `yield from`, `as`, `with`), Keyword, nil}, - }, - "py-builtins": { - {Words(`(??@^|_~:\\]).*?)$`, ByGroups(Text, CommentSingle), nil}, - {`(\s*)(\|{3}.*?)$`, ByGroups(Text, CommentSingle), nil}, - {`(\s*)(\{-)`, ByGroups(Text, CommentMultiline), Push("comment")}, - {`^(\s*)([^\s(){}]+)(\s*)(:)(\s*)`, ByGroups(Text, NameFunction, Text, OperatorWord, Text), nil}, - {`\b(case|class|data|default|using|do|else|if|in|infix[lr]?|instance|rewrite|auto|namespace|codata|mutual|private|public|abstract|total|partial|let|proof|of|then|static|where|_|with|pattern|term|syntax|prefix|postulate|parameters|record|dsl|impossible|implicit|tactics|intros|intro|compute|refine|exact|trivial)(?!\')\b`, KeywordReserved, nil}, - {`(import|module)(\s+)`, ByGroups(KeywordReserved, Text), Push("module")}, - {`('')?[A-Z][\w\']*`, KeywordType, nil}, - {`[a-z][\w\']*`, Text, nil}, - {`(<-|::|->|=>|=)`, OperatorWord, nil}, - {`([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)`, OperatorWord, nil}, - {`\d+[eE][+-]?\d+`, LiteralNumberFloat, nil}, - {`\d+\.\d+([eE][+-]?\d+)?`, LiteralNumberFloat, nil}, - {`0[xX][\da-fA-F]+`, LiteralNumberHex, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`'`, LiteralStringChar, Push("character")}, - {`"`, LiteralString, Push("string")}, - {`[^\s(){}]+`, Text, nil}, - {`\s+?`, Text, nil}, - }, - "module": { - {`\s+`, Text, nil}, - {`([A-Z][\w.]*)(\s+)(\()`, ByGroups(NameNamespace, Text, Punctuation), Push("funclist")}, - {`[A-Z][\w.]*`, NameNamespace, Pop(1)}, - }, - "funclist": { - {`\s+`, Text, nil}, - {`[A-Z]\w*`, KeywordType, nil}, - {`(_[\w\']+|[a-z][\w\']*)`, NameFunction, nil}, - {`--.*$`, CommentSingle, nil}, - {`\{-`, CommentMultiline, Push("comment")}, - {`,`, Punctuation, nil}, - {`[:!#$%&*+.\\/<=>?@^|~-]+`, Operator, nil}, - {`\(`, Punctuation, Push("funclist", "funclist")}, - {`\)`, Punctuation, Pop(2)}, - }, - "comment": { - {`[^-{}]+`, CommentMultiline, nil}, - {`\{-`, CommentMultiline, Push()}, - {`-\}`, CommentMultiline, Pop(1)}, - {`[-{}]`, CommentMultiline, nil}, - }, - "character": { - {`[^\\']`, LiteralStringChar, nil}, - {`\\`, LiteralStringEscape, Push("escape")}, - {`'`, LiteralStringChar, Pop(1)}, - }, - "string": { - {`[^\\"]+`, LiteralString, nil}, - {`\\`, LiteralStringEscape, Push("escape")}, - {`"`, LiteralString, Pop(1)}, - }, - "escape": { - {`[abfnrtv"\'&\\]`, LiteralStringEscape, Pop(1)}, - {`\^[][A-Z@^_]`, LiteralStringEscape, Pop(1)}, - {`NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL`, LiteralStringEscape, Pop(1)}, - {`o[0-7]+`, LiteralStringEscape, Pop(1)}, - {`x[\da-fA-F]+`, LiteralStringEscape, Pop(1)}, - {`\d+`, LiteralStringEscape, Pop(1)}, - {`\s+\\`, LiteralStringEscape, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/i/igor.go b/vendor/github.com/alecthomas/chroma/lexers/i/igor.go deleted file mode 100644 index d704a4fb..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/i/igor.go +++ /dev/null @@ -1,32 +0,0 @@ -package i - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Igor lexer. -var Igor = internal.Register(MustNewLexer( - &Config{ - Name: "Igor", - Aliases: []string{"igor", "igorpro"}, - Filenames: []string{"*.ipf"}, - MimeTypes: []string{"text/ipf"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`//.*$`, CommentSingle, nil}, - {`"([^"\\]|\\.)*"`, LiteralString, nil}, - {Words(`\b`, `\b`, `if`, `else`, `elseif`, `endif`, `for`, `endfor`, `strswitch`, `switch`, `case`, `default`, `endswitch`, `do`, `while`, `try`, `catch`, `endtry`, `break`, `continue`, `return`, `AbortOnRTE`, `AbortOnValue`), Keyword, nil}, - {Words(`\b`, `\b`, `variable`, `string`, `constant`, `strconstant`, `NVAR`, `SVAR`, `WAVE`, `STRUCT`, `dfref`, `funcref`, `char`, `uchar`, `int16`, `uint16`, `int32`, `uint32`, `int64`, `uint64`, `float`, `double`), KeywordType, nil}, - {Words(`\b`, `\b`, `override`, `ThreadSafe`, `MultiThread`, `static`, `Proc`, `Picture`, `Prompt`, `DoPrompt`, `macro`, `window`, `function`, `end`, `Structure`, `EndStructure`, `EndMacro`, `Menu`, `SubMenu`), KeywordReserved, nil}, - {Words(`\b`, `\b`, `Abort`, `AddFIFOData`, `AddFIFOVectData`, `AddMovieAudio`, `AddMovieFrame`, `AddWavesToBoxPlot`, `AddWavesToViolinPlot`, `AdoptFiles`, `APMath`, `Append`, `AppendBoxPlot`, `AppendImage`, `AppendLayoutObject`, `AppendMatrixContour`, `AppendText`, `AppendToGizmo`, `AppendToGraph`, `AppendToLayout`, `AppendToTable`, `AppendViolinPlot`, `AppendXYZContour`, `AutoPositionWindow`, `AxonTelegraphFindServers`, `BackgroundInfo`, `Beep`, `BoundingBall`, `BoxSmooth`, `BrowseURL`, `BuildMenu`, `Button`, `cd`, `Chart`, `CheckBox`, `CheckDisplayed`, `ChooseColor`, `Close`, `CloseHelp`, `CloseMovie`, `CloseProc`, `ColorScale`, `ColorTab2Wave`, `Concatenate`, `ControlBar`, `ControlInfo`, `ControlUpdate`, `ConvertGlobalStringTextEncoding`, `ConvexHull`, `Convolve`, `CopyDimLabels`, `CopyFile`, `CopyFolder`, `CopyScales`, `Correlate`, `CreateAliasShortcut`, `CreateBrowser`, `Cross`, `CtrlBackground`, `CtrlFIFO`, `CtrlNamedBackground`, `Cursor`, `CurveFit`, `CustomControl`, `CWT`, `DAQmx_AI_SetupReader`, `DAQmx_AO_SetOutputs`, `DAQmx_CTR_CountEdges`, `DAQmx_CTR_OutputPulse`, `DAQmx_CTR_Period`, `DAQmx_CTR_PulseWidth`, `DAQmx_DIO_Config`, `DAQmx_DIO_WriteNewData`, `DAQmx_Scan`, `DAQmx_WaveformGen`, `Debugger`, `DebuggerOptions`, `DefaultFont`, `DefaultGuiControls`, `DefaultGuiFont`, `DefaultTextEncoding`, `DefineGuide`, `DelayUpdate`, `DeleteAnnotations`, `DeleteFile`, `DeleteFolder`, `DeletePoints`, `Differentiate`, `dir`, `Display`, `DisplayHelpTopic`, `DisplayProcedure`, `DoAlert`, `DoIgorMenu`, `DoUpdate`, `DoWindow`, `DoXOPIdle`, `DPSS`, `DrawAction`, `DrawArc`, `DrawBezier`, `DrawLine`, `DrawOval`, `DrawPICT`, `DrawPoly`, `DrawRect`, `DrawRRect`, `DrawText`, `DrawUserShape`, `DSPDetrend`, `DSPPeriodogram`, `Duplicate`, `DuplicateDataFolder`, `DWT`, `EdgeStats`, `Edit`, `ErrorBars`, `EstimatePeakSizes`, `Execute`, `ExecuteScriptText`, `ExperimentInfo`, `ExperimentModified`, `ExportGizmo`, `Extract`, `FastGaussTransform`, `FastOp`, `FBinRead`, `FBinWrite`, `FFT`, `FGetPos`, `FIFOStatus`, `FIFO2Wave`, `FilterFIR`, `FilterIIR`, `FindAPeak`, `FindContour`, `FindDuplicates`, `FindLevel`, `FindLevels`, `FindPeak`, `FindPointsInPoly`, `FindRoots`, `FindSequence`, `FindValue`, `FMaxFlat`, `FPClustering`, `fprintf`, `FReadLine`, `FSetPos`, `FStatus`, `FTPCreateDirectory`, `FTPDelete`, `FTPDownload`, `FTPUpload`, `FuncFit`, `FuncFitMD`, `GBLoadWave`, `GetAxis`, `GetCamera`, `GetFileFolderInfo`, `GetGizmo`, `GetLastUserMenuInfo`, `GetMarquee`, `GetMouse`, `GetSelection`, `GetWindow`, `GISCreateVectorLayer`, `GISGetRasterInfo`, `GISGetRegisteredFileInfo`, `GISGetVectorLayerInfo`, `GISLoadRasterData`, `GISLoadVectorData`, `GISRasterizeVectorData`, `GISRegisterFile`, `GISTransformCoords`, `GISUnRegisterFile`, `GISWriteFieldData`, `GISWriteGeometryData`, `GISWriteRaster`, `GPIBReadBinaryWave2`, `GPIBReadBinary2`, `GPIBReadWave2`, `GPIBRead2`, `GPIBWriteBinaryWave2`, `GPIBWriteBinary2`, `GPIBWriteWave2`, `GPIBWrite2`, `GPIB2`, `GraphNormal`, `GraphWaveDraw`, `GraphWaveEdit`, `Grep`, `GroupBox`, `Hanning`, `HDFInfo`, `HDFReadImage`, `HDFReadSDS`, `HDFReadVset`, `HDF5CloseFile`, `HDF5CloseGroup`, `HDF5ConvertColors`, `HDF5CreateFile`, `HDF5CreateGroup`, `HDF5CreateLink`, `HDF5Dump`, `HDF5DumpErrors`, `HDF5DumpState`, `HDF5FlushFile`, `HDF5ListAttributes`, `HDF5ListGroup`, `HDF5LoadData`, `HDF5LoadGroup`, `HDF5LoadImage`, `HDF5OpenFile`, `HDF5OpenGroup`, `HDF5SaveData`, `HDF5SaveGroup`, `HDF5SaveImage`, `HDF5TestOperation`, `HDF5UnlinkObject`, `HideIgorMenus`, `HideInfo`, `HideProcedures`, `HideTools`, `HilbertTransform`, `Histogram`, `ICA`, `IFFT`, `ImageAnalyzeParticles`, `ImageBlend`, `ImageBoundaryToMask`, `ImageComposite`, `ImageEdgeDetection`, `ImageFileInfo`, `ImageFilter`, `ImageFocus`, `ImageFromXYZ`, `ImageGenerateROIMask`, `ImageGLCM`, `ImageHistModification`, `ImageHistogram`, `ImageInterpolate`, `ImageLineProfile`, `ImageLoad`, `ImageMorphology`, `ImageRegistration`, `ImageRemoveBackground`, `ImageRestore`, `ImageRotate`, `ImageSave`, `ImageSeedFill`, `ImageSkeleton3d`, `ImageSnake`, `ImageStats`, `ImageThreshold`, `ImageTransform`, `ImageUnwrapPhase`, `ImageWindow`, `IndexSort`, `InsertPoints`, `Integrate`, `IntegrateODE`, `Integrate2D`, `Interpolate2`, `Interpolate3D`, `Interp3DPath`, `ITCCloseAll2`, `ITCCloseDevice2`, `ITCConfigAllChannels2`, `ITCConfigChannelReset2`, `ITCConfigChannelUpload2`, `ITCConfigChannel2`, `ITCFIFOAvailableAll2`, `ITCFIFOAvailable2`, `ITCGetAllChannelsConfig2`, `ITCGetChannelConfig2`, `ITCGetCurrentDevice2`, `ITCGetDeviceInfo2`, `ITCGetDevices2`, `ITCGetErrorString2`, `ITCGetSerialNumber2`, `ITCGetState2`, `ITCGetVersions2`, `ITCInitialize2`, `ITCOpenDevice2`, `ITCReadADC2`, `ITCReadDigital2`, `ITCReadTimer2`, `ITCSelectDevice2`, `ITCSetDAC2`, `ITCSetGlobals2`, `ITCSetModes2`, `ITCSetState2`, `ITCStartAcq2`, `ITCStopAcq2`, `ITCUpdateFIFOPositionAll2`, `ITCUpdateFIFOPosition2`, `ITCWriteDigital2`, `JCAMPLoadWave`, `JointHistogram`, `KillBackground`, `KillControl`, `KillDataFolder`, `KillFIFO`, `KillFreeAxis`, `KillPath`, `KillPICTs`, `KillStrings`, `KillVariables`, `KillWaves`, `KillWindow`, `KMeans`, `Label`, `Layout`, `LayoutPageAction`, `LayoutSlideShow`, `Legend`, `LinearFeedbackShiftRegister`, `ListBox`, `LoadData`, `LoadPackagePreferences`, `LoadPICT`, `LoadWave`, `Loess`, `LombPeriodogram`, `Make`, `MakeIndex`, `MarkPerfTestTime`, `MatrixConvolve`, `MatrixCorr`, `MatrixEigenV`, `MatrixFilter`, `MatrixGaussJ`, `MatrixGLM`, `MatrixInverse`, `MatrixLinearSolve`, `MatrixLinearSolveTD`, `MatrixLLS`, `MatrixLUBkSub`, `MatrixLUD`, `MatrixLUDTD`, `MatrixMultiply`, `MatrixOP`, `MatrixSchur`, `MatrixSolve`, `MatrixSVBkSub`, `MatrixSVD`, `MatrixTranspose`, `MCC_FindServers`, `MeasureStyledText`, `MFR_CheckForNewBricklets`, `MFR_CloseResultFile`, `MFR_CreateOverviewTable`, `MFR_GetBrickletCount`, `MFR_GetBrickletData`, `MFR_GetBrickletDeployData`, `MFR_GetBrickletMetaData`, `MFR_GetBrickletRawData`, `MFR_GetReportTemplate`, `MFR_GetResultFileMetaData`, `MFR_GetResultFileName`, `MFR_GetVernissageVersion`, `MFR_GetVersion`, `MFR_GetXOPErrorMessage`, `MFR_OpenResultFile`, `MLLoadWave`, `Modify`, `ModifyBoxPlot`, `ModifyBrowser`, `ModifyCamera`, `ModifyContour`, `ModifyControl`, `ModifyControlList`, `ModifyFreeAxis`, `ModifyGizmo`, `ModifyGraph`, `ModifyImage`, `ModifyLayout`, `ModifyPanel`, `ModifyTable`, `ModifyViolinPlot`, `ModifyWaterfall`, `MoveDataFolder`, `MoveFile`, `MoveFolder`, `MoveString`, `MoveSubwindow`, `MoveVariable`, `MoveWave`, `MoveWindow`, `MultiTaperPSD`, `MultiThreadingControl`, `NC_CloseFile`, `NC_DumpErrors`, `NC_Inquire`, `NC_ListAttributes`, `NC_ListObjects`, `NC_LoadData`, `NC_OpenFile`, `NeuralNetworkRun`, `NeuralNetworkTrain`, `NewCamera`, `NewDataFolder`, `NewFIFO`, `NewFIFOChan`, `NewFreeAxis`, `NewGizmo`, `NewImage`, `NewLayout`, `NewMovie`, `NewNotebook`, `NewPanel`, `NewPath`, `NewWaterfall`, `NILoadWave`, `NI4882`, `Note`, `Notebook`, `NotebookAction`, `Open`, `OpenHelp`, `OpenNotebook`, `Optimize`, `ParseOperationTemplate`, `PathInfo`, `PauseForUser`, `PauseUpdate`, `PCA`, `PlayMovie`, `PlayMovieAction`, `PlaySound`, `PopupContextualMenu`, `PopupMenu`, `Preferences`, `PrimeFactors`, `Print`, `printf`, `PrintGraphs`, `PrintLayout`, `PrintNotebook`, `PrintSettings`, `PrintTable`, `Project`, `PulseStats`, `PutScrapText`, `pwd`, `Quit`, `RatioFromNumber`, `Redimension`, `Remez`, `Remove`, `RemoveContour`, `RemoveFromGizmo`, `RemoveFromGraph`, `RemoveFromLayout`, `RemoveFromTable`, `RemoveImage`, `RemoveLayoutObjects`, `RemovePath`, `Rename`, `RenameDataFolder`, `RenamePath`, `RenamePICT`, `RenameWindow`, `ReorderImages`, `ReorderTraces`, `ReplaceText`, `ReplaceWave`, `Resample`, `ResumeUpdate`, `Reverse`, `Rotate`, `Save`, `SaveData`, `SaveExperiment`, `SaveGizmoCopy`, `SaveGraphCopy`, `SaveNotebook`, `SavePackagePreferences`, `SavePICT`, `SaveTableCopy`, `SetActiveSubwindow`, `SetAxis`, `SetBackground`, `SetDashPattern`, `SetDataFolder`, `SetDimLabel`, `SetDrawEnv`, `SetDrawLayer`, `SetFileFolderInfo`, `SetFormula`, `SetIdlePeriod`, `SetIgorHook`, `SetIgorMenuMode`, `SetIgorOption`, `SetMarquee`, `SetProcessSleep`, `SetRandomSeed`, `SetScale`, `SetVariable`, `SetWaveLock`, `SetWaveTextEncoding`, `SetWindow`, `ShowIgorMenus`, `ShowInfo`, `ShowTools`, `Silent`, `Sleep`, `Slider`, `Smooth`, `SmoothCustom`, `Sort`, `SortColumns`, `SoundInRecord`, `SoundInSet`, `SoundInStartChart`, `SoundInStatus`, `SoundInStopChart`, `SoundLoadWave`, `SoundSaveWave`, `SphericalInterpolate`, `SphericalTriangulate`, `SplitString`, `SplitWave`, `sprintf`, `SQLHighLevelOp`, `sscanf`, `Stack`, `StackWindows`, `StatsAngularDistanceTest`, `StatsANOVA1Test`, `StatsANOVA2NRTest`, `StatsANOVA2RMTest`, `StatsANOVA2Test`, `StatsChiTest`, `StatsCircularCorrelationTest`, `StatsCircularMeans`, `StatsCircularMoments`, `StatsCircularTwoSampleTest`, `StatsCochranTest`, `StatsContingencyTable`, `StatsDIPTest`, `StatsDunnettTest`, `StatsFriedmanTest`, `StatsFTest`, `StatsHodgesAjneTest`, `StatsJBTest`, `StatsKDE`, `StatsKendallTauTest`, `StatsKSTest`, `StatsKWTest`, `StatsLinearCorrelationTest`, `StatsLinearRegression`, `StatsMultiCorrelationTest`, `StatsNPMCTest`, `StatsNPNominalSRTest`, `StatsQuantiles`, `StatsRankCorrelationTest`, `StatsResample`, `StatsSample`, `StatsScheffeTest`, `StatsShapiroWilkTest`, `StatsSignTest`, `StatsSRTest`, `StatsTTest`, `StatsTukeyTest`, `StatsVariancesTest`, `StatsWatsonUSquaredTest`, `StatsWatsonWilliamsTest`, `StatsWheelerWatsonTest`, `StatsWilcoxonRankTest`, `StatsWRCorrelationTest`, `STFT`, `String`, `StructFill`, `StructGet`, `StructPut`, `SumDimension`, `SumSeries`, `TabControl`, `Tag`, `TDMLoadData`, `TDMSaveData`, `TextBox`, `ThreadGroupPutDF`, `ThreadStart`, `TickWavesFromAxis`, `Tile`, `TileWindows`, `TitleBox`, `ToCommandLine`, `ToolsGrid`, `Triangulate3d`, `Unwrap`, `URLRequest`, `ValDisplay`, `Variable`, `VDTClosePort2`, `VDTGetPortList2`, `VDTGetStatus2`, `VDTOpenPort2`, `VDTOperationsPort2`, `VDTReadBinaryWave2`, `VDTReadBinary2`, `VDTReadHexWave2`, `VDTReadHex2`, `VDTReadWave2`, `VDTRead2`, `VDTTerminalPort2`, `VDTWriteBinaryWave2`, `VDTWriteBinary2`, `VDTWriteHexWave2`, `VDTWriteHex2`, `VDTWriteWave2`, `VDTWrite2`, `VDT2`, `VISAControl`, `VISARead`, `VISAReadBinary`, `VISAReadBinaryWave`, `VISAReadWave`, `VISAWrite`, `VISAWriteBinary`, `VISAWriteBinaryWave`, `VISAWriteWave`, `WaveMeanStdv`, `WaveStats`, `WaveTransform`, `wfprintf`, `WignerTransform`, `WindowFunction`, `XLLoadWave`), NameClass, nil}, - {Words(`\b`, `\b`, `abs`, `acos`, `acosh`, `AddListItem`, `AiryA`, `AiryAD`, `AiryB`, `AiryBD`, `alog`, `AnnotationInfo`, `AnnotationList`, `area`, `areaXY`, `asin`, `asinh`, `atan`, `atanh`, `atan2`, `AxisInfo`, `AxisList`, `AxisValFromPixel`, `AxonTelegraphAGetDataNum`, `AxonTelegraphAGetDataString`, `AxonTelegraphAGetDataStruct`, `AxonTelegraphGetDataNum`, `AxonTelegraphGetDataString`, `AxonTelegraphGetDataStruct`, `AxonTelegraphGetTimeoutMs`, `AxonTelegraphSetTimeoutMs`, `Base64Decode`, `Base64Encode`, `Besseli`, `Besselj`, `Besselk`, `Bessely`, `beta`, `betai`, `BinarySearch`, `BinarySearchInterp`, `binomial`, `binomialln`, `binomialNoise`, `cabs`, `CaptureHistory`, `CaptureHistoryStart`, `ceil`, `cequal`, `char2num`, `chebyshev`, `chebyshevU`, `CheckName`, `ChildWindowList`, `CleanupName`, `cmplx`, `cmpstr`, `conj`, `ContourInfo`, `ContourNameList`, `ContourNameToWaveRef`, `ContourZ`, `ControlNameList`, `ConvertTextEncoding`, `cos`, `cosh`, `cosIntegral`, `cot`, `coth`, `CountObjects`, `CountObjectsDFR`, `cpowi`, `CreationDate`, `csc`, `csch`, `CsrInfo`, `CsrWave`, `CsrWaveRef`, `CsrXWave`, `CsrXWaveRef`, `CTabList`, `DataFolderDir`, `DataFolderExists`, `DataFolderRefsEqual`, `DataFolderRefStatus`, `date`, `datetime`, `DateToJulian`, `date2secs`, `Dawson`, `defined`, `deltax`, `digamma`, `dilogarithm`, `DimDelta`, `DimOffset`, `DimSize`, `ei`, `enoise`, `equalWaves`, `erf`, `erfc`, `erfcw`, `exists`, `exp`, `expInt`, `expIntegralE1`, `expNoise`, `factorial`, `Faddeeva`, `fakedata`, `faverage`, `faverageXY`, `fDAQmx_AI_GetReader`, `fDAQmx_AO_UpdateOutputs`, `fDAQmx_ConnectTerminals`, `fDAQmx_CTR_Finished`, `fDAQmx_CTR_IsFinished`, `fDAQmx_CTR_IsPulseFinished`, `fDAQmx_CTR_ReadCounter`, `fDAQmx_CTR_ReadWithOptions`, `fDAQmx_CTR_SetPulseFrequency`, `fDAQmx_CTR_Start`, `fDAQmx_DeviceNames`, `fDAQmx_DIO_Finished`, `fDAQmx_DIO_PortWidth`, `fDAQmx_DIO_Read`, `fDAQmx_DIO_Write`, `fDAQmx_DisconnectTerminals`, `fDAQmx_ErrorString`, `fDAQmx_ExternalCalDate`, `fDAQmx_NumAnalogInputs`, `fDAQmx_NumAnalogOutputs`, `fDAQmx_NumCounters`, `fDAQmx_NumDIOPorts`, `fDAQmx_ReadChan`, `fDAQmx_ReadNamedChan`, `fDAQmx_ResetDevice`, `fDAQmx_ScanGetAvailable`, `fDAQmx_ScanGetNextIndex`, `fDAQmx_ScanStart`, `fDAQmx_ScanStop`, `fDAQmx_ScanWait`, `fDAQmx_ScanWaitWithTimeout`, `fDAQmx_SelfCalDate`, `fDAQmx_SelfCalibration`, `fDAQmx_WaveformStart`, `fDAQmx_WaveformStop`, `fDAQmx_WF_IsFinished`, `fDAQmx_WF_WaitUntilFinished`, `fDAQmx_WriteChan`, `FetchURL`, `FindDimLabel`, `FindListItem`, `floor`, `FontList`, `FontSizeHeight`, `FontSizeStringWidth`, `FresnelCos`, `FresnelSin`, `FuncRefInfo`, `FunctionInfo`, `FunctionList`, `FunctionPath`, `gamma`, `gammaEuler`, `gammaInc`, `gammaNoise`, `gammln`, `gammp`, `gammq`, `Gauss`, `Gauss1D`, `Gauss2D`, `gcd`, `GetBrowserLine`, `GetBrowserSelection`, `GetDataFolder`, `GetDataFolderDFR`, `GetDefaultFont`, `GetDefaultFontSize`, `GetDefaultFontStyle`, `GetDimLabel`, `GetEnvironmentVariable`, `GetErrMessage`, `GetFormula`, `GetIndependentModuleName`, `GetIndexedObjName`, `GetIndexedObjNameDFR`, `GetKeyState`, `GetRTErrMessage`, `GetRTError`, `GetRTLocation`, `GetRTLocInfo`, `GetRTStackInfo`, `GetScrapText`, `GetUserData`, `GetWavesDataFolder`, `GetWavesDataFolderDFR`, `GISGetAllFileFormats`, `GISSRefsAreEqual`, `GizmoInfo`, `GizmoScale`, `gnoise`, `GrepList`, `GrepString`, `GuideInfo`, `GuideNameList`, `Hash`, `hcsr`, `HDF5AttributeInfo`, `HDF5DatasetInfo`, `HDF5LibraryInfo`, `HDF5TypeInfo`, `hermite`, `hermiteGauss`, `HyperGNoise`, `HyperGPFQ`, `HyperG0F1`, `HyperG1F1`, `HyperG2F1`, `IgorInfo`, `IgorVersion`, `imag`, `ImageInfo`, `ImageNameList`, `ImageNameToWaveRef`, `IndependentModuleList`, `IndexedDir`, `IndexedFile`, `IndexToScale`, `Inf`, `Integrate1D`, `interp`, `Interp2D`, `Interp3D`, `inverseERF`, `inverseERFC`, `ItemsInList`, `JacobiCn`, `JacobiSn`, `JulianToDate`, `Laguerre`, `LaguerreA`, `LaguerreGauss`, `LambertW`, `LayoutInfo`, `leftx`, `LegendreA`, `limit`, `ListMatch`, `ListToTextWave`, `ListToWaveRefWave`, `ln`, `log`, `logNormalNoise`, `lorentzianNoise`, `LowerStr`, `MacroList`, `magsqr`, `MandelbrotPoint`, `MarcumQ`, `MatrixCondition`, `MatrixDet`, `MatrixDot`, `MatrixRank`, `MatrixTrace`, `max`, `MCC_AutoBridgeBal`, `MCC_AutoFastComp`, `MCC_AutoPipetteOffset`, `MCC_AutoSlowComp`, `MCC_AutoWholeCellComp`, `MCC_GetBridgeBalEnable`, `MCC_GetBridgeBalResist`, `MCC_GetFastCompCap`, `MCC_GetFastCompTau`, `MCC_GetHolding`, `MCC_GetHoldingEnable`, `MCC_GetMode`, `MCC_GetNeutralizationCap`, `MCC_GetNeutralizationEnable`, `MCC_GetOscKillerEnable`, `MCC_GetPipetteOffset`, `MCC_GetPrimarySignalGain`, `MCC_GetPrimarySignalHPF`, `MCC_GetPrimarySignalLPF`, `MCC_GetRsCompBandwidth`, `MCC_GetRsCompCorrection`, `MCC_GetRsCompEnable`, `MCC_GetRsCompPrediction`, `MCC_GetSecondarySignalGain`, `MCC_GetSecondarySignalLPF`, `MCC_GetSlowCompCap`, `MCC_GetSlowCompTau`, `MCC_GetSlowCompTauX20Enable`, `MCC_GetSlowCurrentInjEnable`, `MCC_GetSlowCurrentInjLevel`, `MCC_GetSlowCurrentInjSetlTime`, `MCC_GetWholeCellCompCap`, `MCC_GetWholeCellCompEnable`, `MCC_GetWholeCellCompResist`, `MCC_SelectMultiClamp700B`, `MCC_SetBridgeBalEnable`, `MCC_SetBridgeBalResist`, `MCC_SetFastCompCap`, `MCC_SetFastCompTau`, `MCC_SetHolding`, `MCC_SetHoldingEnable`, `MCC_SetMode`, `MCC_SetNeutralizationCap`, `MCC_SetNeutralizationEnable`, `MCC_SetOscKillerEnable`, `MCC_SetPipetteOffset`, `MCC_SetPrimarySignalGain`, `MCC_SetPrimarySignalHPF`, `MCC_SetPrimarySignalLPF`, `MCC_SetRsCompBandwidth`, `MCC_SetRsCompCorrection`, `MCC_SetRsCompEnable`, `MCC_SetRsCompPrediction`, `MCC_SetSecondarySignalGain`, `MCC_SetSecondarySignalLPF`, `MCC_SetSlowCompCap`, `MCC_SetSlowCompTau`, `MCC_SetSlowCompTauX20Enable`, `MCC_SetSlowCurrentInjEnable`, `MCC_SetSlowCurrentInjLevel`, `MCC_SetSlowCurrentInjSetlTime`, `MCC_SetTimeoutMs`, `MCC_SetWholeCellCompCap`, `MCC_SetWholeCellCompEnable`, `MCC_SetWholeCellCompResist`, `mean`, `median`, `min`, `mod`, `ModDate`, `MPFXEMGPeak`, `MPFXExpConvExpPeak`, `MPFXGaussPeak`, `MPFXLorenzianPeak`, `MPFXVoigtPeak`, `NameOfWave`, `NaN`, `NewFreeDataFolder`, `NewFreeWave`, `norm`, `NormalizeUnicode`, `note`, `NumberByKey`, `numpnts`, `numtype`, `NumVarOrDefault`, `num2char`, `num2istr`, `num2str`, `NVAR_Exists`, `OperationList`, `PadString`, `PanelResolution`, `ParamIsDefault`, `ParseFilePath`, `PathList`, `pcsr`, `Pi`, `PICTInfo`, `PICTList`, `PixelFromAxisVal`, `pnt2x`, `poissonNoise`, `poly`, `PolygonArea`, `poly2D`, `PossiblyQuoteName`, `ProcedureText`, `p2rect`, `qcsr`, `real`, `RemoveByKey`, `RemoveEnding`, `RemoveFromList`, `RemoveListItem`, `ReplaceNumberByKey`, `ReplaceString`, `ReplaceStringByKey`, `rightx`, `round`, `r2polar`, `sawtooth`, `scaleToIndex`, `ScreenResolution`, `sec`, `sech`, `Secs2Date`, `Secs2Time`, `SelectNumber`, `SelectString`, `SetEnvironmentVariable`, `sign`, `sin`, `sinc`, `sinh`, `sinIntegral`, `SortList`, `SpecialCharacterInfo`, `SpecialCharacterList`, `SpecialDirPath`, `SphericalBessJ`, `SphericalBessJD`, `SphericalBessY`, `SphericalBessYD`, `SphericalHarmonics`, `SQLAllocHandle`, `SQLAllocStmt`, `SQLBinaryWavesToTextWave`, `SQLBindCol`, `SQLBindParameter`, `SQLBrowseConnect`, `SQLBulkOperations`, `SQLCancel`, `SQLCloseCursor`, `SQLColAttributeNum`, `SQLColAttributeStr`, `SQLColumnPrivileges`, `SQLColumns`, `SQLConnect`, `SQLDataSources`, `SQLDescribeCol`, `SQLDescribeParam`, `SQLDisconnect`, `SQLDriverConnect`, `SQLDrivers`, `SQLEndTran`, `SQLError`, `SQLExecDirect`, `SQLExecute`, `SQLFetch`, `SQLFetchScroll`, `SQLForeignKeys`, `SQLFreeConnect`, `SQLFreeEnv`, `SQLFreeHandle`, `SQLFreeStmt`, `SQLGetConnectAttrNum`, `SQLGetConnectAttrStr`, `SQLGetCursorName`, `SQLGetDataNum`, `SQLGetDataStr`, `SQLGetDescFieldNum`, `SQLGetDescFieldStr`, `SQLGetDescRec`, `SQLGetDiagFieldNum`, `SQLGetDiagFieldStr`, `SQLGetDiagRec`, `SQLGetEnvAttrNum`, `SQLGetEnvAttrStr`, `SQLGetFunctions`, `SQLGetInfoNum`, `SQLGetInfoStr`, `SQLGetStmtAttrNum`, `SQLGetStmtAttrStr`, `SQLGetTypeInfo`, `SQLMoreResults`, `SQLNativeSql`, `SQLNumParams`, `SQLNumResultCols`, `SQLNumResultRowsIfKnown`, `SQLNumRowsFetched`, `SQLParamData`, `SQLPrepare`, `SQLPrimaryKeys`, `SQLProcedureColumns`, `SQLProcedures`, `SQLPutData`, `SQLReinitialize`, `SQLRowCount`, `SQLSetConnectAttrNum`, `SQLSetConnectAttrStr`, `SQLSetCursorName`, `SQLSetDescFieldNum`, `SQLSetDescFieldStr`, `SQLSetDescRec`, `SQLSetEnvAttrNum`, `SQLSetEnvAttrStr`, `SQLSetPos`, `SQLSetStmtAttrNum`, `SQLSetStmtAttrStr`, `SQLSpecialColumns`, `SQLStatistics`, `SQLTablePrivileges`, `SQLTables`, `SQLTextWaveToBinaryWaves`, `SQLTextWaveTo2DBinaryWave`, `SQLUpdateBoundValues`, `SQLXOPCheckState`, `SQL2DBinaryWaveToTextWave`, `sqrt`, `StartMSTimer`, `StatsBetaCDF`, `StatsBetaPDF`, `StatsBinomialCDF`, `StatsBinomialPDF`, `StatsCauchyCDF`, `StatsCauchyPDF`, `StatsChiCDF`, `StatsChiPDF`, `StatsCMSSDCDF`, `StatsCorrelation`, `StatsDExpCDF`, `StatsDExpPDF`, `StatsErlangCDF`, `StatsErlangPDF`, `StatsErrorPDF`, `StatsEValueCDF`, `StatsEValuePDF`, `StatsExpCDF`, `StatsExpPDF`, `StatsFCDF`, `StatsFPDF`, `StatsFriedmanCDF`, `StatsGammaCDF`, `StatsGammaPDF`, `StatsGeometricCDF`, `StatsGeometricPDF`, `StatsGEVCDF`, `StatsGEVPDF`, `StatsHyperGCDF`, `StatsHyperGPDF`, `StatsInvBetaCDF`, `StatsInvBinomialCDF`, `StatsInvCauchyCDF`, `StatsInvChiCDF`, `StatsInvCMSSDCDF`, `StatsInvDExpCDF`, `StatsInvEValueCDF`, `StatsInvExpCDF`, `StatsInvFCDF`, `StatsInvFriedmanCDF`, `StatsInvGammaCDF`, `StatsInvGeometricCDF`, `StatsInvKuiperCDF`, `StatsInvLogisticCDF`, `StatsInvLogNormalCDF`, `StatsInvMaxwellCDF`, `StatsInvMooreCDF`, `StatsInvNBinomialCDF`, `StatsInvNCChiCDF`, `StatsInvNCFCDF`, `StatsInvNormalCDF`, `StatsInvParetoCDF`, `StatsInvPoissonCDF`, `StatsInvPowerCDF`, `StatsInvQCDF`, `StatsInvQpCDF`, `StatsInvRayleighCDF`, `StatsInvRectangularCDF`, `StatsInvSpearmanCDF`, `StatsInvStudentCDF`, `StatsInvTopDownCDF`, `StatsInvTriangularCDF`, `StatsInvUsquaredCDF`, `StatsInvVonMisesCDF`, `StatsInvWeibullCDF`, `StatsKuiperCDF`, `StatsLogisticCDF`, `StatsLogisticPDF`, `StatsLogNormalCDF`, `StatsLogNormalPDF`, `StatsMaxwellCDF`, `StatsMaxwellPDF`, `StatsMedian`, `StatsMooreCDF`, `StatsNBinomialCDF`, `StatsNBinomialPDF`, `StatsNCChiCDF`, `StatsNCChiPDF`, `StatsNCFCDF`, `StatsNCFPDF`, `StatsNCTCDF`, `StatsNCTPDF`, `StatsNormalCDF`, `StatsNormalPDF`, `StatsParetoCDF`, `StatsParetoPDF`, `StatsPermute`, `StatsPoissonCDF`, `StatsPoissonPDF`, `StatsPowerCDF`, `StatsPowerNoise`, `StatsPowerPDF`, `StatsQCDF`, `StatsQpCDF`, `StatsRayleighCDF`, `StatsRayleighPDF`, `StatsRectangularCDF`, `StatsRectangularPDF`, `StatsRunsCDF`, `StatsSpearmanRhoCDF`, `StatsStudentCDF`, `StatsStudentPDF`, `StatsTopDownCDF`, `StatsTriangularCDF`, `StatsTriangularPDF`, `StatsTrimmedMean`, `StatsUSquaredCDF`, `StatsVonMisesCDF`, `StatsVonMisesNoise`, `StatsVonMisesPDF`, `StatsWaldCDF`, `StatsWaldPDF`, `StatsWeibullCDF`, `StatsWeibullPDF`, `StopMSTimer`, `StringByKey`, `stringCRC`, `StringFromList`, `StringList`, `stringmatch`, `strlen`, `strsearch`, `StrVarOrDefault`, `str2num`, `StudentA`, `StudentT`, `sum`, `SVAR_Exists`, `TableInfo`, `TagVal`, `TagWaveRef`, `tan`, `tango_close_device`, `tango_command_inout`, `tango_compute_image_proj`, `tango_get_dev_attr_list`, `tango_get_dev_black_box`, `tango_get_dev_cmd_list`, `tango_get_dev_status`, `tango_get_dev_timeout`, `tango_get_error_stack`, `tango_open_device`, `tango_ping_device`, `tango_read_attribute`, `tango_read_attributes`, `tango_reload_dev_interface`, `tango_resume_attr_monitor`, `tango_set_attr_monitor_period`, `tango_set_dev_timeout`, `tango_start_attr_monitor`, `tango_stop_attr_monitor`, `tango_suspend_attr_monitor`, `tango_write_attribute`, `tango_write_attributes`, `tanh`, `TDMAddChannel`, `TDMAddGroup`, `TDMAppendDataValues`, `TDMAppendDataValuesTime`, `TDMChannelPropertyExists`, `TDMCloseChannel`, `TDMCloseFile`, `TDMCloseGroup`, `TDMCreateChannelProperty`, `TDMCreateFile`, `TDMCreateFileProperty`, `TDMCreateGroupProperty`, `TDMFilePropertyExists`, `TDMGetChannelPropertyNames`, `TDMGetChannelPropertyNum`, `TDMGetChannelPropertyStr`, `TDMGetChannelPropertyTime`, `TDMGetChannelPropertyType`, `TDMGetChannels`, `TDMGetChannelStringPropertyLen`, `TDMGetDataType`, `TDMGetDataValues`, `TDMGetDataValuesTime`, `TDMGetFilePropertyNames`, `TDMGetFilePropertyNum`, `TDMGetFilePropertyStr`, `TDMGetFilePropertyTime`, `TDMGetFilePropertyType`, `TDMGetFileStringPropertyLen`, `TDMGetGroupPropertyNames`, `TDMGetGroupPropertyNum`, `TDMGetGroupPropertyStr`, `TDMGetGroupPropertyTime`, `TDMGetGroupPropertyType`, `TDMGetGroups`, `TDMGetGroupStringPropertyLen`, `TDMGetLibraryErrorDescription`, `TDMGetNumChannelProperties`, `TDMGetNumChannels`, `TDMGetNumDataValues`, `TDMGetNumFileProperties`, `TDMGetNumGroupProperties`, `TDMGetNumGroups`, `TDMGroupPropertyExists`, `TDMOpenFile`, `TDMOpenFileEx`, `TDMRemoveChannel`, `TDMRemoveGroup`, `TDMReplaceDataValues`, `TDMReplaceDataValuesTime`, `TDMSaveFile`, `TDMSetChannelPropertyNum`, `TDMSetChannelPropertyStr`, `TDMSetChannelPropertyTime`, `TDMSetDataValues`, `TDMSetDataValuesTime`, `TDMSetFilePropertyNum`, `TDMSetFilePropertyStr`, `TDMSetFilePropertyTime`, `TDMSetGroupPropertyNum`, `TDMSetGroupPropertyStr`, `TDMSetGroupPropertyTime`, `TextEncodingCode`, `TextEncodingName`, `TextFile`, `ThreadGroupCreate`, `ThreadGroupGetDF`, `ThreadGroupGetDFR`, `ThreadGroupRelease`, `ThreadGroupWait`, `ThreadProcessorCount`, `ThreadReturnValue`, `ticks`, `time`, `TraceFromPixel`, `TraceInfo`, `TraceNameList`, `TraceNameToWaveRef`, `TrimString`, `trunc`, `UniqueName`, `UnPadString`, `UnsetEnvironmentVariable`, `UpperStr`, `URLDecode`, `URLEncode`, `VariableList`, `Variance`, `vcsr`, `viAssertIntrSignal`, `viAssertTrigger`, `viAssertUtilSignal`, `viClear`, `viClose`, `viDisableEvent`, `viDiscardEvents`, `viEnableEvent`, `viFindNext`, `viFindRsrc`, `viGetAttribute`, `viGetAttributeString`, `viGpibCommand`, `viGpibControlATN`, `viGpibControlREN`, `viGpibPassControl`, `viGpibSendIFC`, `viIn8`, `viIn16`, `viIn32`, `viLock`, `viMapAddress`, `viMapTrigger`, `viMemAlloc`, `viMemFree`, `viMoveIn8`, `viMoveIn16`, `viMoveIn32`, `viMoveOut8`, `viMoveOut16`, `viMoveOut32`, `viOpen`, `viOpenDefaultRM`, `viOut8`, `viOut16`, `viOut32`, `viPeek8`, `viPeek16`, `viPeek32`, `viPoke8`, `viPoke16`, `viPoke32`, `viRead`, `viReadSTB`, `viSetAttribute`, `viSetAttributeString`, `viStatusDesc`, `viTerminate`, `viUnlock`, `viUnmapAddress`, `viUnmapTrigger`, `viUsbControlIn`, `viUsbControlOut`, `viVxiCommandQuery`, `viWaitOnEvent`, `viWrite`, `VoigtFunc`, `VoigtPeak`, `WaveCRC`, `WaveDims`, `WaveExists`, `WaveHash`, `WaveInfo`, `WaveList`, `WaveMax`, `WaveMin`, `WaveName`, `WaveRefIndexed`, `WaveRefIndexedDFR`, `WaveRefsEqual`, `WaveRefWaveToList`, `WaveTextEncoding`, `WaveType`, `WaveUnits`, `WhichListItem`, `WinList`, `WinName`, `WinRecreation`, `WinType`, `wnoise`, `xcsr`, `XWaveName`, `XWaveRefFromTrace`, `x2pnt`, `zcsr`, `ZernikeR`, `zeromq_client_connect`, `zeromq_client_connect`, `zeromq_client_recv`, `zeromq_client_recv`, `zeromq_client_send`, `zeromq_client_send`, `zeromq_handler_start`, `zeromq_handler_start`, `zeromq_handler_stop`, `zeromq_handler_stop`, `zeromq_server_bind`, `zeromq_server_bind`, `zeromq_server_recv`, `zeromq_server_recv`, `zeromq_server_send`, `zeromq_server_send`, `zeromq_set`, `zeromq_set`, `zeromq_stop`, `zeromq_stop`, `zeromq_test_callfunction`, `zeromq_test_callfunction`, `zeromq_test_serializeWave`, `zeromq_test_serializeWave`, `zeta`), NameFunction, nil}, - {`^#(include|pragma|define|undef|ifdef|ifndef|if|elif|else|endif)`, NameDecorator, nil}, - {`[^a-z"/]+$`, Text, nil}, - {`.`, Text, nil}, - {`\n|\r`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/i/ini.go b/vendor/github.com/alecthomas/chroma/lexers/i/ini.go deleted file mode 100644 index 39b5edd2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/i/ini.go +++ /dev/null @@ -1,25 +0,0 @@ -package i - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ini lexer. -var Ini = internal.Register(MustNewLexer( - &Config{ - Name: "INI", - Aliases: []string{"ini", "cfg", "dosini"}, - Filenames: []string{"*.ini", "*.cfg", "*.inf", ".gitconfig"}, - MimeTypes: []string{"text/x-ini", "text/inf"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`[;#].*`, CommentSingle, nil}, - {`\[.*?\]$`, Keyword, nil}, - {`(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)`, ByGroups(NameAttribute, Text, Operator, Text, LiteralString), nil}, - {`(.+?)$`, NameAttribute, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/i/io.go b/vendor/github.com/alecthomas/chroma/lexers/i/io.go deleted file mode 100644 index 840feeaa..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/i/io.go +++ /dev/null @@ -1,40 +0,0 @@ -package i - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Io lexer. -var Io = internal.Register(MustNewLexer( - &Config{ - Name: "Io", - Aliases: []string{"io"}, - Filenames: []string{"*.io"}, - MimeTypes: []string{"text/x-iosrc"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`//(.*?)\n`, CommentSingle, nil}, - {`#(.*?)\n`, CommentSingle, nil}, - {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/\+`, CommentMultiline, Push("nestedcomment")}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}`, Operator, nil}, - {`(clone|do|doFile|doString|method|for|if|else|elseif|then)\b`, Keyword, nil}, - {`(nil|false|true)\b`, NameConstant, nil}, - {`(Object|list|List|Map|args|Sequence|Coroutine|File)\b`, NameBuiltin, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - {`(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - }, - "nestedcomment": { - {`[^+/]+`, CommentMultiline, nil}, - {`/\+`, CommentMultiline, Push()}, - {`\+/`, CommentMultiline, Pop(1)}, - {`[+/]`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/internal/api.go b/vendor/github.com/alecthomas/chroma/lexers/internal/api.go deleted file mode 100644 index 002997a5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/internal/api.go +++ /dev/null @@ -1,160 +0,0 @@ -// Package internal contains common API functions and structures shared between lexer packages. -package internal - -import ( - "path/filepath" - "sort" - "strings" - - "github.com/danwakefield/fnmatch" - - "github.com/alecthomas/chroma" -) - -// Registry of Lexers. -var Registry = struct { - Lexers chroma.Lexers - byName map[string]chroma.Lexer - byAlias map[string]chroma.Lexer -}{ - byName: map[string]chroma.Lexer{}, - byAlias: map[string]chroma.Lexer{}, -} - -// Names of all lexers, optionally including aliases. -func Names(withAliases bool) []string { - out := []string{} - for _, lexer := range Registry.Lexers { - config := lexer.Config() - out = append(out, config.Name) - if withAliases { - out = append(out, config.Aliases...) - } - } - sort.Strings(out) - return out -} - -// Get a Lexer by name, alias or file extension. -func Get(name string) chroma.Lexer { - candidates := chroma.PrioritisedLexers{} - if lexer := Registry.byName[name]; lexer != nil { - candidates = append(candidates, lexer) - } - if lexer := Registry.byAlias[name]; lexer != nil { - candidates = append(candidates, lexer) - } - if lexer := Registry.byName[strings.ToLower(name)]; lexer != nil { - candidates = append(candidates, lexer) - } - if lexer := Registry.byAlias[strings.ToLower(name)]; lexer != nil { - candidates = append(candidates, lexer) - } - // Try file extension. - if lexer := Match("filename." + name); lexer != nil { - candidates = append(candidates, lexer) - } - // Try exact filename. - if lexer := Match(name); lexer != nil { - candidates = append(candidates, lexer) - } - if len(candidates) == 0 { - return nil - } - sort.Sort(candidates) - return candidates[0] -} - -// MatchMimeType attempts to find a lexer for the given MIME type. -func MatchMimeType(mimeType string) chroma.Lexer { - matched := chroma.PrioritisedLexers{} - for _, l := range Registry.Lexers { - for _, lmt := range l.Config().MimeTypes { - if mimeType == lmt { - matched = append(matched, l) - } - } - } - if len(matched) != 0 { - sort.Sort(matched) - return matched[0] - } - return nil -} - -// Match returns the first lexer matching filename. -func Match(filename string) chroma.Lexer { - filename = filepath.Base(filename) - matched := chroma.PrioritisedLexers{} - // First, try primary filename matches. - for _, lexer := range Registry.Lexers { - config := lexer.Config() - for _, glob := range config.Filenames { - if fnmatch.Match(glob, filename, 0) { - matched = append(matched, lexer) - } - } - } - if len(matched) > 0 { - sort.Sort(matched) - return matched[0] - } - matched = nil - // Next, try filename aliases. - for _, lexer := range Registry.Lexers { - config := lexer.Config() - for _, glob := range config.AliasFilenames { - if fnmatch.Match(glob, filename, 0) { - matched = append(matched, lexer) - } - } - } - if len(matched) > 0 { - sort.Sort(matched) - return matched[0] - } - return nil -} - -// Analyse text content and return the "best" lexer.. -func Analyse(text string) chroma.Lexer { - var picked chroma.Lexer - highest := float32(0.0) - for _, lexer := range Registry.Lexers { - if analyser, ok := lexer.(chroma.Analyser); ok { - weight := analyser.AnalyseText(text) - if weight > highest { - picked = lexer - highest = weight - } - } - } - return picked -} - -// Register a Lexer with the global registry. -func Register(lexer chroma.Lexer) chroma.Lexer { - config := lexer.Config() - Registry.byName[config.Name] = lexer - Registry.byName[strings.ToLower(config.Name)] = lexer - for _, alias := range config.Aliases { - Registry.byAlias[alias] = lexer - Registry.byAlias[strings.ToLower(alias)] = lexer - } - Registry.Lexers = append(Registry.Lexers, lexer) - return lexer -} - -// Used for the fallback lexer as well as the explicit plaintext lexer -var PlaintextRules = chroma.Rules{ - "root": []chroma.Rule{ - {`.+`, chroma.Text, nil}, - {`\n`, chroma.Text, nil}, - }, -} - -// Fallback lexer if no other is found. -var Fallback chroma.Lexer = chroma.MustNewLexer(&chroma.Config{ - Name: "fallback", - Filenames: []string{"*"}, -}, PlaintextRules) diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/j.go b/vendor/github.com/alecthomas/chroma/lexers/j/j.go deleted file mode 100644 index 686e53b9..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/j/j.go +++ /dev/null @@ -1,73 +0,0 @@ -package j - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// J lexer. -var J = internal.Register(MustNewLexer( - &Config{ - Name: "J", - Aliases: []string{"j"}, - Filenames: []string{"*.ijs"}, - MimeTypes: []string{"text/x-j"}, - }, - Rules{ - "root": { - {`#!.*$`, CommentPreproc, nil}, - {`NB\..*`, CommentSingle, nil}, - {`\n+\s*Note`, CommentMultiline, Push("comment")}, - {`\s*Note.*`, CommentSingle, nil}, - {`\s+`, Text, nil}, - {`'`, LiteralString, Push("singlequote")}, - {`0\s+:\s*0|noun\s+define\s*$`, NameEntity, Push("nounDefinition")}, - {`(([1-4]|13)\s+:\s*0|(adverb|conjunction|dyad|monad|verb)\s+define)\b`, NameFunction, Push("explicitDefinition")}, - {Words(``, `\b[a-zA-Z]\w*\.`, `for_`, `goto_`, `label_`), NameLabel, nil}, - {Words(``, `\.`, `assert`, `break`, `case`, `catch`, `catchd`, `catcht`, `continue`, `do`, `else`, `elseif`, `end`, `fcase`, `for`, `if`, `return`, `select`, `throw`, `try`, `while`, `whilst`), NameLabel, nil}, - {`\b[a-zA-Z]\w*`, NameVariable, nil}, - {Words(``, ``, `ARGV`, `CR`, `CRLF`, `DEL`, `Debug`, `EAV`, `EMPTY`, `FF`, `JVERSION`, `LF`, `LF2`, `Note`, `TAB`, `alpha17`, `alpha27`, `apply`, `bind`, `boxopen`, `boxxopen`, `bx`, `clear`, `cutLF`, `cutopen`, `datatype`, `def`, `dfh`, `drop`, `each`, `echo`, `empty`, `erase`, `every`, `evtloop`, `exit`, `expand`, `fetch`, `file2url`, `fixdotdot`, `fliprgb`, `getargs`, `getenv`, `hfd`, `inv`, `inverse`, `iospath`, `isatty`, `isutf8`, `items`, `leaf`, `list`, `nameclass`, `namelist`, `names`, `nc`, `nl`, `on`, `pick`, `rows`, `script`, `scriptd`, `sign`, `sminfo`, `smoutput`, `sort`, `split`, `stderr`, `stdin`, `stdout`, `table`, `take`, `timespacex`, `timex`, `tmoutput`, `toCRLF`, `toHOST`, `toJ`, `tolower`, `toupper`, `type`, `ucp`, `ucpcount`, `usleep`, `utf8`, `uucp`), NameFunction, nil}, - {`=[.:]`, Operator, nil}, - {"[-=+*#$%@!~`^&\";:.,<>{}\\[\\]\\\\|/]", Operator, nil}, - {`[abCdDeEfHiIjLMoprtT]\.`, KeywordReserved, nil}, - {`[aDiLpqsStux]\:`, KeywordReserved, nil}, - {`(_[0-9])\:`, KeywordConstant, nil}, - {`\(`, Punctuation, Push("parentheses")}, - Include("numbers"), - }, - "comment": { - {`[^)]`, CommentMultiline, nil}, - {`^\)`, CommentMultiline, Pop(1)}, - {`[)]`, CommentMultiline, nil}, - }, - "explicitDefinition": { - {`\b[nmuvxy]\b`, NameDecorator, nil}, - Include("root"), - {`[^)]`, Name, nil}, - {`^\)`, NameLabel, Pop(1)}, - {`[)]`, Name, nil}, - }, - "numbers": { - {`\b_{1,2}\b`, LiteralNumber, nil}, - {`_?\d+(\.\d+)?(\s*[ejr]\s*)_?\d+(\.?=\d+)?`, LiteralNumber, nil}, - {`_?\d+\.(?=\d+)`, LiteralNumberFloat, nil}, - {`_?\d+x`, LiteralNumberIntegerLong, nil}, - {`_?\d+`, LiteralNumberInteger, nil}, - }, - "nounDefinition": { - {`[^)]`, LiteralString, nil}, - {`^\)`, NameLabel, Pop(1)}, - {`[)]`, LiteralString, nil}, - }, - "parentheses": { - {`\)`, Punctuation, Pop(1)}, - Include("explicitDefinition"), - Include("root"), - }, - "singlequote": { - {`[^']`, LiteralString, nil}, - {`''`, LiteralString, nil}, - {`'`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/java.go b/vendor/github.com/alecthomas/chroma/lexers/j/java.go deleted file mode 100644 index c6b9a762..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/j/java.go +++ /dev/null @@ -1,51 +0,0 @@ -package j - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Java lexer. -var Java = internal.Register(MustNewLexer( - &Config{ - Name: "Java", - Aliases: []string{"java"}, - Filenames: []string{"*.java"}, - MimeTypes: []string{"text/x-java"}, - DotAll: true, - }, - Rules{ - "root": { - {`[^\S\n]+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*.*?\*/`, CommentMultiline, nil}, - {`(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b`, Keyword, nil}, - {`((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil}, - {`@[^\W\d][\w.]*`, NameDecorator, nil}, - {`(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b`, KeywordDeclaration, nil}, - {`(boolean|byte|char|double|float|int|long|short|void)\b`, KeywordType, nil}, - {`(package)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(class|interface)(\s+)`, ByGroups(KeywordDeclaration, Text), Push("class")}, - {`(import(?:\s+static)?)(\s+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil}, - {`(\.)((?:[^\W\d]|\$)[\w$]*)`, ByGroups(Operator, NameAttribute), nil}, - {`^\s*([^\W\d]|\$)[\w$]*:`, NameLabel, nil}, - {`([^\W\d]|\$)[\w$]*`, Name, nil}, - {`([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?`, LiteralNumberFloat, nil}, - {`0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?`, LiteralNumberHex, nil}, - {`0[bB][01][01_]*[lL]?`, LiteralNumberBin, nil}, - {`0[0-7_]+[lL]?`, LiteralNumberOct, nil}, - {`0|[1-9][0-9_]*[lL]?`, LiteralNumberInteger, nil}, - {`[~^*!%&\[\](){}<>|+=:;,./?-]`, Operator, nil}, - {`\n`, Text, nil}, - }, - "class": { - {`([^\W\d]|\$)[\w$]*`, NameClass, Pop(1)}, - }, - "import": { - {`[\w.]+\*?`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go b/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go deleted file mode 100644 index 282501d0..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go +++ /dev/null @@ -1,73 +0,0 @@ -package j - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Javascript lexer. -var JavascriptRules = Rules{ - "commentsandwhitespace": { - {`\s+`, Text, nil}, - {``, `||`, `&&`, `>`, `<`, `>=`, `≥`, `<=`, `≤`, `==`, `===`, `≡`, `!=`, `≠`, `!==`, `≢`, `.>`, `.<`, `.>=`, `.≥`, `.<=`, `.≤`, `.==`, `.!=`, `.≠`, `.=`, `.!`, `<:`, `>:`, `∈`, `∉`, `∋`, `∌`, `⊆`, `⊈`, `⊂`, `⊄`, `⊊`, `|>`, `<|`, `:`, `+`, `-`, `.+`, `.-`, `|`, `∪`, `$`, `<<`, `>>`, `>>>`, `.<<`, `.>>`, `.>>>`, `*`, `/`, `./`, `÷`, `.÷`, `%`, `⋅`, `.%`, `.*`, `\`, `.\`, `&`, `∩`, `//`, `.//`, `^`, `.^`, `::`, `.`, `+`, `-`, `!`, `√`, `∛`, `∜`), Operator, nil}, - {`'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,3}|\\u[a-fA-F0-9]{1,4}|\\U[a-fA-F0-9]{1,6}|[^\\\'\n])'`, LiteralStringChar, nil}, - {`(?<=[.\w)\]])\'+`, Operator, nil}, - {`"""`, LiteralString, Push("tqstring")}, - {`"`, LiteralString, Push("string")}, - {`r"""`, LiteralStringRegex, Push("tqregex")}, - {`r"`, LiteralStringRegex, Push("regex")}, - {"`", LiteralStringBacktick, Push("command")}, - {`((?:[a-zA-Z_¡-￿]|[𐀀-􏿿])(?:[a-zA-Z_0-9¡-￿]|[𐀀-􏿿])*!*)(')?`, ByGroups(Name, Operator), nil}, - {`(@(?:[a-zA-Z_¡-￿]|[𐀀-􏿿])(?:[a-zA-Z_0-9¡-￿]|[𐀀-􏿿])*!*)(')?`, ByGroups(NameDecorator, Operator), nil}, - {`(\d+(_\d+)+\.\d*|\d*\.\d+(_\d+)+)([eEf][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+(_\d+)+[eEf][+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`\d+[eEf][+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`0b[01]+(_[01]+)+`, LiteralNumberBin, nil}, - {`0b[01]+`, LiteralNumberBin, nil}, - {`0o[0-7]+(_[0-7]+)+`, LiteralNumberOct, nil}, - {`0o[0-7]+`, LiteralNumberOct, nil}, - {`0x[a-fA-F0-9]+(_[a-fA-F0-9]+)+`, LiteralNumberHex, nil}, - {`0x[a-fA-F0-9]+`, LiteralNumberHex, nil}, - {`\d+(_\d+)+`, LiteralNumberInteger, nil}, - {`\d+`, LiteralNumberInteger, nil}, - }, - "blockcomment": { - {`[^=#]`, CommentMultiline, nil}, - {`#=`, CommentMultiline, Push()}, - {`=#`, CommentMultiline, Pop(1)}, - {`[=#]`, CommentMultiline, nil}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)`, LiteralStringEscape, nil}, - {`\$(?:[a-zA-Z_¡-￿]|[𐀀-􏿿])(?:[a-zA-Z_0-9¡-￿]|[𐀀-􏿿])*!*`, LiteralStringInterpol, nil}, - {`(\$)(\()`, ByGroups(LiteralStringInterpol, Punctuation), Push("in-intp")}, - {`%[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]`, LiteralStringInterpol, nil}, - {`.|\s`, LiteralString, nil}, - }, - "tqstring": { - {`"""`, LiteralString, Pop(1)}, - {`\\([\\"\'$nrbtfav]|(x|u|U)[a-fA-F0-9]+|\d+)`, LiteralStringEscape, nil}, - {`\$(?:[a-zA-Z_¡-￿]|[𐀀-􏿿])(?:[a-zA-Z_0-9¡-￿]|[𐀀-􏿿])*!*`, LiteralStringInterpol, nil}, - {`(\$)(\()`, ByGroups(LiteralStringInterpol, Punctuation), Push("in-intp")}, - {`.|\s`, LiteralString, nil}, - }, - "regex": { - {`"`, LiteralStringRegex, Pop(1)}, - {`\\"`, LiteralStringRegex, nil}, - {`.|\s`, LiteralStringRegex, nil}, - }, - "tqregex": { - {`"""`, LiteralStringRegex, Pop(1)}, - {`.|\s`, LiteralStringRegex, nil}, - }, - "command": { - {"`", LiteralStringBacktick, Pop(1)}, - {`\$(?:[a-zA-Z_¡-￿]|[𐀀-􏿿])(?:[a-zA-Z_0-9¡-￿]|[𐀀-􏿿])*!*`, LiteralStringInterpol, nil}, - {`(\$)(\()`, ByGroups(LiteralStringInterpol, Punctuation), Push("in-intp")}, - {`.|\s`, LiteralStringBacktick, nil}, - }, - "in-intp": { - {`\(`, Punctuation, Push()}, - {`\)`, Punctuation, Pop(1)}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/jungle.go b/vendor/github.com/alecthomas/chroma/lexers/j/jungle.go deleted file mode 100644 index 83d46a48..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/j/jungle.go +++ /dev/null @@ -1,50 +0,0 @@ -package j - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var Jungle = internal.Register(MustNewLexer( - &Config{ - Name: "Jungle", - Aliases: []string{"jungle"}, - Filenames: []string{"*.jungle"}, - MimeTypes: []string{"text/x-jungle"}, - }, - Rules{ - "root": { - {`[^\S\n]+`, Text, nil}, - {`\n`, Text, nil}, - {`#(\n|[\w\W]*?[^#]\n)`, CommentSingle, nil}, - {`^(?=\S)`, None, Push("instruction")}, - {`[\.;\[\]\(\)\$]`, Punctuation, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "instruction": { - {`[^\S\n]+`, Text, nil}, - {`=`, Operator, Push("value")}, - {`(?=\S)`, None, Push("var")}, - Default(Pop(1)), - }, - "value": { - {`[^\S\n]+`, Text, nil}, - {`\$\(`, Punctuation, Push("var")}, - {`[;\[\]\(\)\$]`, Punctuation, nil}, - {`#(\n|[\w\W]*?[^#]\n)`, CommentSingle, nil}, - {`[\w_\-\.\/\\]+`, Text, nil}, - Default(Pop(1)), - }, - "var": { - {`[^\S\n]+`, Text, nil}, - {`\b(((re)?source|barrel)Path|excludeAnnotations|annotations|lang)\b`, NameBuiltin, nil}, - {`\bbase\b`, NameConstant, nil}, - {`\b(ind|zsm|hrv|ces|dan|dut|eng|fin|fre|deu|gre|hun|ita|nob|po[lr]|rus|sl[ov]|spa|swe|ara|heb|zh[st]|jpn|kor|tha|vie|bul|tur)`, NameConstant, nil}, - {`\b((semi)?round|rectangle)(-\d+x\d+)?\b`, NameConstant, nil}, - {`[\.;\[\]\(\$]`, Punctuation, nil}, - {`\)`, Punctuation, Pop(1)}, - {`[a-zA-Z_]\w*`, Name, nil}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go b/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go deleted file mode 100644 index 56b79660..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go +++ /dev/null @@ -1,55 +0,0 @@ -package k - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var kotlinIdentifier = "_A-Z\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c70\u2c72\u2c75\u2c7e-\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa\uff21-\uff3aa-z\u00b5\u00df-\u00f6\u00f8-\u00ff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0561-\u0587\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u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b\u2cbd\u2cbf\u2cc1\u2cc3\u2cc5\u2cc7\u2cc9\u2ccb\u2ccd\u2ccf\u2cd1\u2cd3\u2cd5\u2cd7\u2cd9\u2cdb\u2cdd\u2cdf\u2ce1\u2ce3-\u2ce4\u2cec\u2cee\u2cf3\u2d00-\u2d25\u2d27\u2d2d\ua641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7fa\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\uaa70\uaadd\uaaf3-\uaaf4\uff70\uff9e-\uff9f\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef][A-Z\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c70\u2c72\u2c75\u2c7e-\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa\uff21-\uff3aa-z\u00b5\u00df-\u00f6\u00f8-\u00ff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0561-\u0587\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u1e4d\u1e4f\u1e51\u1e53\u1e55\u1e57\u1e59\u1e5b\u1e5d\u1e5f\u1e61\u1e63\u1e65\u1e67\u1e69\u1e6b\u1e6d\u1e6f\u1e71\u1e73\u1e75\u1e77\u1e79\u1e7b\u1e7d\u1e7f\u1e81\u1e83\u1e85\u1e87\u1e89\u1e8b\u1e8d\u1e8f\u1e91\u1e93\u1e95-\u1e9d\u1e9f\u1ea1\u1ea3\u1ea5\u1ea7\u1ea9\u1eab\u1ead\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1eb9\u1ebb\u1ebd\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ec9\u1ecb\u1ecd\u1ecf\u1ed1\u1ed3\u1ed5\u1ed7\u1ed9\u1edb\u1edd\u1edf\u1ee1\u1ee3\u1ee5\u1ee7\u1ee9\u1eeb\u1eed\u1eef\u1ef1\u1ef3\u1ef5\u1ef7\u1ef9\u1efb\u1efd\u1eff-\u1f07\u1f10-\u1f15\u1f20-\u1f27\u1f30-\u1f37\u1f40-\u1f45\u1f50-\u1f57\u1f60-\u1f67\u1f70-\u1f7d\u1f80-\u1f87\u1f90-\u1f97\u1fa0-\u1fa7\u1fb0-\u1fb4\u1fb6-\u1fb7\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fc7\u1fd0-\u1fd3\u1fd6-\u1fd7\u1fe0-\u1fe7\u1ff2-\u1ff4\u1ff6-\u1ff7\u210a\u210e-\u210f\u2113\u212f\u2134\u2139\u213c-\u213d\u2146-\u2149\u214e\u2184\u2c30-\u2c5e\u2c61\u2c65-\u2c66\u2c68\u2c6a\u2c6c\u2c71\u2c73-\u2c74\u2c76-\u2c7b\u2c81\u2c83\u2c85\u2c87\u2c89\u2c8b\u2c8d\u2c8f\u2c91\u2c93\u2c95\u2c97\u2c99\u2c9b\u2c9d\u2c9f\u2ca1\u2ca3\u2ca5\u2ca7\u2ca9\u2cab\u2cad\u2caf\u2cb1\u2cb3\u2cb5\u2cb7\u2cb9\u2cbb\u2cbd\u2cbf\u2cc1\u2cc3\u2cc5\u2cc7\u2cc9\u2ccb\u2ccd\u2ccf\u2cd1\u2cd3\u2cd5\u2cd7\u2cd9\u2cdb\u2cdd\u2cdf\u2ce1\u2ce3-\u2ce4\u2cec\u2cee\u2cf3\u2d00-\u2d25\u2d27\u2d2d\ua641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7fa\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\uaa70\uaadd\uaaf3-\uaaf4\uff70\uff9e-\uff9f\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef0-9\u0660-\u0669\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9\uff10-\uff19_\u203f-\u2040\u2054\ufe33-\ufe34\ufe4d-\ufe4f\uff3f\u00ad\u0600-\u0604\u061c\u06dd\u070f\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\ufff9-\ufffb\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09c1-\u09c4\u09cd\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b62-\u0b63\u0b82\u0bc0\u0bcd\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0cbc\u0cbf\u0cc6\u0ccc-\u0ccd\u0ce2-\u0ce3\u0d41-\u0d44\u0d4d\u0d62-\u0d63\u0dca\u0dd2-\u0dd4\u0dd6\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u3099-\u309a\ua66f\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\u0903\u093b\u093e-\u0940\u0949-\u094c\u094e-\u094f\u0982-\u0983\u09be-\u09c0\u09c7-\u09c8\u09cb-\u09cc\u09d7\u0a03\u0a3e-\u0a40\u0a83\u0abe-\u0ac0\u0ac9\u0acb-\u0acc\u0b02-\u0b03\u0b3e\u0b40\u0b47-\u0b48\u0b4b-\u0b4c\u0b57\u0bbe-\u0bbf\u0bc1-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01-\u0c03\u0c41-\u0c44\u0c82-\u0c83\u0cbe\u0cc0-\u0cc4\u0cc7-\u0cc8\u0cca-\u0ccb\u0cd5-\u0cd6\u0d02-\u0d03\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c\u0d57\u0d82-\u0d83\u0dcf-\u0dd1\u0dd8-\u0ddf\u0df2-\u0df3\u0f3e-\u0f3f\u0f7f\u102b-\u102c\u1031\u1038\u103b-\u103c\u1056-\u1057\u1062-\u1064\u1067-\u106d\u1083-\u1084\u1087-\u108c\u108f\u109a-\u109c\u17b6\u17be-\u17c5\u17c7-\u17c8\u1923-\u1926\u1929-\u192b\u1930-\u1931\u1933-\u1938\u19b0-\u19c0\u19c8-\u19c9\u1a19-\u1a1a\u1a55\u1a57\u1a61\u1a63-\u1a64\u1a6d-\u1a72\u1b04\u1b35\u1b3b\u1b3d-\u1b41\u1b43-\u1b44\u1b82\u1ba1\u1ba6-\u1ba7\u1baa\u1bac-\u1bad\u1be7\u1bea-\u1bec\u1bee\u1bf2-\u1bf3\u1c24-\u1c2b\u1c34-\u1c35\u1ce1\u1cf2-\u1cf3\u302e-\u302f\ua823-\ua824\ua827\ua880-\ua881\ua8b4-\ua8c3\ua952-\ua953\ua983\ua9b4-\ua9b5\ua9ba-\ua9bb\ua9bd-\ua9c0\uaa2f-\uaa30\uaa33-\uaa34\uaa4d\uaa7b\uaaeb\uaaee-\uaaef\uaaf5\uabe3-\uabe4\uabe6-\uabe7\uabe9-\uabea\uabec]*|`@?[_A-Z\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c70\u2c72\u2c75\u2c7e-\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa\uff21-\uff3aa-z\u00b5\u00df-\u00f6\u00f8-\u00ff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0561-\u0587\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u1e4d\u1e4f\u1e51\u1e53\u1e55\u1e57\u1e59\u1e5b\u1e5d\u1e5f\u1e61\u1e63\u1e65\u1e67\u1e69\u1e6b\u1e6d\u1e6f\u1e71\u1e73\u1e75\u1e77\u1e79\u1e7b\u1e7d\u1e7f\u1e81\u1e83\u1e85\u1e87\u1e89\u1e8b\u1e8d\u1e8f\u1e91\u1e93\u1e95-\u1e9d\u1e9f\u1ea1\u1ea3\u1ea5\u1ea7\u1ea9\u1eab\u1ead\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1eb9\u1ebb\u1ebd\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ec9\u1ecb\u1ecd\u1ecf\u1ed1\u1ed3\u1ed5\u1ed7\u1ed9\u1edb\u1edd\u1edf\u1ee1\u1ee3\u1ee5\u1ee7\u1ee9\u1eeb\u1eed\u1eef\u1ef1\u1ef3\u1ef5\u1ef7\u1ef9\u1efb\u1efd\u1eff-\u1f07\u1f10-\u1f15\u1f20-\u1f27\u1f30-\u1f37\u1f40-\u1f45\u1f50-\u1f57\u1f60-\u1f67\u1f70-\u1f7d\u1f80-\u1f87\u1f90-\u1f97\u1fa0-\u1fa7\u1fb0-\u1fb4\u1fb6-\u1fb7\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fc7\u1fd0-\u1fd3\u1fd6-\u1fd7\u1fe0-\u1fe7\u1ff2-\u1ff4\u1ff6-\u1ff7\u210a\u210e-\u210f\u2113\u212f\u2134\u2139\u213c-\u213d\u2146-\u2149\u214e\u2184\u2c30-\u2c5e\u2c61\u2c65-\u2c66\u2c68\u2c6a\u2c6c\u2c71\u2c73-\u2c74\u2c76-\u2c7b\u2c81\u2c83\u2c85\u2c87\u2c89\u2c8b\u2c8d\u2c8f\u2c91\u2c93\u2c95\u2c97\u2c99\u2c9b\u2c9d\u2c9f\u2ca1\u2ca3\u2ca5\u2ca7\u2ca9\u2cab\u2cad\u2caf\u2cb1\u2cb3\u2cb5\u2cb7\u2cb9\u2cbb\u2cbd\u2cbf\u2cc1\u2cc3\u2cc5\u2cc7\u2cc9\u2ccb\u2ccd\u2ccf\u2cd1\u2cd3\u2cd5\u2cd7\u2cd9\u2cdb\u2cdd\u2cdf\u2ce1\u2ce3-\u2ce4\u2cec\u2cee\u2cf3\u2d00-\u2d25\u2d27\u2d2d\ua641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7fa\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\uaa70\uaadd\uaaf3-\uaaf4\uff70\uff9e-\uff9f\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef][A-Z\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c70\u2c72\u2c75\u2c7e-\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa\uff21-\uff3aa-z\u00b5\u00df-\u00f6\u00f8-\u00ff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0561-\u0587\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u1e4d\u1e4f\u1e51\u1e53\u1e55\u1e57\u1e59\u1e5b\u1e5d\u1e5f\u1e61\u1e63\u1e65\u1e67\u1e69\u1e6b\u1e6d\u1e6f\u1e71\u1e73\u1e75\u1e77\u1e79\u1e7b\u1e7d\u1e7f\u1e81\u1e83\u1e85\u1e87\u1e89\u1e8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641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7fa\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\uaa70\uaadd\uaaf3-\uaaf4\uff70\uff9e-\uff9f\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef0-9\u0660-\u0669\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9\uff10-\uff19_\u203f-\u2040\u2054\ufe33-\ufe34\ufe4d-\ufe4f\uff3f\u00ad\u0600-\u0604\u061c\u06dd\u070f\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\ufff9-\ufffb\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09c1-\u09c4\u09cd\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b62-\u0b63\u0b82\u0bc0\u0bcd\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0cbc\u0cbf\u0cc6\u0ccc-\u0ccd\u0ce2-\u0ce3\u0d41-\u0d44\u0d4d\u0d62-\u0d63\u0dca\u0dd2-\u0dd4\u0dd6\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u3099-\u309a\ua66f\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\u0903\u093b\u093e-\u0940\u0949-\u094c\u094e-\u094f\u0982-\u0983\u09be-\u09c0\u09c7-\u09c8\u09cb-\u09cc\u09d7\u0a03\u0a3e-\u0a40\u0a83\u0abe-\u0ac0\u0ac9\u0acb-\u0acc\u0b02-\u0b03\u0b3e\u0b40\u0b47-\u0b48\u0b4b-\u0b4c\u0b57\u0bbe-\u0bbf\u0bc1-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01-\u0c03\u0c41-\u0c44\u0c82-\u0c83\u0cbe\u0cc0-\u0cc4\u0cc7-\u0cc8\u0cca-\u0ccb\u0cd5-\u0cd6\u0d02-\u0d03\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c\u0d57\u0d82-\u0d83\u0dcf-\u0dd1\u0dd8-\u0ddf\u0df2-\u0df3\u0f3e-\u0f3f\u0f7f\u102b-\u102c\u1031\u1038\u103b-\u103c\u1056-\u1057\u1062-\u1064\u1067-\u106d\u1083-\u1084\u1087-\u108c\u108f\u109a-\u109c\u17b6\u17be-\u17c5\u17c7-\u17c8\u1923-\u1926\u1929-\u192b\u1930-\u1931\u1933-\u1938\u19b0-\u19c0\u19c8-\u19c9\u1a19-\u1a1a\u1a55\u1a57\u1a61\u1a63-\u1a64\u1a6d-\u1a72\u1b04\u1b35\u1b3b\u1b3d-\u1b41\u1b43-\u1b44\u1b82\u1ba1\u1ba6-\u1ba7\u1baa\u1bac-\u1bad\u1be7\u1bea-\u1bec\u1bee\u1bf2-\u1bf3\u1c24-\u1c2b\u1c34-\u1c35\u1ce1\u1cf2-\u1cf3\u302e-\u302f\ua823-\ua824\ua827\ua880-\ua881\ua8b4-\ua8c3\ua952-\ua953\ua983\ua9b4-\ua9b5\ua9ba-\ua9bb\ua9bd-\ua9c0\uaa2f-\uaa30\uaa33-\uaa34\uaa4d\uaa7b\uaaeb\uaaee-\uaaef\uaaf5\uabe3-\uabe4\uabe6-\uabe7\uabe9-\uabea\uabec" - -// Kotlin lexer. -var Kotlin = internal.Register(MustNewLexer( - &Config{ - Name: "Kotlin", - Aliases: []string{"kotlin"}, - Filenames: []string{"*.kt"}, - MimeTypes: []string{"text/x-kotlin"}, - DotAll: true, - }, - Rules{ - "root": { - {`^\s*\[.*?\]`, NameAttribute, nil}, - {`[^\S\n]+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//[^\n]*\n?`, CommentSingle, nil}, - {`/[*].*?[*]/`, CommentMultiline, nil}, - {`\n`, Text, nil}, - {`::|!!|\?[:.]`, Operator, nil}, - {`[~!%^&*()+=|\[\]:;,.<>/?-]`, Punctuation, nil}, - {`[{}]`, Punctuation, nil}, - {`"""[^"]*"""`, LiteralString, nil}, - {`"(\\\\|\\"|[^"\n])*["\n]`, LiteralString, nil}, - {`'\\.'|'[^\\]'`, LiteralStringChar, nil}, - {`0[xX][0-9a-fA-F]+[Uu]?[Ll]?|[0-9]+(\.[0-9]*)?([eE][+-][0-9]+)?[fF]?[Uu]?[Ll]?`, LiteralNumber, nil}, - {`(companion)(\s+)(object)`, ByGroups(Keyword, Text, Keyword), nil}, - {`(class|interface|object)(\s+)`, ByGroups(Keyword, Text), Push("class")}, - {`(package|import)(\s+)`, ByGroups(Keyword, Text), Push("package")}, - {`(val|var)(\s+)`, ByGroups(Keyword, Text), Push("property")}, - {`(fun)(\s+)(<[^>]*>\s+)?`, ByGroups(Keyword, Text, Text), Push("function")}, - {`(abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|false|final|finally|for|fun|get|if|import|in|infix|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|true|try|val|var|vararg|when|where|while)\b`, Keyword, nil}, - {"(@?[" + kotlinIdentifier + "]*`)", Name, nil}, - }, - "package": { - {`\S+`, NameNamespace, Pop(1)}, - }, - "class": { - {"(@?[" + kotlinIdentifier + "]*`)", NameClass, Pop(1)}, - }, - "property": { - {"(@?[" + kotlinIdentifier + " ]*`)", NameProperty, Pop(1)}, - }, - "function": { - {"(@?[" + kotlinIdentifier + " ]*`)", NameFunction, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/l/lighttpd.go b/vendor/github.com/alecthomas/chroma/lexers/l/lighttpd.go deleted file mode 100644 index 799b77c3..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/l/lighttpd.go +++ /dev/null @@ -1,30 +0,0 @@ -package l - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Lighttpd Configuration File lexer. -var Lighttpd = internal.Register(MustNewLexer( - &Config{ - Name: "Lighttpd configuration file", - Aliases: []string{"lighty", "lighttpd"}, - Filenames: []string{}, - MimeTypes: []string{"text/x-lighttpd-conf"}, - }, - Rules{ - "root": { - {`#.*\n`, CommentSingle, nil}, - {`/\S*`, Name, nil}, - {`[a-zA-Z._-]+`, Keyword, nil}, - {`\d+\.\d+\.\d+\.\d+(?:/\d+)?`, LiteralNumber, nil}, - {`[0-9]+`, LiteralNumber, nil}, - {`=>|=~|\+=|==|=|\+`, Operator, nil}, - {`\$[A-Z]+`, NameBuiltin, nil}, - {`[(){}\[\],]`, Punctuation, nil}, - {`"([^"\\]*(?:\\.[^"\\]*)*)"`, LiteralStringDouble, nil}, - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/l/llvm.go b/vendor/github.com/alecthomas/chroma/lexers/l/llvm.go deleted file mode 100644 index 8f5b0b12..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/l/llvm.go +++ /dev/null @@ -1,43 +0,0 @@ -package l - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Llvm lexer. -var Llvm = internal.Register(MustNewLexer( - &Config{ - Name: "LLVM", - Aliases: []string{"llvm"}, - Filenames: []string{"*.ll"}, - MimeTypes: []string{"text/x-llvm"}, - }, - Rules{ - "root": { - Include("whitespace"), - {`([-a-zA-Z$._][\w\-$.]*|"[^"]*?")\s*:`, NameLabel, nil}, - Include("keyword"), - {`%([-a-zA-Z$._][\w\-$.]*|"[^"]*?")`, NameVariable, nil}, - {`@([-a-zA-Z$._][\w\-$.]*|"[^"]*?")`, NameVariableGlobal, nil}, - {`%\d+`, NameVariableAnonymous, nil}, - {`@\d+`, NameVariableGlobal, nil}, - {`#\d+`, NameVariableGlobal, nil}, - {`!([-a-zA-Z$._][\w\-$.]*|"[^"]*?")`, NameVariable, nil}, - {`!\d+`, NameVariableAnonymous, nil}, - {`c?"[^"]*?"`, LiteralString, nil}, - {`0[xX][a-fA-F0-9]+`, LiteralNumber, nil}, - {`-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?`, LiteralNumber, nil}, - {`[=<>{}\[\]()*.,!]|x\b`, Punctuation, nil}, - }, - "whitespace": { - {`(\n|\s)+`, Text, nil}, - {`;.*?\n`, Comment, nil}, - }, - "keyword": { - {Words(``, `\b`, `begin`, `end`, `true`, `false`, `declare`, `define`, `global`, `constant`, `private`, `linker_private`, `internal`, `available_externally`, `linkonce`, `linkonce_odr`, `weak`, `weak_odr`, `appending`, `dllimport`, `dllexport`, `common`, `default`, `hidden`, `protected`, `extern_weak`, `external`, `thread_local`, `zeroinitializer`, `undef`, `null`, `to`, `tail`, `target`, `triple`, `datalayout`, `volatile`, `nuw`, `nsw`, `nnan`, `ninf`, `nsz`, `arcp`, `fast`, `exact`, `inbounds`, `align`, `addrspace`, `section`, `alias`, `module`, `asm`, `sideeffect`, `gc`, `dbg`, `linker_private_weak`, `attributes`, `blockaddress`, `initialexec`, `localdynamic`, `localexec`, `prefix`, `unnamed_addr`, `ccc`, `fastcc`, `coldcc`, `x86_stdcallcc`, `x86_fastcallcc`, `arm_apcscc`, `arm_aapcscc`, `arm_aapcs_vfpcc`, `ptx_device`, `ptx_kernel`, `intel_ocl_bicc`, `msp430_intrcc`, `spir_func`, `spir_kernel`, `x86_64_sysvcc`, `x86_64_win64cc`, `x86_thiscallcc`, `cc`, `c`, `signext`, `zeroext`, `inreg`, `sret`, `nounwind`, `noreturn`, `noalias`, `nocapture`, `byval`, `nest`, `readnone`, `readonly`, `inlinehint`, `noinline`, `alwaysinline`, `optsize`, `ssp`, `sspreq`, `noredzone`, `noimplicitfloat`, `naked`, `builtin`, `cold`, `nobuiltin`, `noduplicate`, `nonlazybind`, `optnone`, `returns_twice`, `sanitize_address`, `sanitize_memory`, `sanitize_thread`, `sspstrong`, `uwtable`, `returned`, `type`, `opaque`, `eq`, `ne`, `slt`, `sgt`, `sle`, `sge`, `ult`, `ugt`, `ule`, `uge`, `oeq`, `one`, `olt`, `ogt`, `ole`, `oge`, `ord`, `uno`, `ueq`, `une`, `x`, `acq_rel`, `acquire`, `alignstack`, `atomic`, `catch`, `cleanup`, `filter`, `inteldialect`, `max`, `min`, `monotonic`, `nand`, `personality`, `release`, `seq_cst`, `singlethread`, `umax`, `umin`, `unordered`, `xchg`, `add`, `fadd`, `sub`, `fsub`, `mul`, `fmul`, `udiv`, `sdiv`, `fdiv`, `urem`, `srem`, `frem`, `shl`, `lshr`, `ashr`, `and`, `or`, `xor`, `icmp`, `fcmp`, `phi`, `call`, `trunc`, `zext`, `sext`, `fptrunc`, `fpext`, `uitofp`, `sitofp`, `fptoui`, `fptosi`, `inttoptr`, `ptrtoint`, `bitcast`, `addrspacecast`, `select`, `va_arg`, `ret`, `br`, `switch`, `invoke`, `unwind`, `unreachable`, `indirectbr`, `landingpad`, `resume`, `malloc`, `alloca`, `free`, `load`, `store`, `getelementptr`, `extractelement`, `insertelement`, `shufflevector`, `getresult`, `extractvalue`, `insertvalue`, `atomicrmw`, `cmpxchg`, `fence`, `allocsize`, `amdgpu_cs`, `amdgpu_gs`, `amdgpu_kernel`, `amdgpu_ps`, `amdgpu_vs`, `any`, `anyregcc`, `argmemonly`, `avr_intrcc`, `avr_signalcc`, `caller`, `catchpad`, `catchret`, `catchswitch`, `cleanuppad`, `cleanupret`, `comdat`, `convergent`, `cxx_fast_tlscc`, `deplibs`, `dereferenceable`, `dereferenceable_or_null`, `distinct`, `exactmatch`, `externally_initialized`, `from`, `ghccc`, `hhvm_ccc`, `hhvmcc`, `ifunc`, `inaccessiblemem_or_argmemonly`, `inaccessiblememonly`, `inalloca`, `jumptable`, `largest`, `local_unnamed_addr`, `minsize`, `musttail`, `noduplicates`, `none`, `nonnull`, `norecurse`, `notail`, `preserve_allcc`, `preserve_mostcc`, `prologue`, `safestack`, `samesize`, `source_filename`, `swiftcc`, `swifterror`, `swiftself`, `webkit_jscc`, `within`, `writeonly`, `x86_intrcc`, `x86_vectorcallcc`), Keyword, nil}, - {Words(``, ``, `void`, `half`, `float`, `double`, `x86_fp80`, `fp128`, `ppc_fp128`, `label`, `metadata`, `token`), KeywordType, nil}, - {`i[1-9]\d*`, Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/l/lua.go b/vendor/github.com/alecthomas/chroma/lexers/l/lua.go deleted file mode 100644 index c397de06..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/l/lua.go +++ /dev/null @@ -1,75 +0,0 @@ -package l - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Lua lexer. -var Lua = internal.Register(MustNewLexer( - &Config{ - Name: "Lua", - Aliases: []string{"lua"}, - Filenames: []string{"*.lua", "*.wlua"}, - MimeTypes: []string{"text/x-lua", "application/x-lua"}, - }, - Rules{ - "root": { - {`#!.*`, CommentPreproc, nil}, - Default(Push("base")), - }, - "ws": { - {`(?:--\[(=*)\[[\w\W]*?\](\1)\])`, CommentMultiline, nil}, - {`(?:--.*$)`, CommentSingle, nil}, - {`(?:\s+)`, Text, nil}, - }, - "base": { - Include("ws"), - {`(?i)0x[\da-f]*(\.[\da-f]*)?(p[+-]?\d+)?`, LiteralNumberHex, nil}, - {`(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?`, LiteralNumberFloat, nil}, - {`(?i)\d+e[+-]?\d+`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`(?s)\[(=*)\[.*?\]\1\]`, LiteralString, nil}, - {`::`, Punctuation, Push("label")}, - {`\.{3}`, Punctuation, nil}, - {`[=<>|~&+\-*/%#^]+|\.\.`, Operator, nil}, - {`[\[\]{}().,:;]`, Punctuation, nil}, - {`(and|or|not)\b`, OperatorWord, nil}, - {`(break|do|else|elseif|end|for|if|in|repeat|return|then|until|while)\b`, KeywordReserved, nil}, - {`goto\b`, KeywordReserved, Push("goto")}, - {`(local)\b`, KeywordDeclaration, nil}, - {`(true|false|nil)\b`, KeywordConstant, nil}, - {`(function)\b`, KeywordReserved, Push("funcname")}, - {`[A-Za-z_]\w*(\.[A-Za-z_]\w*)?`, Name, nil}, - {`'`, LiteralStringSingle, Combined("stringescape", "sqs")}, - {`"`, LiteralStringDouble, Combined("stringescape", "dqs")}, - }, - "funcname": { - Include("ws"), - {`[.:]`, Punctuation, nil}, - {`(?:[^\W\d]\w*)(?=(?:(?:--\[(=*)\[[\w\W]*?\](\2)\])|(?:--.*$)|(?:\s+))*[.:])`, NameClass, nil}, - {`(?:[^\W\d]\w*)`, NameFunction, Pop(1)}, - {`\(`, Punctuation, Pop(1)}, - }, - "goto": { - Include("ws"), - {`(?:[^\W\d]\w*)`, NameLabel, Pop(1)}, - }, - "label": { - Include("ws"), - {`::`, Punctuation, Pop(1)}, - {`(?:[^\W\d]\w*)`, NameLabel, nil}, - }, - "stringescape": { - {`\\([abfnrtv\\"\']|[\r\n]{1,2}|z\s*|x[0-9a-fA-F]{2}|\d{1,3}|u\{[0-9a-fA-F]+\})`, LiteralStringEscape, nil}, - }, - "sqs": { - {`'`, LiteralStringSingle, Pop(1)}, - {`[^\\']+`, LiteralStringSingle, nil}, - }, - "dqs": { - {`"`, LiteralStringDouble, Pop(1)}, - {`[^\\"]+`, LiteralStringDouble, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/lexers.go b/vendor/github.com/alecthomas/chroma/lexers/lexers.go deleted file mode 100644 index 2897299c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/lexers.go +++ /dev/null @@ -1,59 +0,0 @@ -// Package lexers contains the registry of all lexers. -// -// Sub-packages contain lexer implementations. -package lexers - -// nolint: golint -import ( - "github.com/alecthomas/chroma" - _ "github.com/alecthomas/chroma/lexers/a" - _ "github.com/alecthomas/chroma/lexers/b" - _ "github.com/alecthomas/chroma/lexers/c" - _ "github.com/alecthomas/chroma/lexers/circular" - _ "github.com/alecthomas/chroma/lexers/d" - _ "github.com/alecthomas/chroma/lexers/e" - _ "github.com/alecthomas/chroma/lexers/f" - _ "github.com/alecthomas/chroma/lexers/g" - _ "github.com/alecthomas/chroma/lexers/h" - _ "github.com/alecthomas/chroma/lexers/i" - "github.com/alecthomas/chroma/lexers/internal" - _ "github.com/alecthomas/chroma/lexers/j" - _ "github.com/alecthomas/chroma/lexers/k" - _ "github.com/alecthomas/chroma/lexers/l" - _ "github.com/alecthomas/chroma/lexers/m" - _ "github.com/alecthomas/chroma/lexers/n" - _ "github.com/alecthomas/chroma/lexers/o" - _ "github.com/alecthomas/chroma/lexers/p" - _ "github.com/alecthomas/chroma/lexers/q" - _ "github.com/alecthomas/chroma/lexers/r" - _ "github.com/alecthomas/chroma/lexers/s" - _ "github.com/alecthomas/chroma/lexers/t" - _ "github.com/alecthomas/chroma/lexers/v" - _ "github.com/alecthomas/chroma/lexers/w" - _ "github.com/alecthomas/chroma/lexers/x" - _ "github.com/alecthomas/chroma/lexers/y" -) - -// Registry of Lexers. -var Registry = internal.Registry - -// Names of all lexers, optionally including aliases. -func Names(withAliases bool) []string { return internal.Names(withAliases) } - -// Get a Lexer by name, alias or file extension. -func Get(name string) chroma.Lexer { return internal.Get(name) } - -// MatchMimeType attempts to find a lexer for the given MIME type. -func MatchMimeType(mimeType string) chroma.Lexer { return internal.MatchMimeType(mimeType) } - -// Match returns the first lexer matching filename. -func Match(filename string) chroma.Lexer { return internal.Match(filename) } - -// Analyse text content and return the "best" lexer.. -func Analyse(text string) chroma.Lexer { return internal.Analyse(text) } - -// Register a Lexer with the global registry. -func Register(lexer chroma.Lexer) chroma.Lexer { return internal.Register(lexer) } - -// Fallback lexer if no other is found. -var Fallback = internal.Fallback diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/make.go b/vendor/github.com/alecthomas/chroma/lexers/m/make.go deleted file mode 100644 index eb9d9e68..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/make.go +++ /dev/null @@ -1,54 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - . "github.com/alecthomas/chroma/lexers/b" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Makefile lexer. -var Makefile = internal.Register(MustNewLexer( - &Config{ - Name: "Base Makefile", - Aliases: []string{"make", "makefile", "mf", "bsdmake"}, - Filenames: []string{"*.mak", "*.mk", "Makefile", "makefile", "Makefile.*", "GNUmakefile"}, - MimeTypes: []string{"text/x-makefile"}, - EnsureNL: true, - }, - Rules{ - "root": { - {`^(?:[\t ]+.*\n|\n)+`, Using(Bash), nil}, - {`\$[<@$+%?|*]`, Keyword, nil}, - {`\s+`, Text, nil}, - {`#.*?\n`, Comment, nil}, - {`(export)(\s+)(?=[\w${}\t -]+\n)`, ByGroups(Keyword, Text), Push("export")}, - {`export\s+`, Keyword, nil}, - {`([\w${}().-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)`, ByGroups(NameVariable, Text, Operator, Text, Using(Bash)), nil}, - {`(?s)"(\\\\|\\.|[^"\\])*"`, LiteralStringDouble, nil}, - {`(?s)'(\\\\|\\.|[^'\\])*'`, LiteralStringSingle, nil}, - {`([^\n:]+)(:+)([ \t]*)`, ByGroups(NameFunction, Operator, Text), Push("block-header")}, - {`\$\(`, Keyword, Push("expansion")}, - }, - "expansion": { - {`[^$a-zA-Z_()]+`, Text, nil}, - {`[a-zA-Z_]+`, NameVariable, nil}, - {`\$`, Keyword, nil}, - {`\(`, Keyword, Push()}, - {`\)`, Keyword, Pop(1)}, - }, - "export": { - {`[\w${}-]+`, NameVariable, nil}, - {`\n`, Text, Pop(1)}, - {`\s+`, Text, nil}, - }, - "block-header": { - {`[,|]`, Punctuation, nil}, - {`#.*?\n`, Comment, Pop(1)}, - {`\\\n`, Text, nil}, - {`\$\(`, Keyword, Push("expansion")}, - {`[a-zA-Z_]+`, Name, nil}, - {`\n`, Text, Pop(1)}, - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/mako.go b/vendor/github.com/alecthomas/chroma/lexers/m/mako.go deleted file mode 100644 index f7c140d5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/mako.go +++ /dev/null @@ -1,60 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" - . "github.com/alecthomas/chroma/lexers/p" // nolint -) - -// Mako lexer. -var Mako = internal.Register(MustNewLexer( - &Config{ - Name: "Mako", - Aliases: []string{"mako"}, - Filenames: []string{"*.mao"}, - MimeTypes: []string{"application/x-mako"}, - }, - Rules{ - "root": { - {`(\s*)(%)(\s*end(?:\w+))(\n|\Z)`, ByGroups(Text, CommentPreproc, Keyword, Other), nil}, - {`(\s*)(%)([^\n]*)(\n|\Z)`, ByGroups(Text, CommentPreproc, Using(Python), Other), nil}, - {`(\s*)(##[^\n]*)(\n|\Z)`, ByGroups(Text, CommentPreproc, Other), nil}, - {`(?s)<%doc>.*?`, CommentPreproc, nil}, - {`(<%)([\w.:]+)`, ByGroups(CommentPreproc, NameBuiltin), Push("tag")}, - {`()`, ByGroups(CommentPreproc, NameBuiltin, CommentPreproc), nil}, - {`<%(?=([\w.:]+))`, CommentPreproc, Push("ondeftags")}, - {`(<%(?:!?))(.*?)(%>)(?s)`, ByGroups(CommentPreproc, Using(Python), CommentPreproc), nil}, - {`(\$\{)(.*?)(\})`, ByGroups(CommentPreproc, Using(Python), CommentPreproc), nil}, - {`(?sx) - (.+?) # anything, followed by: - (?: - (?<=\n)(?=%|\#\#) | # an eval or comment line - (?=\#\*) | # multiline comment - (?=`, CommentPreproc, Pop(1)}, - {`\s+`, Text, nil}, - }, - "attr": { - {`".*?"`, LiteralString, Pop(1)}, - {`'.*?'`, LiteralString, Pop(1)}, - {`[^\s>]+`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go b/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go deleted file mode 100644 index 3720da2b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go +++ /dev/null @@ -1,47 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Markdown lexer. -var Markdown = internal.Register(MustNewLexer( - &Config{ - Name: "markdown", - Aliases: []string{"md", "mkd"}, - Filenames: []string{"*.md", "*.mkd", "*.markdown"}, - MimeTypes: []string{"text/x-markdown"}, - }, - Rules{ - "root": { - {`^(#[^#].+\n)`, ByGroups(GenericHeading), nil}, - {`^(#{2,6}.+\n)`, ByGroups(GenericSubheading), nil}, - {`^(\s*)([*-] )(\[[ xX]\])( .+\n)`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, - {`^(\s*)([*-])(\s)(.+\n)`, ByGroups(Text, Keyword, Text, UsingSelf("inline")), nil}, - {`^(\s*)([0-9]+\.)( .+\n)`, ByGroups(Text, Keyword, UsingSelf("inline")), nil}, - {`^(\s*>\s)(.+\n)`, ByGroups(Keyword, GenericEmph), nil}, - {"^(```\\n)([\\w\\W]*?)(^```$)", ByGroups(String, Text, String), nil}, - {"^(```)(\\w+)(\\n)([\\w\\W]*?)(^```$)", - UsingByGroup( - internal.Get, - 2, 4, - String, String, String, Text, String, - ), - nil, - }, - Include("inline"), - }, - "inline": { - {`\\.`, Text, nil}, - {`(\s)([*_][^*_]+[*_])(\W|\n)`, ByGroups(Text, GenericEmph, Text), nil}, - {`(\s)((\*\*|__).*?)\3((?=\W|\n))`, ByGroups(Text, GenericStrong, GenericStrong, Text), nil}, - {`(\s)(~~[^~]+~~)((?=\W|\n))`, ByGroups(Text, GenericDeleted, Text), nil}, - {"`[^`]+`", LiteralStringBacktick, nil}, - {`[@#][\w/:]+`, NameEntity, nil}, - {`(!?\[)([^]]+)(\])(\()([^)]+)(\))`, ByGroups(Text, NameTag, Text, Text, NameAttribute, Text), nil}, - {`[^\\\s]+`, Text, nil}, - {`.|\n`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/mason.go b/vendor/github.com/alecthomas/chroma/lexers/m/mason.go deleted file mode 100644 index 5c70ab0a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/mason.go +++ /dev/null @@ -1,43 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - . "github.com/alecthomas/chroma/lexers/h" // nolint - "github.com/alecthomas/chroma/lexers/internal" - . "github.com/alecthomas/chroma/lexers/p" // nolint -) - -// Mason lexer. -var Mason = internal.Register(MustNewLexer( - &Config{ - Name: "Mason", - Aliases: []string{"mason"}, - Filenames: []string{"*.m", "*.mhtml", "*.mc", "*.mi", "autohandler", "dhandler"}, - MimeTypes: []string{"application/x-mason"}, - Priority: 0.1, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`(<%doc>)(.*?)()(?s)`, ByGroups(NameTag, CommentMultiline, NameTag), nil}, - {`(<%(?:def|method))(\s*)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil}, - {`(<%\w+)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using(Perl), NameTag), nil}, - {`(<&[^|])(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using(Perl), NameTag), nil}, - {`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using(Perl), NameTag), nil}, - {``, NameTag, nil}, - {`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using(Perl), NameTag), nil}, - {`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil}, - {`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using(Perl), Other), nil}, - {`(?sx) - (.+?) # anything, followed by: - (?: - (?<=\n)(?=[%#]) | # an eval or comment line - (?=`, `:>`, `/.`, `+`, `-`, `*`, `/`, `^`, `&&`, `||`, `!`, `<>`, `|`, `/;`, `?`, `@`, `//`, `/@`, `@@`, `@@@`, `~~`, `===`, `&`, `<`, `>`, `<=`, `>=`), Operator, nil}, - {Words(``, ``, `,`, `;`, `(`, `)`, `[`, `]`, `{`, `}`), Punctuation, nil}, - {`".*?"`, LiteralString, nil}, - {`\s+`, TextWhitespace, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/matlab.go b/vendor/github.com/alecthomas/chroma/lexers/m/matlab.go deleted file mode 100644 index 5b0baa51..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/matlab.go +++ /dev/null @@ -1,51 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Matlab lexer. -var Matlab = internal.Register(MustNewLexer( - &Config{ - Name: "Matlab", - Aliases: []string{"matlab"}, - Filenames: []string{"*.m"}, - MimeTypes: []string{"text/matlab"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`^!.*`, LiteralStringOther, nil}, - {`%\{\s*\n`, CommentMultiline, Push("blockcomment")}, - {`%.*$`, Comment, nil}, - {`^\s*function`, Keyword, Push("deffunc")}, - {Words(``, `\b`, `break`, `case`, `catch`, `classdef`, `continue`, `else`, `elseif`, `end`, `enumerated`, `events`, `for`, `function`, `global`, `if`, `methods`, `otherwise`, `parfor`, `persistent`, `properties`, `return`, `spmd`, `switch`, `try`, `while`), Keyword, nil}, - {`(sin|sind|sinh|asin|asind|asinh|cos|cosd|cosh|acos|acosd|acosh|tan|tand|tanh|atan|atand|atan2|atanh|sec|secd|sech|asec|asecd|asech|csc|cscd|csch|acsc|acscd|acsch|cot|cotd|coth|acot|acotd|acoth|hypot|exp|expm1|log|log1p|log10|log2|pow2|realpow|reallog|realsqrt|sqrt|nthroot|nextpow2|abs|angle|complex|conj|imag|real|unwrap|isreal|cplxpair|fix|floor|ceil|round|mod|rem|sign|airy|besselj|bessely|besselh|besseli|besselk|beta|betainc|betaln|ellipj|ellipke|erf|erfc|erfcx|erfinv|expint|gamma|gammainc|gammaln|psi|legendre|cross|dot|factor|isprime|primes|gcd|lcm|rat|rats|perms|nchoosek|factorial|cart2sph|cart2pol|pol2cart|sph2cart|hsv2rgb|rgb2hsv|zeros|ones|eye|repmat|rand|randn|linspace|logspace|freqspace|meshgrid|accumarray|size|length|ndims|numel|disp|isempty|isequal|isequalwithequalnans|cat|reshape|diag|blkdiag|tril|triu|fliplr|flipud|flipdim|rot90|find|end|sub2ind|ind2sub|bsxfun|ndgrid|permute|ipermute|shiftdim|circshift|squeeze|isscalar|isvector|ans|eps|realmax|realmin|pi|i|inf|nan|isnan|isinf|isfinite|j|why|compan|gallery|hadamard|hankel|hilb|invhilb|magic|pascal|rosser|toeplitz|vander|wilkinson)\b`, NameBuiltin, nil}, - {`\.\.\..*$`, Comment, nil}, - {`-|==|~=|<|>|<=|>=|&&|&|~|\|\|?`, Operator, nil}, - {`\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\`, Operator, nil}, - {`\[|\]|\(|\)|\{|\}|:|@|\.|,`, Punctuation, nil}, - {`=|:|;`, Punctuation, nil}, - {`(?<=[\w)\].])\'+`, Operator, nil}, - {`(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+[eEf][+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`(?|->|<-|\\/|xor|/\\)`, Operator, nil}, - {`(<|>|<=|>=|==|=|!=)`, Operator, nil}, - {`(\+|-|\*|/|div|mod)`, Operator, nil}, - {Words(`\b`, `\b`, `in`, `subset`, `superset`, `union`, `diff`, `symdiff`, `intersect`), Operator, nil}, - {`(\\|\.\.|\+\+)`, Operator, nil}, - {`[|()\[\]{},:;]`, Punctuation, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`([+-]?)\d+(\.(?!\.)\d*)?([eE][-+]?\d+)?`, LiteralNumber, nil}, - {`::\s*([^\W\d]\w*)(\s*\([^\)]*\))?`, NameDecorator, nil}, - {`\b([^\W\d]\w*)\b(\()`, ByGroups(NameFunction, Punctuation), nil}, - {`[^\W\d]\w*`, NameOther, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/mlir.go b/vendor/github.com/alecthomas/chroma/lexers/m/mlir.go deleted file mode 100644 index 2ae4b00b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/mlir.go +++ /dev/null @@ -1,43 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// MLIR lexer. -var Mlir = internal.Register(MustNewLexer( - &Config{ - Name: "MLIR", - Aliases: []string{"mlir"}, - Filenames: []string{"*.mlir"}, - MimeTypes: []string{"text/x-mlir"}, - }, - Rules{ - "root": { - Include("whitespace"), - {`c?"[^"]*?"`, LiteralString, nil}, - {`\^([-a-zA-Z$._][\w\-$.0-9]*)\s*`, NameLabel, nil}, - {`([\w\d_$.]+)\s*=`, NameLabel, nil}, - Include("keyword"), - {`->`, Punctuation, nil}, - {`@([\w_][\w\d_$.]*)`, NameFunction, nil}, - {`[%#][\w\d_$.]+`, NameVariable, nil}, - {`([1-9?][\d?]*\s*x)+`, LiteralNumber, nil}, - {`0[xX][a-fA-F0-9]+`, LiteralNumber, nil}, - {`-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?`, LiteralNumber, nil}, - {`[=<>{}\[\]()*.,!:]|x\b`, Punctuation, nil}, - {`[\w\d]+`, Text, nil}, - }, - "whitespace": { - {`(\n|\s)+`, Text, nil}, - {`//.*?\n`, Comment, nil}, - }, - "keyword": { - {Words(``, ``, `constant`, `return`), KeywordType, nil}, - {Words(``, ``, `func`, `loc`, `memref`, `tensor`, `vector`), KeywordType, nil}, - {`bf16|f16|f32|f64|index`, Keyword, nil}, - {`i[1-9]\d*`, Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/modula2.go b/vendor/github.com/alecthomas/chroma/lexers/m/modula2.go deleted file mode 100644 index 6fadb79f..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/modula2.go +++ /dev/null @@ -1,115 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Modula-2 lexer. -var Modula2 = internal.Register(MustNewLexer( - &Config{ - Name: "Modula-2", - Aliases: []string{"modula2", "m2"}, - Filenames: []string{"*.def", "*.mod"}, - MimeTypes: []string{"text/x-modula2"}, - DotAll: true, - }, - Rules{ - "whitespace": { - {`\n+`, Text, nil}, - {`\s+`, Text, nil}, - }, - "dialecttags": { - {`\(\*!m2pim\*\)`, CommentSpecial, nil}, - {`\(\*!m2iso\*\)`, CommentSpecial, nil}, - {`\(\*!m2r10\*\)`, CommentSpecial, nil}, - {`\(\*!objm2\*\)`, CommentSpecial, nil}, - {`\(\*!m2iso\+aglet\*\)`, CommentSpecial, nil}, - {`\(\*!m2pim\+gm2\*\)`, CommentSpecial, nil}, - {`\(\*!m2iso\+p1\*\)`, CommentSpecial, nil}, - {`\(\*!m2iso\+xds\*\)`, CommentSpecial, nil}, - }, - "identifiers": { - {`([a-zA-Z_$][\w$]*)`, Name, nil}, - }, - "prefixed_number_literals": { - {`0b[01]+(\'[01]+)*`, LiteralNumberBin, nil}, - {`0[ux][0-9A-F]+(\'[0-9A-F]+)*`, LiteralNumberHex, nil}, - }, - "plain_number_literals": { - {`[0-9]+(\'[0-9]+)*\.[0-9]+(\'[0-9]+)*[eE][+-]?[0-9]+(\'[0-9]+)*`, LiteralNumberFloat, nil}, - {`[0-9]+(\'[0-9]+)*\.[0-9]+(\'[0-9]+)*`, LiteralNumberFloat, nil}, - {`[0-9]+(\'[0-9]+)*`, LiteralNumberInteger, nil}, - }, - "suffixed_number_literals": { - {`[0-7]+B`, LiteralNumberOct, nil}, - {`[0-7]+C`, LiteralNumberOct, nil}, - {`[0-9A-F]+H`, LiteralNumberHex, nil}, - }, - "string_literals": { - {`'(\\\\|\\'|[^'])*'`, LiteralString, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - }, - "digraph_operators": { - {`\*\.`, Operator, nil}, - {`\+>`, Operator, nil}, - {`<>`, Operator, nil}, - {`<=`, Operator, nil}, - {`>=`, Operator, nil}, - {`==`, Operator, nil}, - {`::`, Operator, nil}, - {`:=`, Operator, nil}, - {`\+\+`, Operator, nil}, - {`--`, Operator, nil}, - }, - "unigraph_operators": { - {`[+-]`, Operator, nil}, - {`[*/]`, Operator, nil}, - {`\\`, Operator, nil}, - {`[=#<>]`, Operator, nil}, - {`\^`, Operator, nil}, - {`@`, Operator, nil}, - {`&`, Operator, nil}, - {`~`, Operator, nil}, - {"`", Operator, nil}, - }, - "digraph_punctuation": { - {`\.\.`, Punctuation, nil}, - {`<<`, Punctuation, nil}, - {`>>`, Punctuation, nil}, - {`->`, Punctuation, nil}, - {`\|#`, Punctuation, nil}, - {`##`, Punctuation, nil}, - {`\|\*`, Punctuation, nil}, - }, - "unigraph_punctuation": { - {`[()\[\]{},.:;|]`, Punctuation, nil}, - {`!`, Punctuation, nil}, - {`\?`, Punctuation, nil}, - }, - "comments": { - {`^//.*?\n`, CommentSingle, nil}, - {`\(\*([^$].*?)\*\)`, CommentMultiline, nil}, - {`/\*(.*?)\*/`, CommentMultiline, nil}, - }, - "pragmas": { - {`<\*.*?\*>`, CommentPreproc, nil}, - {`\(\*\$.*?\*\)`, CommentPreproc, nil}, - }, - "root": { - Include("whitespace"), - Include("dialecttags"), - Include("pragmas"), - Include("comments"), - Include("identifiers"), - Include("suffixed_number_literals"), - Include("prefixed_number_literals"), - Include("plain_number_literals"), - Include("string_literals"), - Include("digraph_punctuation"), - Include("digraph_operators"), - Include("unigraph_punctuation"), - Include("unigraph_operators"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/monkeyc.go b/vendor/github.com/alecthomas/chroma/lexers/m/monkeyc.go deleted file mode 100644 index 828ff0bf..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/monkeyc.go +++ /dev/null @@ -1,62 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var MonkeyC = internal.Register(MustNewLexer( - &Config{ - Name: "MonkeyC", - Aliases: []string{"monkeyc"}, - Filenames: []string{"*.mc"}, - MimeTypes: []string{"text/x-monkeyc"}, - }, - Rules{ - "root": { - {`[^\S\n]+`, Text, nil}, - {`\n`, Text, nil}, - {`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil}, - {`:[a-zA-Z_][\w_\.]*`, StringSymbol, nil}, - {`[{}\[\]\(\),;:\.]`, Punctuation, nil}, - {`[&~\|\^!+\-*\/%=?]`, Operator, nil}, - {`=>|[+-]=|&&|\|\||>>|<<|[<>]=?|[!=]=`, Operator, nil}, - {`\b(and|or|instanceof|has|extends|new)`, OperatorWord, nil}, - {Words(``, `\b`, `NaN`, `null`, `true`, `false`), KeywordConstant, nil}, - {`(using)((?:\s|\\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - {`(class)((?:\s|\\\\s)+)`, ByGroups(KeywordDeclaration, Text), Push("class")}, - {`(function)((?:\s|\\\\s)+)`, ByGroups(KeywordDeclaration, Text), Push("function")}, - {`(module)((?:\s|\\\\s)+)`, ByGroups(KeywordDeclaration, Text), Push("module")}, - {`\b(if|else|for|switch|case|while|break|continue|default|do|try|catch|finally|return|throw|extends|function)\b`, Keyword, nil}, - {`\b(const|enum|hidden|public|protected|private|static)\b`, KeywordType, nil}, - {`\bvar\b`, KeywordDeclaration, nil}, - {`\b(Activity(Monitor|Recording)?|Ant(Plus)?|Application|Attention|Background|Communications|Cryptography|FitContributor|Graphics|Gregorian|Lang|Math|Media|Persisted(Content|Locations)|Position|Properties|Sensor(History|Logging)?|Storage|StringUtil|System|Test|Time(r)?|Toybox|UserProfile|WatchUi|Rez|Drawables|Strings|Fonts|method)\b`, NameBuiltin, nil}, - {`\b(me|self|\$)\b`, NameBuiltinPseudo, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^''])*'`, LiteralStringSingle, nil}, - {`-?(0x[0-9a-fA-F]+l?)`, NumberHex, nil}, - {`-?([0-9]+(\.[0-9]+[df]?|[df]))\b`, NumberFloat, nil}, - {`-?([0-9]+l?)`, NumberInteger, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "import": { - {`([a-zA-Z_][\w_\.]*)(?:(\s+)(as)(\s+)([a-zA-Z_][\w_]*))?`, ByGroups(NameNamespace, Text, KeywordNamespace, Text, NameNamespace), nil}, - Default(Pop(1)), - }, - "class": { - {`([a-zA-Z_][\w_\.]*)(?:(\s+)(extends)(\s+)([a-zA-Z_][\w_\.]*))?`, ByGroups(NameClass, Text, KeywordDeclaration, Text, NameClass), nil}, - Default(Pop(1)), - }, - "function": { - {`initialize`, NameFunctionMagic, nil}, - {`[a-zA-Z_][\w_\.]*`, NameFunction, nil}, - Default(Pop(1)), - }, - "module": { - {`[a-zA-Z_][\w_\.]*`, NameNamespace, nil}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/mwscript.go b/vendor/github.com/alecthomas/chroma/lexers/m/mwscript.go deleted file mode 100644 index b86bbdfe..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/mwscript.go +++ /dev/null @@ -1,53 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// MorrowindScript lexer. -var MorrowindScript = internal.Register(MustNewLexer( - &Config{ - Name: "MorrowindScript", - Aliases: []string{"morrowind", "mwscript"}, - Filenames: []string{}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`;.*$`, Comment, nil}, - {`(["'])(?:(?=(\\?))\2.)*?\1`, LiteralString, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`[0-9]+\.[0-9]*(?!\.)`, LiteralNumberFloat, nil}, - Include("keywords"), - Include("types"), - Include("builtins"), - Include("punct"), - Include("operators"), - {`\n`, Text, nil}, - {`\S+\s+`, Text, nil}, - {`[a-zA-Z0-9_]\w*`, Name, nil}, - }, - "keywords": { - {`(?i)(begin|if|else|elseif|endif|while|endwhile|return|to)\b`, Keyword, nil}, - {`(?i)(end)\b`, Keyword, nil}, - {`(?i)(end)\w+.*$`, Text, nil}, - {`[\w+]->[\w+]`, Operator, nil}, - }, - "builtins": { - {`(?i)(Activate|AddItem|AddSoulGem|AddSpell|AddToLevCreature|AddToLevItem|AddTopic|AIActivate|AIEscort|AIEscortCell|AIFollow|AiFollowCell|AITravel|AIWander|BecomeWerewolf|Cast|ChangeWeather|Choice|ClearForceJump|ClearForceMoveJump|ClearForceRun|ClearForceSneak|ClearInfoActor|Disable|DisableLevitation|DisablePlayerControls|DisablePlayerFighting|DisablePlayerJumping|DisablePlayerLooking|DisablePlayerMagic|DisablePlayerViewSwitch|DisableTeleporting|DisableVanityMode|DontSaveObject|Drop|Enable|EnableBirthMenu|EnableClassMenu|EnableInventoryMenu|EnableLevelUpMenu|EnableLevitation|EnableMagicMenu|EnableMapMenu|EnableNameMenu|EnablePlayerControls|EnablePlayerFighting|EnablePlayerJumping|EnablePlayerLooking|EnablePlayerMagic|EnablePlayerViewSwitch|EnableRaceMenu|EnableRest|EnableStatsMenu|EnableTeleporting|EnableVanityMode|Equip|ExplodeSpell|Face|FadeIn|FadeOut|FadeTo|Fall|ForceGreeting|ForceJump|ForceRun|ForceSneak|Flee|GotoJail|HurtCollidingActor|HurtStandingActor|Journal|Lock|LoopGroup|LowerRank|MenuTest|MessageBox|ModAcrobatics|ModAgility|ModAlarm|ModAlchemy|ModAlteration|ModArmorBonus|ModArmorer|ModAthletics|ModAttackBonus|ModAxe|ModBlock|ModBluntWeapon|ModCastPenalty|ModChameleon|ModConjuration|ModCurrentFatigue|ModCurrentHealth|ModCurrentMagicka|ModDefendBonus|ModDestruction|ModDisposition|ModEnchant|ModEndurance|ModFactionReaction|ModFatigue|ModFight|ModFlee|ModFlying|ModHandToHand|ModHealth|ModHeavyArmor|ModIllusion|ModIntelligence|ModInvisible|ModLightArmor|ModLongBlade|ModLuck|ModMagicka|ModMarksman|ModMediumArmor|ModMercantile|ModMysticism|ModParalysis|ModPCCrimeLevel|ModPCFacRep|ModPersonality|ModRegion|ModReputation|ModResistBlight|ModResistCorprus|ModResistDisease|ModResistFire|ModResistFrost|ModResistMagicka|ModResistNormalWeapons|ModResistParalysis|ModResistPoison|ModResistShock|ModRestoration|ModScale|ModSecurity|ModShortBlade|ModSilence|ModSneak|ModSpear|ModSpeechcraft|ModSpeed|ModStrength|ModSuperJump|ModSwimSpeed|ModUnarmored|ModWaterBreathing|ModWaterLevel|ModWaterWalking|ModWillpower|Move|MoveWorld|PayFine|PayFineThief|PCClearExpelled|PCExpell|PCForce1stPerson|PCForce3rdPerson|PCJoinFaction|PCLowerRank|PCRaiseRank|PlaceAtMe|PlaceAtPC|PlaceItem|PlaceItemCell|PlayBink|PlayGroup|PlayLoopSound3D|PlayLoopSound3DVP|PlaySound|PlaySound3D|PlaySound3DVP|PlaySoundVP|Position|PositionCell|RaiseRank|RemoveEffects|RemoveFromLevCreature|RemoveFromLevItem|RemoveItem|RemoveSoulgem|RemoveSpell|RemoveSpellEffects|ResetActors|Resurrect|Rotate|RotateWorld|Say|StartScript|[S|s]et|SetAcrobatics|SetAgility|SetAlarm|SetAlchemy|SetAlteration|SetAngle|SetArmorBonus|SetArmorer|SetAthletics|SetAtStart|SetAttackBonus|SetAxe|SetBlock|SetBluntWeapon|SetCastPenalty|SetChameleon|SetConjuration|SetDelete|SetDefendBonus|SetDestruction|SetDisposition|SetEnchant|SetEndurance|SetFactionReaction|SetFatigue|SetFight|SetFlee|SetFlying|SetHandToHand|SetHealth|SetHeavyArmor|SetIllusion|SetIntelligence|SetInvisible|SetJournalIndex|SetLightArmor|SetLevel|SetLongBlade|SetLuck|SetMagicka|SetMarksman|SetMediumArmor|SetMercantile|SetMysticism|SetParalysis|SetPCCCrimeLevel|SetPCFacRep|SetPersonality|SetPos|SetReputation|SetResistBlight|SetResistCorprus|SetResistDisease|SetResistFire|SetResistFrost|SetResistMagicka|SetResistNormalWeapons|SetResistParalysis|SetResistPoison|SetResistShock|SetRestoration|SetScale|SetSecurity|SetShortBlade|SetSilence|SetSneak|SetSpear|SetSpeechcraft|SetSpeed|SetStrength|SetSuperJump|SetSwimSpeed|SetUnarmored|SetWaterBreathing|SetWaterlevel|SetWaterWalking|SetWerewolfAcrobatics|SetWillpower|ShowMap|ShowRestMenu|SkipAnim|StartCombat|StopCombat|StopScript|StopSound|StreamMusic|TurnMoonRed|TurnMoonWhite|UndoWerewolf|Unlock|WakeUpPC|CenterOnCell|CenterOnExterior|FillMap|FixMe|ToggleAI|ToggleCollision|ToggleFogOfWar|ToggleGodMode|ToggleMenus|ToggleSky|ToggleWorld|ToggleVanityMode|CellChanged|GetAcrobatics|GetAgility|GetAIPackageDone|GetAlarm|GetAlchemy|GetAlteration|GetAngle|GetArmorBonus|GetArmorer|GetAthletics|GetAttackBonus|GetAttacked|GetArmorType,|GetAxe|GetBlightDisease|GetBlock|GetBluntWeapon|GetButtonPressed|GetCastPenalty|GetChameleon|GetCollidingActor|GetCollidingPC|GetCommonDisease|GetConjuration|GetCurrentAIPackage|GetCurrentTime|GetCurrentWeather|GetDeadCount|GetDefendBonus|GetDestruction|GetDetected|GetDisabled|GetDisposition|GetDistance|GetEffect|GetEnchant|GetEndurance|GetFatigue|GetFight|GetFlee|GetFlying|GetForceJump|GetForceRun|GetForceSneak|GetHandToHand|GetHealth|GetHealthGetRatio|GetHeavyArmor|GetIllusion|GetIntelligence|GetInterior|GetInvisible|GetItemCount|GetJournalIndex|GetLightArmor|GetLineOfSight|GetLOS|GetLevel|GetLocked|GetLongBlade|GetLuck|GetMagicka|GetMarksman|GetMasserPhase|GetSecundaPhase|GetMediumArmor|GetMercantile|GetMysticism|GetParalysis|GetPCCell|GetPCCrimeLevel|GetPCinJail|GetPCJumping|GetPCRank|GetPCRunning|GetPCSleep|GetPCSneaking|GetPCTraveling|GetPersonality|GetPlayerControlsDisabled|GetPlayerFightingDisabled|GetPlayerJumpingDisabled|GetPlayerLookingDisabled|GetPlayerMagicDisabled|GetPos|GetRace|GetReputation|GetResistBlight|GetResistCorprus|GetResistDisease|GetResistFire|GetResistFrost|GetResistMagicka|GetResistNormalWeapons|GetResistParalysis|GetResistPoison|GetResistShock|GetRestoration|GetScale|GetSecondsPassed|GetSecurity|GetShortBlade|GetSilence|GetSneak|GetSoundPlaying|GetSpear|GetSpeechcraft|GetSpeed|GetSpell|GetSpellEffects|GetSpellReadied|GetSquareRoot|GetStandingActor|GetStandingPC|GetStrength|GetSuperJump|GetSwimSpeed|GetTarget|GetUnarmored|GetVanityModeDisabled|GetWaterBreathing|GetWaterLevel|GetWaterWalking|GetWeaponDrawn|GetWeaponType|GetWerewolfKills|GetWillpower|GetWindSpeed|HasItemEquipped|HasSoulgem|HitAttemptOnMe|HitOnMe|IsWerewolf|MenuMode|OnActivate|OnDeath|OnKnockout|OnMurder|PCExpelled|PCGet3rdPerson|PCKnownWerewolf|Random|RepairedOnMe|SameFaction|SayDone|ScriptRunning|AllowWereWolfForceGreeting|Companion|MinimumProfit|NoFlee|NoHello|NoIdle|NoLore|OnPCAdd|OnPCDrop|OnPCEquip|OnPCHitMe|OnPCRepair|PCSkipEquip|OnPCSoulGemUse|StayOutside|CrimeGoldDiscount|CrimeGoldTurnIn|Day|DaysPassed|GameHour|Month|NPCVoiceDistance|PCRace|PCWerewolf|PCVampire|TimeScale|VampClan|Year)\b`, NameBuiltin, nil}, - {`(?i)(sEffectWaterBreathing|sEffectSwiftSwim|sEffectWaterWalking|sEffectShield|sEffectFireShield|sEffectLightningShield|sEffectFrostShield|sEffectBurden|sEffectFeather|sEffectJump|sEffectLevitate|sEffectSlowFall|sEffectLock|sEffectOpen|sEffectFireDamage|sEffectShockDamage|sEffectFrostDamage|sEffectDrainAttribute|sEffectDrainHealth|sEffectDrainSpellpoints|sEffectDrainFatigue|sEffectDrainSkill|sEffectDamageAttribute|sEffectDamageHealth|sEffectDamageMagicka|sEffectDamageFatigue|sEffectDamageSkill|sEffectPoison|sEffectWeaknessToFire|sEffectWeaknessToFrost|sEffectWeaknessToShock|sEffectWeaknessToMagicka|sEffectWeaknessToCommonDisease|sEffectWeaknessToBlightDisease|sEffectWeaknessToCorprusDisease|sEffectWeaknessToPoison|sEffectWeaknessToNormalWeapons|sEffectDisintegrateWeapon|sEffectDisintegrateArmor|sEffectInvisibility|sEffectChameleon|sEffectLight|sEffectSanctuary|sEffectNightEye|sEffectCharm|sEffectParalyze|sEffectSilence|sEffectBlind|sEffectSound|sEffectCalmHumanoid|sEffectCalmCreature|sEffectFrenzyHumanoid|sEffectFrenzyCreature|sEffectDemoralizeHumanoid|sEffectDemoralizeCreature|sEffectRallyHumanoid|sEffectRallyCreature|sEffectDispel|sEffectSoultrap|sEffectTelekinesis|sEffectMark|sEffectRecall|sEffectDivineIntervention|sEffectAlmsiviIntervention|sEffectDetectAnimal|sEffectDetectEnchantment|sEffectDetectKey|sEffectSpellAbsorption|sEffectReflect|sEffectCureCommonDisease|sEffectCureBlightDisease|sEffectCureCorprusDisease|sEffectCurePoison|sEffectCureParalyzation|sEffectRestoreAttribute|sEffectRestoreHealth|sEffectRestoreSpellPoints|sEffectRestoreFatigue|sEffectRestoreSkill|sEffectFortifyAttribute|sEffectFortifyHealth|sEffectFortifySpellpoints|sEffectFortifyFatigue|sEffectFortifySkill|sEffectFortifyMagickaMultiplier|sEffectAbsorbAttribute|sEffectAbsorbHealth|sEffectAbsorbSpellPoints|sEffectAbsorbFatigue|sEffectAbsorbSkill|sEffectResistFire|sEffectResistFrost|sEffectResistShock|sEffectResistMagicka|sEffectResistCommonDisease|sEffectResistBlightDisease|sEffectResistCorprusDisease|sEffectResistPoison|sEffectResistNormalWeapons|sEffectResistParalysis|sEffectRemoveCurse|sEffectTurnUndead|sEffectSummonScamp|sEffectSummonClannfear|sEffectSummonDaedroth|sEffectSummonDremora|sEffectSummonAncestralGhost|sEffectSummonSkeletalMinion|sEffectSummonLeastBonewalker|sEffectSummonGreaterBonewalker|sEffectSummonBonelord|sEffectSummonWingedTwilight|sEffectSummonHunger|sEffectSummonGoldensaint|sEffectSummonFlameAtronach|sEffectSummonFrostAtronach|sEffectSummonStormAtronach|sEffectFortifyAttackBonus|sEffectCommandCreatures|sEffectCommandHumanoids|sEffectBoundDagger|sEffectBoundLongsword|sEffectBoundMace|sEffectBoundBattleAxe|sEffectBoundSpear|sEffectBoundLongbow|sEffectExtraSpell|sEffectBoundCuirass|sEffectBoundHelm|sEffectBoundBoots|sEffectBoundShield|sEffectBoundGloves|sEffectCorpus|sEffectVampirism|sEffectSummonCenturionSphere|sEffectSunDamage|sEffectStuntedMagicka)`, NameBuiltin, nil}, - }, - "types": { - {`(?i)(short|long|float)\b`, KeywordType, nil}, - }, - "punct": { - {`[()]`, Punctuation, nil}, - }, - "operators": { - {`[#=,./%+\-?]`, Operator, nil}, - {`(==|<=|<|>=|>|!=)`, Operator, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/myghty.go b/vendor/github.com/alecthomas/chroma/lexers/m/myghty.go deleted file mode 100644 index 02a20eae..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/m/myghty.go +++ /dev/null @@ -1,40 +0,0 @@ -package m - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" - . "github.com/alecthomas/chroma/lexers/p" // nolint -) - -// Myghty lexer. -var Myghty = internal.Register(MustNewLexer( - &Config{ - Name: "Myghty", - Aliases: []string{"myghty"}, - Filenames: []string{"*.myt", "autodelegate"}, - MimeTypes: []string{"application/x-myghty"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`(<%(?:def|method))(\s*)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil}, - {`(<%\w+)(.*?)(>)(.*?)()(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using(Python), NameTag), nil}, - {`(<&[^|])(.*?)(,.*?)?(&>)`, ByGroups(NameTag, NameFunction, Using(Python), NameTag), nil}, - {`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using(Python), NameTag), nil}, - {``, NameTag, nil}, - {`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using(Python), NameTag), nil}, - {`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil}, - {`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using(Python), Other), nil}, - {`(?sx) - (.+?) # anything, followed by: - (?: - (?<=\n)(?=[%#]) | # an eval or comment line - (?==~!@#%^&|`?-]", Operator, nil}, - {`\b(tinyint|smallint|mediumint|int|integer|bigint|date|datetime|time|bit|bool|tinytext|mediumtext|longtext|text|tinyblob|mediumblob|longblob|blob|float|double|double\s+precision|real|numeric|dec|decimal|timestamp|year|char|varchar|varbinary|varcharacter|enum|set)(\b\s*)(\()?`, ByGroups(KeywordType, Text, Punctuation), nil}, - {`\b(add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|escaped|exists|exit|explain|fetch|flush|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|identified|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|lines|load|localtime|localtimestamp|lock|long|loop|low_priority|match|minute_microsecond|minute_second|mod|modifies|natural|no_write_to_binlog|not|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|privileges|procedure|purge|raid0|read|reads|real|references|regexp|release|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|soname|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|then|to|trailing|trigger|undo|union|unique|unlock|unsigned|update|usage|use|user|using|utc_date|utc_time|utc_timestamp|values|varying|when|where|while|with|write|x509|xor|year_month|zerofill)\b`, Keyword, nil}, - {`\b(auto_increment|engine|charset|tables)\b`, KeywordPseudo, nil}, - {`(true|false|null)`, NameConstant, nil}, - {`([a-z_]\w*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[a-z_]\w*`, Name, nil}, - {`@[a-z0-9]*[._]*[a-z0-9]*`, NameVariable, nil}, - {`[;:()\[\],.]`, Punctuation, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "double-string": { - {`[^"]+`, LiteralStringDouble, nil}, - {`""`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/n/nasm.go b/vendor/github.com/alecthomas/chroma/lexers/n/nasm.go deleted file mode 100644 index d769d157..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/n/nasm.go +++ /dev/null @@ -1,59 +0,0 @@ -package n - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Nasm lexer. -var Nasm = internal.Register(MustNewLexer( - &Config{ - Name: "NASM", - Aliases: []string{"nasm"}, - Filenames: []string{"*.asm", "*.ASM"}, - MimeTypes: []string{"text/x-nasm"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`^\s*%`, CommentPreproc, Push("preproc")}, - Include("whitespace"), - {`[a-z$._?][\w$.?#@~]*:`, NameLabel, nil}, - {`([a-z$._?][\w$.?#@~]*)(\s+)(equ)`, ByGroups(NameConstant, KeywordDeclaration, KeywordDeclaration), Push("instruction-args")}, - {`BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|ORG|ALIGN|STRUC|ENDSTRUC|COMMON|CPU|GROUP|UPPERCASE|IMPORT|EXPORT|LIBRARY|MODULE`, Keyword, Push("instruction-args")}, - {`(?:res|d)[bwdqt]|times`, KeywordDeclaration, Push("instruction-args")}, - {`[a-z$._?][\w$.?#@~]*`, NameFunction, Push("instruction-args")}, - {`[\r\n]+`, Text, nil}, - }, - "instruction-args": { - {"\"(\\\\\"|[^\"\\n])*\"|'(\\\\'|[^'\\n])*'|`(\\\\`|[^`\\n])*`", LiteralString, nil}, - {`(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)`, LiteralNumberHex, nil}, - {`[0-7]+q`, LiteralNumberOct, nil}, - {`[01]+b`, LiteralNumberBin, nil}, - {`[0-9]+\.e?[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - Include("punctuation"), - {`r[0-9][0-5]?[bwd]|[a-d][lh]|[er]?[a-d]x|[er]?[sb]p|[er]?[sd]i|[c-gs]s|st[0-7]|mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]`, NameBuiltin, nil}, - {`[a-z$._?][\w$.?#@~]*`, NameVariable, nil}, - {`[\r\n]+`, Text, Pop(1)}, - Include("whitespace"), - }, - "preproc": { - {`[^;\n]+`, CommentPreproc, nil}, - {`;.*?\n`, CommentSingle, Pop(1)}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "whitespace": { - {`\n`, Text, nil}, - {`[ \t]+`, Text, nil}, - {`;.*`, CommentSingle, nil}, - }, - "punctuation": { - {`[,():\[\]]+`, Punctuation, nil}, - {`[&|^<>+*/%~-]+`, Operator, nil}, - {`[$]+`, KeywordConstant, nil}, - {`seg|wrt|strict`, OperatorWord, nil}, - {`byte|[dq]?word`, KeywordType, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/n/newspeak.go b/vendor/github.com/alecthomas/chroma/lexers/n/newspeak.go deleted file mode 100644 index 1a6a37bd..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/n/newspeak.go +++ /dev/null @@ -1,55 +0,0 @@ -package n - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Newspeak lexer. -var Newspeak = internal.Register(MustNewLexer( - &Config{ - Name: "Newspeak", - Aliases: []string{"newspeak"}, - Filenames: []string{"*.ns2"}, - MimeTypes: []string{"text/x-newspeak"}, - }, - Rules{ - "root": { - {`\b(Newsqueak2)\b`, KeywordDeclaration, nil}, - {`'[^']*'`, LiteralString, nil}, - {`\b(class)(\s+)(\w+)(\s*)`, ByGroups(KeywordDeclaration, Text, NameClass, Text), nil}, - {`\b(mixin|self|super|private|public|protected|nil|true|false)\b`, Keyword, nil}, - {`(\w+\:)(\s*)([a-zA-Z_]\w+)`, ByGroups(NameFunction, Text, NameVariable), nil}, - {`(\w+)(\s*)(=)`, ByGroups(NameAttribute, Text, Operator), nil}, - {`<\w+>`, CommentSpecial, nil}, - Include("expressionstat"), - Include("whitespace"), - }, - "expressionstat": { - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`:\w+`, NameVariable, nil}, - {`(\w+)(::)`, ByGroups(NameVariable, Operator), nil}, - {`\w+:`, NameFunction, nil}, - {`\w+`, NameVariable, nil}, - {`\(|\)`, Punctuation, nil}, - {`\[|\]`, Punctuation, nil}, - {`\{|\}`, Punctuation, nil}, - {`(\^|\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-|:)`, Operator, nil}, - {`\.|;`, Punctuation, nil}, - Include("whitespace"), - Include("literals"), - }, - "literals": { - {`\$.`, LiteralString, nil}, - {`'[^']*'`, LiteralString, nil}, - {`#'[^']*'`, LiteralStringSymbol, nil}, - {`#\w+:?`, LiteralStringSymbol, nil}, - {`#(\+|\/|~|\*|<|>|=|@|%|\||&|\?|!|,|-)+`, LiteralStringSymbol, nil}, - }, - "whitespace": { - {`\s+`, Text, nil}, - {`"[^"]*"`, Comment, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/n/nginx.go b/vendor/github.com/alecthomas/chroma/lexers/n/nginx.go deleted file mode 100644 index 840d100b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/n/nginx.go +++ /dev/null @@ -1,47 +0,0 @@ -package n - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Nginx Configuration File lexer. -var Nginx = internal.Register(MustNewLexer( - &Config{ - Name: "Nginx configuration file", - Aliases: []string{"nginx"}, - Filenames: []string{"nginx.conf"}, - MimeTypes: []string{"text/x-nginx-conf"}, - }, - Rules{ - "root": { - {`(include)(\s+)([^\s;]+)`, ByGroups(Keyword, Text, Name), nil}, - {`[^\s;#]+`, Keyword, Push("stmt")}, - Include("base"), - }, - "block": { - {`\}`, Punctuation, Pop(2)}, - {`[^\s;#]+`, KeywordNamespace, Push("stmt")}, - Include("base"), - }, - "stmt": { - {`\{`, Punctuation, Push("block")}, - {`;`, Punctuation, Pop(1)}, - Include("base"), - }, - "base": { - {`#.*\n`, CommentSingle, nil}, - {`on|off`, NameConstant, nil}, - {`\$[^\s;#()]+`, NameVariable, nil}, - {`([a-z0-9.-]+)(:)([0-9]+)`, ByGroups(Name, Punctuation, LiteralNumberInteger), nil}, - {`[a-z-]+/[a-z-+]+`, LiteralString, nil}, - {`[0-9]+[km]?\b`, LiteralNumberInteger, nil}, - {`(~)(\s*)([^\s{]+)`, ByGroups(Punctuation, Text, LiteralStringRegex), nil}, - {`[:=~]`, Punctuation, nil}, - {`[^\s;#{}$]+`, LiteralString, nil}, - {`/[^\s;#]*`, Name, nil}, - {`\s+`, Text, nil}, - {`[$;]`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/n/nim.go b/vendor/github.com/alecthomas/chroma/lexers/n/nim.go deleted file mode 100644 index b08c2f94..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/n/nim.go +++ /dev/null @@ -1,93 +0,0 @@ -package n - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Nim lexer. -var Nim = internal.Register(MustNewLexer( - &Config{ - Name: "Nim", - Aliases: []string{"nim", "nimrod"}, - Filenames: []string{"*.nim", "*.nimrod"}, - MimeTypes: []string{"text/x-nim"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`#\[[\s\S]*?\]#`, CommentMultiline, nil}, - {`##.*$`, LiteralStringDoc, nil}, - {`#.*$`, Comment, nil}, - {`[*=><+\-/@$~&%!?|\\\[\]]`, Operator, nil}, - {"\\.\\.|\\.|,|\\[\\.|\\.\\]|\\{\\.|\\.\\}|\\(\\.|\\.\\)|\\{|\\}|\\(|\\)|:|\\^|`|;", Punctuation, nil}, - {`(?:[\w]+)"`, LiteralString, Push("rdqs")}, - {`"""`, LiteralString, Push("tdqs")}, - {`"`, LiteralString, Push("dqs")}, - {`'`, LiteralStringChar, Push("chars")}, - {`(a_?n_?d_?|o_?r_?|n_?o_?t_?|x_?o_?r_?|s_?h_?l_?|s_?h_?r_?|d_?i_?v_?|m_?o_?d_?|i_?n_?|n_?o_?t_?i_?n_?|i_?s_?|i_?s_?n_?o_?t_?)\b`, OperatorWord, nil}, - {`(p_?r_?o_?c_?\s)(?![(\[\]])`, Keyword, Push("funcname")}, - {`(a_?d_?d_?r_?|a_?n_?d_?|a_?s_?|a_?s_?m_?|a_?t_?o_?m_?i_?c_?|b_?i_?n_?d_?|b_?l_?o_?c_?k_?|b_?r_?e_?a_?k_?|c_?a_?s_?e_?|c_?a_?s_?t_?|c_?o_?n_?c_?e_?p_?t_?|c_?o_?n_?s_?t_?|c_?o_?n_?t_?i_?n_?u_?e_?|c_?o_?n_?v_?e_?r_?t_?e_?r_?|d_?e_?f_?e_?r_?|d_?i_?s_?c_?a_?r_?d_?|d_?i_?s_?t_?i_?n_?c_?t_?|d_?i_?v_?|d_?o_?|e_?l_?i_?f_?|e_?l_?s_?e_?|e_?n_?d_?|e_?n_?u_?m_?|e_?x_?c_?e_?p_?t_?|e_?x_?p_?o_?r_?t_?|f_?i_?n_?a_?l_?l_?y_?|f_?o_?r_?|f_?u_?n_?c_?|i_?f_?|i_?n_?|y_?i_?e_?l_?d_?|i_?n_?t_?e_?r_?f_?a_?c_?e_?|i_?s_?|i_?s_?n_?o_?t_?|i_?t_?e_?r_?a_?t_?o_?r_?|l_?e_?t_?|m_?a_?c_?r_?o_?|m_?e_?t_?h_?o_?d_?|m_?i_?x_?i_?n_?|m_?o_?d_?|n_?o_?t_?|n_?o_?t_?i_?n_?|o_?b_?j_?e_?c_?t_?|o_?f_?|o_?r_?|o_?u_?t_?|p_?r_?o_?c_?|p_?t_?r_?|r_?a_?i_?s_?e_?|r_?e_?f_?|r_?e_?t_?u_?r_?n_?|s_?h_?a_?r_?e_?d_?|s_?h_?l_?|s_?h_?r_?|s_?t_?a_?t_?i_?c_?|t_?e_?m_?p_?l_?a_?t_?e_?|t_?r_?y_?|t_?u_?p_?l_?e_?|t_?y_?p_?e_?|w_?h_?e_?n_?|w_?h_?i_?l_?e_?|w_?i_?t_?h_?|w_?i_?t_?h_?o_?u_?t_?|x_?o_?r_?)\b`, Keyword, nil}, - {`(f_?r_?o_?m_?|i_?m_?p_?o_?r_?t_?|i_?n_?c_?l_?u_?d_?e_?)\b`, KeywordNamespace, nil}, - {`(v_?a_?r)\b`, KeywordDeclaration, nil}, - {`(i_?n_?t_?|i_?n_?t_?8_?|i_?n_?t_?1_?6_?|i_?n_?t_?3_?2_?|i_?n_?t_?6_?4_?|f_?l_?o_?a_?t_?|f_?l_?o_?a_?t_?3_?2_?|f_?l_?o_?a_?t_?6_?4_?|b_?o_?o_?l_?|c_?h_?a_?r_?|r_?a_?n_?g_?e_?|a_?r_?r_?a_?y_?|s_?e_?q_?|s_?e_?t_?|s_?t_?r_?i_?n_?g_?)\b`, KeywordType, nil}, - {`(n_?i_?l_?|t_?r_?u_?e_?|f_?a_?l_?s_?e_?)\b`, KeywordPseudo, nil}, - {`\b_\b`, Name, nil}, // Standalone _ used as discardable variable identifier - {`\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*`, Name, nil}, - {`[0-9][0-9_]*(?=([e.]|\'f(32|64)))`, LiteralNumberFloat, Push("float-suffix", "float-number")}, - {`0x[a-f0-9][a-f0-9_]*`, LiteralNumberHex, Push("int-suffix")}, - {`0b[01][01_]*`, LiteralNumberBin, Push("int-suffix")}, - {`0o[0-7][0-7_]*`, LiteralNumberOct, Push("int-suffix")}, - {`[0-9][0-9_]*`, LiteralNumberInteger, Push("int-suffix")}, - {`\s+`, Text, nil}, - {`.+$`, Error, nil}, - }, - "chars": { - {`\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})`, LiteralStringEscape, nil}, - {`'`, LiteralStringChar, Pop(1)}, - {`.`, LiteralStringChar, nil}, - }, - "strings": { - {`(? <= < >= > *")...), Operator, nil}, - {`[;:]`, Punctuation, nil}, - }, - "comment": { - {`\*/`, CommentMultiline, Pop(1)}, - {`.|\n`, CommentMultiline, nil}, - }, - "paren": { - {`\)`, Punctuation, Pop(1)}, - Include("root"), - }, - "list": { - {`\]`, Punctuation, Pop(1)}, - Include("root"), - }, - "qstring": { - {`"`, StringDouble, Pop(1)}, - {`\${`, StringInterpol, Push("interpol")}, - {`\\.`, StringEscape, nil}, - {`.|\n`, StringDouble, nil}, - }, - "istring": { - {`''\$`, StringEscape, nil}, // "$" - {`'''`, StringEscape, nil}, // "''" - {`''\\.`, StringEscape, nil}, // "\." - {`''`, StringSingle, Pop(1)}, - {`\${`, StringInterpol, Push("interpol")}, - // The next rule is important: "$" escapes any symbol except "{"! - {`\$.`, StringSingle, nil}, // "$." - {`.|\n`, StringSingle, nil}, - }, - "scope": { - {`}:`, Punctuation, Pop(1)}, - {`}`, Punctuation, Pop(1)}, - {`in` + nixb, Keyword, Pop(1)}, - {`\${`, StringInterpol, Push("interpol")}, - Include("root"), // "==" has to be above "=" - {Words(``, ``, strings.Fields("= ? ,")...), Operator, nil}, - }, - "interpol": { - {`}`, StringInterpol, Pop(1)}, - Include("root"), - }, - "id": { - {`[a-zA-Z_][a-zA-Z0-9_'-]*`, Name, nil}, - }, - "uri": { - {`[a-zA-Z][a-zA-Z0-9+.-]*:[a-zA-Z0-9%/?:@&=+$,_.!~*'-]+`, StringDoc, nil}, - }, - "path": { - {`[a-zA-Z0-9._+-]*(/[a-zA-Z0-9._+-]+)+`, StringRegex, nil}, - {`~(/[a-zA-Z0-9._+-]+)+/?`, StringRegex, nil}, - {`<[a-zA-Z0-9._+-]+(/[a-zA-Z0-9._+-]+)*>`, StringRegex, nil}, - }, - "int": { - {`-?[0-9]+` + nixb, NumberInteger, nil}, - }, - "float": { - {`-?(([1-9][0-9]*\.[0-9]*)|(0?\.[0-9]+))([Ee][+-]?[0-9]+)?` + nixb, NumberFloat, nil}, - }, - "space": { - {`[ \t\r\n]+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/o/objectivec.go b/vendor/github.com/alecthomas/chroma/lexers/o/objectivec.go deleted file mode 100644 index e3d0b1c4..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/o/objectivec.go +++ /dev/null @@ -1,165 +0,0 @@ -package o - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Objective-C lexer. -var ObjectiveC = internal.Register(MustNewLexer( - &Config{ - Name: "Objective-C", - Aliases: []string{"objective-c", "objectivec", "obj-c", "objc"}, - Filenames: []string{"*.m", "*.h"}, - MimeTypes: []string{"text/x-objective-c"}, - }, - Rules{ - "statements": { - {`@"`, LiteralString, Push("string")}, - {`@(YES|NO)`, LiteralNumber, nil}, - {`@'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'`, LiteralStringChar, nil}, - {`@(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?`, LiteralNumberFloat, nil}, - {`@(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`@0x[0-9a-fA-F]+[Ll]?`, LiteralNumberHex, nil}, - {`@0[0-7]+[Ll]?`, LiteralNumberOct, nil}, - {`@\d+[Ll]?`, LiteralNumberInteger, nil}, - {`@\(`, Literal, Push("literal_number")}, - {`@\[`, Literal, Push("literal_array")}, - {`@\{`, Literal, Push("literal_dictionary")}, - {Words(``, `\b`, `@selector`, `@private`, `@protected`, `@public`, `@encode`, `@synchronized`, `@try`, `@throw`, `@catch`, `@finally`, `@end`, `@property`, `@synthesize`, `__bridge`, `__bridge_transfer`, `__autoreleasing`, `__block`, `__weak`, `__strong`, `weak`, `strong`, `copy`, `retain`, `assign`, `unsafe_unretained`, `atomic`, `nonatomic`, `readonly`, `readwrite`, `setter`, `getter`, `typeof`, `in`, `out`, `inout`, `release`, `class`, `@dynamic`, `@optional`, `@required`, `@autoreleasepool`), Keyword, nil}, - {Words(``, `\b`, `id`, `instancetype`, `Class`, `IMP`, `SEL`, `BOOL`, `IBOutlet`, `IBAction`, `unichar`), KeywordType, nil}, - {`@(true|false|YES|NO)\n`, NameBuiltin, nil}, - {`(YES|NO|nil|self|super)\b`, NameBuiltin, nil}, - {`(Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\b`, KeywordType, nil}, - {`(TRUE|FALSE)\b`, NameBuiltin, nil}, - {`(@interface|@implementation)(\s+)`, ByGroups(Keyword, Text), Push("#pop", "oc_classname")}, - {`(@class|@protocol)(\s+)`, ByGroups(Keyword, Text), Push("#pop", "oc_forward_classname")}, - {`@`, Punctuation, nil}, - {`(L?)(")`, ByGroups(LiteralStringAffix, LiteralString), Push("string")}, - {`(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')`, ByGroups(LiteralStringAffix, LiteralStringChar, LiteralStringChar, LiteralStringChar), nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+[LlUu]*`, LiteralNumberHex, nil}, - {`0[0-7]+[LlUu]*`, LiteralNumberOct, nil}, - {`\d+[LlUu]*`, LiteralNumberInteger, nil}, - {`\*/`, Error, nil}, - {`[~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[()\[\],.]`, Punctuation, nil}, - {Words(``, `\b`, `asm`, `auto`, `break`, `case`, `const`, `continue`, `default`, `do`, `else`, `enum`, `extern`, `for`, `goto`, `if`, `register`, `restricted`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `volatile`, `while`), Keyword, nil}, - {`(bool|int|long|float|short|double|char|unsigned|signed|void)\b`, KeywordType, nil}, - {Words(``, `\b`, `inline`, `_inline`, `__inline`, `naked`, `restrict`, `thread`, `typename`), KeywordReserved, nil}, - {`(__m(128i|128d|128|64))\b`, KeywordReserved, nil}, - {Words(`__`, `\b`, `asm`, `int8`, `based`, `except`, `int16`, `stdcall`, `cdecl`, `fastcall`, `int32`, `declspec`, `finally`, `int64`, `try`, `leave`, `wchar_t`, `w64`, `unaligned`, `raise`, `noop`, `identifier`, `forceinline`, `assume`), KeywordReserved, nil}, - {`(true|false|NULL)\b`, NameBuiltin, nil}, - {`([a-zA-Z_]\w*)(\s*)(:)(?!:)`, ByGroups(NameLabel, Text, Punctuation), nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "oc_classname": { - {`([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)`, ByGroups(NameClass, Text, NameClass, Text, Punctuation), Push("#pop", "oc_ivars")}, - {`([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?`, ByGroups(NameClass, Text, NameClass), Pop(1)}, - {`([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)`, ByGroups(NameClass, Text, NameLabel, Text, Punctuation), Push("#pop", "oc_ivars")}, - {`([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))`, ByGroups(NameClass, Text, NameLabel), Pop(1)}, - {`([a-zA-Z$_][\w$]*)(\s*)(\{)`, ByGroups(NameClass, Text, Punctuation), Push("#pop", "oc_ivars")}, - {`([a-zA-Z$_][\w$]*)`, NameClass, Pop(1)}, - }, - "oc_forward_classname": { - {`([a-zA-Z$_][\w$]*)(\s*,\s*)`, ByGroups(NameClass, Text), Push("oc_forward_classname")}, - {`([a-zA-Z$_][\w$]*)(\s*;?)`, ByGroups(NameClass, Text), Pop(1)}, - }, - "oc_ivars": { - Include("whitespace"), - Include("statements"), - {`;`, Punctuation, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "root": { - {`^([-+])(\s*)(\(.*?\))?(\s*)([a-zA-Z$_][\w$]*:?)`, ByGroups(Punctuation, Text, UsingSelf("root"), Text, NameFunction), Push("method")}, - Include("whitespace"), - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), Push("function")}, - {`((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)`, ByGroups(UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), nil}, - Default(Push("statement")), - }, - "method": { - Include("whitespace"), - {`,`, Punctuation, nil}, - {`\.\.\.`, Punctuation, nil}, - {`(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)`, ByGroups(UsingSelf("root"), Text, NameVariable), nil}, - {`[a-zA-Z$_][\w$]*:`, NameFunction, nil}, - {`;`, Punctuation, Pop(1)}, - {`\{`, Punctuation, Push("function")}, - Default(Pop(1)), - }, - "literal_number": { - {`\(`, Punctuation, Push("literal_number_inner")}, - {`\)`, Literal, Pop(1)}, - Include("statement"), - }, - "literal_number_inner": { - {`\(`, Punctuation, Push()}, - {`\)`, Punctuation, Pop(1)}, - Include("statement"), - }, - "literal_array": { - {`\[`, Punctuation, Push("literal_array_inner")}, - {`\]`, Literal, Pop(1)}, - Include("statement"), - }, - "literal_array_inner": { - {`\[`, Punctuation, Push()}, - {`\]`, Punctuation, Pop(1)}, - Include("statement"), - }, - "literal_dictionary": { - {`\}`, Literal, Pop(1)}, - Include("statement"), - }, - "whitespace": { - {`^#if\s+0`, CommentPreproc, Push("if0")}, - {`^#`, CommentPreproc, Push("macro")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("if0")}, - {`^(\s*(?:/[*].*?[*]/\s*)?)(#)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("macro")}, - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil}, - {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil}, - }, - "statement": { - Include("whitespace"), - Include("statements"), - {`[{}]`, Punctuation, nil}, - {`;`, Punctuation, Pop(1)}, - }, - "function": { - Include("whitespace"), - Include("statements"), - {`;`, Punctuation, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "macro": { - {`(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)`, ByGroups(CommentPreproc, Text, CommentPreprocFile), nil}, - {`[^/\n]+`, CommentPreproc, nil}, - {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {`/`, CommentPreproc, nil}, - {`(?<=\\)\n`, CommentPreproc, nil}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "if0": { - {`^\s*#if.*?(?|\\[<|\\[|\\?\\?|\\?|>\\}|>]|>|=|<-|<|;;|;|:>|:=|::|:|\\.\\.|\\.|->|-\\.|-|,|\\+|\\*|\\)|\\(|&&|&|#|!=)", Operator, nil}, - {`([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]`, Operator, nil}, - {`\b(and|asr|land|lor|lsl|lxor|mod|or)\b`, OperatorWord, nil}, - {`\b(unit|int|float|bool|string|char|list|array)\b`, KeywordType, nil}, - {`[^\W\d][\w']*`, Name, nil}, - {`-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)`, LiteralNumberFloat, nil}, - {`0[xX][\da-fA-F][\da-fA-F_]*`, LiteralNumberHex, nil}, - {`0[oO][0-7][0-7_]*`, LiteralNumberOct, nil}, - {`0[bB][01][01_]*`, LiteralNumberBin, nil}, - {`\d[\d_]*`, LiteralNumberInteger, nil}, - {`'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'`, LiteralStringChar, nil}, - {`'.'`, LiteralStringChar, nil}, - {`'`, Keyword, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`[~?][a-z][\w\']*:`, NameVariable, nil}, - }, - "comment": { - {`[^(*)]+`, Comment, nil}, - {`\(\*`, Comment, Push()}, - {`\*\)`, Comment, Pop(1)}, - {`[(*)]`, Comment, nil}, - }, - "string": { - {`[^\\"]+`, LiteralStringDouble, nil}, - Include("escape-sequence"), - {`\\\n`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "dotted": { - {`\s+`, Text, nil}, - {`\.`, Punctuation, nil}, - {`[A-Z][\w\']*(?=\s*\.)`, NameNamespace, nil}, - {`[A-Z][\w\']*`, NameClass, Pop(1)}, - {`[a-z_][\w\']*`, Name, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/o/octave.go b/vendor/github.com/alecthomas/chroma/lexers/o/octave.go deleted file mode 100644 index c23b586f..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/o/octave.go +++ /dev/null @@ -1,46 +0,0 @@ -package o - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Octave lexer. -var Octave = internal.Register(MustNewLexer( - &Config{ - Name: "Octave", - Aliases: []string{"octave"}, - Filenames: []string{"*.m"}, - MimeTypes: []string{"text/octave"}, - }, - Rules{ - "root": { - {`[%#].*$`, Comment, nil}, - {`^\s*function`, Keyword, Push("deffunc")}, - {Words(``, `\b`, `__FILE__`, `__LINE__`, `break`, `case`, `catch`, `classdef`, `continue`, `do`, `else`, `elseif`, `end`, `end_try_catch`, `end_unwind_protect`, `endclassdef`, `endevents`, `endfor`, `endfunction`, `endif`, `endmethods`, `endproperties`, `endswitch`, `endwhile`, `events`, `for`, `function`, `get`, `global`, `if`, `methods`, `otherwise`, `persistent`, `properties`, `return`, `set`, `static`, `switch`, `try`, `until`, `unwind_protect`, `unwind_protect_cleanup`, `while`), Keyword, nil}, - {Words(``, `\b`, `addlistener`, `addpath`, `addproperty`, `all`, `and`, `any`, `argnames`, `argv`, `assignin`, `atexit`, `autoload`, `available_graphics_toolkits`, `beep_on_error`, `bitand`, `bitmax`, `bitor`, `bitshift`, `bitxor`, `cat`, `cell`, `cellstr`, `char`, `class`, `clc`, `columns`, `command_line_path`, `completion_append_char`, `completion_matches`, `complex`, `confirm_recursive_rmdir`, `cputime`, `crash_dumps_octave_core`, `ctranspose`, `cumprod`, `cumsum`, `debug_on_error`, `debug_on_interrupt`, `debug_on_warning`, `default_save_options`, `dellistener`, `diag`, `diff`, `disp`, `doc_cache_file`, `do_string_escapes`, `double`, `drawnow`, `e`, `echo_executing_commands`, `eps`, `eq`, `errno`, `errno_list`, `error`, `eval`, `evalin`, `exec`, `exist`, `exit`, `eye`, `false`, `fclear`, `fclose`, `fcntl`, `fdisp`, `feof`, `ferror`, `feval`, `fflush`, `fgetl`, `fgets`, `fieldnames`, `file_in_loadpath`, `file_in_path`, `filemarker`, `filesep`, `find_dir_in_path`, `fixed_point_format`, `fnmatch`, `fopen`, `fork`, `formula`, `fprintf`, `fputs`, `fread`, `freport`, `frewind`, `fscanf`, `fseek`, `fskipl`, `ftell`, `functions`, `fwrite`, `ge`, `genpath`, `get`, `getegid`, `getenv`, `geteuid`, `getgid`, `getpgrp`, `getpid`, `getppid`, `getuid`, `glob`, `gt`, `gui_mode`, `history_control`, `history_file`, `history_size`, `history_timestamp_format_string`, `home`, `horzcat`, `hypot`, `ifelse`, `ignore_function_time_stamp`, `inferiorto`, `info_file`, `info_program`, `inline`, `input`, `intmax`, `intmin`, `ipermute`, `is_absolute_filename`, `isargout`, `isbool`, `iscell`, `iscellstr`, `ischar`, `iscomplex`, `isempty`, `isfield`, `isfloat`, `isglobal`, `ishandle`, `isieee`, `isindex`, `isinteger`, `islogical`, `ismatrix`, `ismethod`, `isnull`, `isnumeric`, `isobject`, `isreal`, `is_rooted_relative_filename`, `issorted`, `isstruct`, `isvarname`, `kbhit`, `keyboard`, `kill`, `lasterr`, `lasterror`, `lastwarn`, `ldivide`, `le`, `length`, `link`, `linspace`, `logical`, `lstat`, `lt`, `make_absolute_filename`, `makeinfo_program`, `max_recursion_depth`, `merge`, `methods`, `mfilename`, `minus`, `mislocked`, `mkdir`, `mkfifo`, `mkstemp`, `mldivide`, `mlock`, `mouse_wheel_zoom`, `mpower`, `mrdivide`, `mtimes`, `munlock`, `nargin`, `nargout`, `native_float_format`, `ndims`, `ne`, `nfields`, `nnz`, `norm`, `not`, `numel`, `nzmax`, `octave_config_info`, `octave_core_file_limit`, `octave_core_file_name`, `octave_core_file_options`, `ones`, `or`, `output_max_field_width`, `output_precision`, `page_output_immediately`, `page_screen_output`, `path`, `pathsep`, `pause`, `pclose`, `permute`, `pi`, `pipe`, `plus`, `popen`, `power`, `print_empty_dimensions`, `printf`, `print_struct_array_contents`, `prod`, `program_invocation_name`, `program_name`, `putenv`, `puts`, `pwd`, `quit`, `rats`, `rdivide`, `readdir`, `readlink`, `read_readline_init_file`, `realmax`, `realmin`, `rehash`, `rename`, `repelems`, `re_read_readline_init_file`, `reset`, `reshape`, `resize`, `restoredefaultpath`, `rethrow`, `rmdir`, `rmfield`, `rmpath`, `rows`, `save_header_format_string`, `save_precision`, `saving_history`, `scanf`, `set`, `setenv`, `shell_cmd`, `sighup_dumps_octave_core`, `sigterm_dumps_octave_core`, `silent_functions`, `single`, `size`, `size_equal`, `sizemax`, `sizeof`, `sleep`, `source`, `sparse_auto_mutate`, `split_long_rows`, `sprintf`, `squeeze`, `sscanf`, `stat`, `stderr`, `stdin`, `stdout`, `strcmp`, `strcmpi`, `string_fill_char`, `strncmp`, `strncmpi`, `struct`, `struct_levels_to_print`, `strvcat`, `subsasgn`, `subsref`, `sum`, `sumsq`, `superiorto`, `suppress_verbose_help_message`, `symlink`, `system`, `tic`, `tilde_expand`, `times`, `tmpfile`, `tmpnam`, `toc`, `toupper`, `transpose`, `true`, `typeinfo`, `umask`, `uminus`, `uname`, `undo_string_escapes`, `unlink`, `uplus`, `upper`, `usage`, `usleep`, `vec`, `vectorize`, `vertcat`, `waitpid`, `warning`, `warranty`, `whos_line_format`, `yes_or_no`, `zeros`, `inf`, `Inf`, `nan`, `NaN`, `close`, `load`, `who`, `whos`, `accumarray`, `accumdim`, `acosd`, `acotd`, `acscd`, `addtodate`, `allchild`, `ancestor`, `anova`, `arch_fit`, `arch_rnd`, `arch_test`, `area`, `arma_rnd`, `arrayfun`, `ascii`, `asctime`, `asecd`, `asind`, `assert`, `atand`, `autoreg_matrix`, `autumn`, `axes`, `axis`, `bar`, `barh`, `bartlett`, `bartlett_test`, `beep`, `betacdf`, `betainv`, `betapdf`, `betarnd`, `bicgstab`, `bicubic`, `binary`, `binocdf`, `binoinv`, `binopdf`, `binornd`, `bitcmp`, `bitget`, `bitset`, `blackman`, `blanks`, `blkdiag`, `bone`, `box`, `brighten`, `calendar`, `cast`, `cauchy_cdf`, `cauchy_inv`, `cauchy_pdf`, `cauchy_rnd`, `caxis`, `celldisp`, `center`, `cgs`, `chisquare_test_homogeneity`, `chisquare_test_independence`, `circshift`, `cla`, `clabel`, `clf`, `clock`, `cloglog`, `closereq`, `colon`, `colorbar`, `colormap`, `colperm`, `comet`, `common_size`, `commutation_matrix`, `compan`, `compare_versions`, `compass`, `computer`, `cond`, `condest`, `contour`, `contourc`, `contourf`, `contrast`, `conv`, `convhull`, `cool`, `copper`, `copyfile`, `cor`, `corrcoef`, `cor_test`, `cosd`, `cotd`, `cov`, `cplxpair`, `cross`, `cscd`, `cstrcat`, `csvread`, `csvwrite`, `ctime`, `cumtrapz`, `curl`, `cut`, `cylinder`, `date`, `datenum`, `datestr`, `datetick`, `datevec`, `dblquad`, `deal`, `deblank`, `deconv`, `delaunay`, `delaunayn`, `delete`, `demo`, `detrend`, `diffpara`, `diffuse`, `dir`, `discrete_cdf`, `discrete_inv`, `discrete_pdf`, `discrete_rnd`, `display`, `divergence`, `dlmwrite`, `dos`, `dsearch`, `dsearchn`, `duplication_matrix`, `durbinlevinson`, `ellipsoid`, `empirical_cdf`, `empirical_inv`, `empirical_pdf`, `empirical_rnd`, `eomday`, `errorbar`, `etime`, `etreeplot`, `example`, `expcdf`, `expinv`, `expm`, `exppdf`, `exprnd`, `ezcontour`, `ezcontourf`, `ezmesh`, `ezmeshc`, `ezplot`, `ezpolar`, `ezsurf`, `ezsurfc`, `factor`, `factorial`, `fail`, `fcdf`, `feather`, `fftconv`, `fftfilt`, `fftshift`, `figure`, `fileattrib`, `fileparts`, `fill`, `findall`, `findobj`, `findstr`, `finv`, `flag`, `flipdim`, `fliplr`, `flipud`, `fpdf`, `fplot`, `fractdiff`, `freqz`, `freqz_plot`, `frnd`, `fsolve`, `f_test_regression`, `ftp`, `fullfile`, `fzero`, `gamcdf`, `gaminv`, `gampdf`, `gamrnd`, `gca`, `gcbf`, `gcbo`, `gcf`, `genvarname`, `geocdf`, `geoinv`, `geopdf`, `geornd`, `getfield`, `ginput`, `glpk`, `gls`, `gplot`, `gradient`, `graphics_toolkit`, `gray`, `grid`, `griddata`, `griddatan`, `gtext`, `gunzip`, `gzip`, `hadamard`, `hamming`, `hankel`, `hanning`, `hggroup`, `hidden`, `hilb`, `hist`, `histc`, `hold`, `hot`, `hotelling_test`, `housh`, `hsv`, `hurst`, `hygecdf`, `hygeinv`, `hygepdf`, `hygernd`, `idivide`, `ifftshift`, `image`, `imagesc`, `imfinfo`, `imread`, `imshow`, `imwrite`, `index`, `info`, `inpolygon`, `inputname`, `interpft`, `interpn`, `intersect`, `invhilb`, `iqr`, `isa`, `isdefinite`, `isdir`, `is_duplicate_entry`, `isequal`, `isequalwithequalnans`, `isfigure`, `ishermitian`, `ishghandle`, `is_leap_year`, `isletter`, `ismac`, `ismember`, `ispc`, `isprime`, `isprop`, `isscalar`, `issquare`, `isstrprop`, `issymmetric`, `isunix`, `is_valid_file_id`, `isvector`, `jet`, `kendall`, `kolmogorov_smirnov_cdf`, `kolmogorov_smirnov_test`, `kruskal_wallis_test`, `krylov`, `kurtosis`, `laplace_cdf`, `laplace_inv`, `laplace_pdf`, `laplace_rnd`, `legend`, `legendre`, `license`, `line`, `linkprop`, `list_primes`, `loadaudio`, `loadobj`, `logistic_cdf`, `logistic_inv`, `logistic_pdf`, `logistic_rnd`, `logit`, `loglog`, `loglogerr`, `logm`, `logncdf`, `logninv`, `lognpdf`, `lognrnd`, `logspace`, `lookfor`, `ls_command`, `lsqnonneg`, `magic`, `mahalanobis`, `manova`, `matlabroot`, `mcnemar_test`, `mean`, `meansq`, `median`, `menu`, `mesh`, `meshc`, `meshgrid`, `meshz`, `mexext`, `mget`, `mkpp`, `mode`, `moment`, `movefile`, `mpoles`, `mput`, `namelengthmax`, `nargchk`, `nargoutchk`, `nbincdf`, `nbininv`, `nbinpdf`, `nbinrnd`, `nchoosek`, `ndgrid`, `newplot`, `news`, `nonzeros`, `normcdf`, `normest`, `norminv`, `normpdf`, `normrnd`, `now`, `nthroot`, `null`, `ocean`, `ols`, `onenormest`, `optimget`, `optimset`, `orderfields`, `orient`, `orth`, `pack`, `pareto`, `parseparams`, `pascal`, `patch`, `pathdef`, `pcg`, `pchip`, `pcolor`, `pcr`, `peaks`, `periodogram`, `perl`, `perms`, `pie`, `pink`, `planerot`, `playaudio`, `plot`, `plotmatrix`, `plotyy`, `poisscdf`, `poissinv`, `poisspdf`, `poissrnd`, `polar`, `poly`, `polyaffine`, `polyarea`, `polyderiv`, `polyfit`, `polygcd`, `polyint`, `polyout`, `polyreduce`, `polyval`, `polyvalm`, `postpad`, `powerset`, `ppder`, `ppint`, `ppjumps`, `ppplot`, `ppval`, `pqpnonneg`, `prepad`, `primes`, `print`, `print_usage`, `prism`, `probit`, `qp`, `qqplot`, `quadcc`, `quadgk`, `quadl`, `quadv`, `quiver`, `qzhess`, `rainbow`, `randi`, `range`, `rank`, `ranks`, `rat`, `reallog`, `realpow`, `realsqrt`, `record`, `rectangle_lw`, `rectangle_sw`, `rectint`, `refresh`, `refreshdata`, `regexptranslate`, `repmat`, `residue`, `ribbon`, `rindex`, `roots`, `rose`, `rosser`, `rotdim`, `rref`, `run`, `run_count`, `rundemos`, `run_test`, `runtests`, `saveas`, `saveaudio`, `saveobj`, `savepath`, `scatter`, `secd`, `semilogx`, `semilogxerr`, `semilogy`, `semilogyerr`, `setaudio`, `setdiff`, `setfield`, `setxor`, `shading`, `shift`, `shiftdim`, `sign_test`, `sinc`, `sind`, `sinetone`, `sinewave`, `skewness`, `slice`, `sombrero`, `sortrows`, `spaugment`, `spconvert`, `spdiags`, `spearman`, `spectral_adf`, `spectral_xdf`, `specular`, `speed`, `spencer`, `speye`, `spfun`, `sphere`, `spinmap`, `spline`, `spones`, `sprand`, `sprandn`, `sprandsym`, `spring`, `spstats`, `spy`, `sqp`, `stairs`, `statistics`, `std`, `stdnormal_cdf`, `stdnormal_inv`, `stdnormal_pdf`, `stdnormal_rnd`, `stem`, `stft`, `strcat`, `strchr`, `strjust`, `strmatch`, `strread`, `strsplit`, `strtok`, `strtrim`, `strtrunc`, `structfun`, `studentize`, `subplot`, `subsindex`, `subspace`, `substr`, `substruct`, `summer`, `surf`, `surface`, `surfc`, `surfl`, `surfnorm`, `svds`, `swapbytes`, `sylvester_matrix`, `symvar`, `synthesis`, `table`, `tand`, `tar`, `tcdf`, `tempdir`, `tempname`, `test`, `text`, `textread`, `textscan`, `tinv`, `title`, `toeplitz`, `tpdf`, `trace`, `trapz`, `treelayout`, `treeplot`, `triangle_lw`, `triangle_sw`, `tril`, `trimesh`, `triplequad`, `triplot`, `trisurf`, `triu`, `trnd`, `tsearchn`, `t_test`, `t_test_regression`, `type`, `unidcdf`, `unidinv`, `unidpdf`, `unidrnd`, `unifcdf`, `unifinv`, `unifpdf`, `unifrnd`, `union`, `unique`, `unix`, `unmkpp`, `unpack`, `untabify`, `untar`, `unwrap`, `unzip`, `u_test`, `validatestring`, `vander`, `var`, `var_test`, `vech`, `ver`, `version`, `view`, `voronoi`, `voronoin`, `waitforbuttonpress`, `wavread`, `wavwrite`, `wblcdf`, `wblinv`, `wblpdf`, `wblrnd`, `weekday`, `welch_test`, `what`, `white`, `whitebg`, `wienrnd`, `wilcoxon_test`, `wilkinson`, `winter`, `xlabel`, `xlim`, `ylabel`, `yulewalker`, `zip`, `zlabel`, `z_test`, `airy`, `amd`, `balance`, `besselh`, `besseli`, `besselj`, `besselk`, `bessely`, `bitpack`, `bsxfun`, `builtin`, `ccolamd`, `cellfun`, `cellslices`, `chol`, `choldelete`, `cholinsert`, `cholinv`, `cholshift`, `cholupdate`, `colamd`, `colloc`, `convhulln`, `convn`, `csymamd`, `cummax`, `cummin`, `daspk`, `daspk_options`, `dasrt`, `dasrt_options`, `dassl`, `dassl_options`, `dbclear`, `dbdown`, `dbstack`, `dbstatus`, `dbstop`, `dbtype`, `dbup`, `dbwhere`, `det`, `dlmread`, `dmperm`, `dot`, `eig`, `eigs`, `endgrent`, `endpwent`, `etree`, `fft`, `fftn`, `fftw`, `filter`, `find`, `full`, `gcd`, `getgrent`, `getgrgid`, `getgrnam`, `getpwent`, `getpwnam`, `getpwuid`, `getrusage`, `givens`, `gmtime`, `gnuplot_binary`, `hess`, `ifft`, `ifftn`, `inv`, `isdebugmode`, `issparse`, `kron`, `localtime`, `lookup`, `lsode`, `lsode_options`, `lu`, `luinc`, `luupdate`, `matrix_type`, `max`, `min`, `mktime`, `pinv`, `qr`, `qrdelete`, `qrinsert`, `qrshift`, `qrupdate`, `quad`, `quad_options`, `qz`, `rand`, `rande`, `randg`, `randn`, `randp`, `randperm`, `rcond`, `regexp`, `regexpi`, `regexprep`, `schur`, `setgrent`, `setpwent`, `sort`, `spalloc`, `sparse`, `spparms`, `sprank`, `sqrtm`, `strfind`, `strftime`, `strptime`, `strrep`, `svd`, `svd_driver`, `syl`, `symamd`, `symbfact`, `symrcm`, `time`, `tsearch`, `typecast`, `urlread`, `urlwrite`, `abs`, `acos`, `acosh`, `acot`, `acoth`, `acsc`, `acsch`, `angle`, `arg`, `asec`, `asech`, `asin`, `asinh`, `atan`, `atanh`, `beta`, `betainc`, `betaln`, `bincoeff`, `cbrt`, `ceil`, `conj`, `cos`, `cosh`, `cot`, `coth`, `csc`, `csch`, `erf`, `erfc`, `erfcx`, `erfinv`, `exp`, `finite`, `fix`, `floor`, `fmod`, `gamma`, `gammainc`, `gammaln`, `imag`, `isalnum`, `isalpha`, `isascii`, `iscntrl`, `isdigit`, `isfinite`, `isgraph`, `isinf`, `islower`, `isna`, `isnan`, `isprint`, `ispunct`, `isspace`, `isupper`, `isxdigit`, `lcm`, `lgamma`, `log`, `lower`, `mod`, `real`, `rem`, `round`, `roundb`, `sec`, `sech`, `sign`, `sin`, `sinh`, `sqrt`, `tan`, `tanh`, `toascii`, `tolower`, `xor`), NameBuiltin, nil}, - {Words(``, `\b`, `EDITOR`, `EXEC_PATH`, `I`, `IMAGE_PATH`, `NA`, `OCTAVE_HOME`, `OCTAVE_VERSION`, `PAGER`, `PAGER_FLAGS`, `SEEK_CUR`, `SEEK_END`, `SEEK_SET`, `SIG`, `S_ISBLK`, `S_ISCHR`, `S_ISDIR`, `S_ISFIFO`, `S_ISLNK`, `S_ISREG`, `S_ISSOCK`, `WCONTINUE`, `WCOREDUMP`, `WEXITSTATUS`, `WIFCONTINUED`, `WIFEXITED`, `WIFSIGNALED`, `WIFSTOPPED`, `WNOHANG`, `WSTOPSIG`, `WTERMSIG`, `WUNTRACED`), NameConstant, nil}, - {`-=|!=|!|/=|--`, Operator, nil}, - {`-|==|~=|<|>|<=|>=|&&|&|~|\|\|?`, Operator, nil}, - {`\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*`, Operator, nil}, - {`\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\`, Operator, nil}, - {`[\[\](){}:@.,]`, Punctuation, nil}, - {`=|:|;`, Punctuation, nil}, - {`"[^"]*"`, LiteralString, nil}, - {`(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+[eEf][+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`(?<=[\w)\].])\'+`, Operator, nil}, - {`(?=|>|&&|\|\|`, Operator, nil}, - {`\$(f[asn]|t|vp[rtd]|children)`, NameVariableMagic, nil}, - {Words(``, `\b`, `PI`, `undef`), KeywordConstant, nil}, - {`(use|include)((?:\s|\\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("includes")}, - {`(module)(\s*)([^\s\(]+)`, ByGroups(KeywordNamespace, Text, NameNamespace), nil}, - {`(function)(\s*)([^\s\(]+)`, ByGroups(KeywordDeclaration, Text, NameFunction), nil}, - {`\b(true|false)\b`, Literal, nil}, - {`\b(function|module|include|use|for|intersection_for|if|else|return)\b`, Keyword, nil}, - {`\b(circle|square|polygon|text|sphere|cube|cylinder|polyhedron|translate|rotate|scale|resize|mirror|multmatrix|color|offset|hull|minkowski|union|difference|intersection|abs|sign|sin|cos|tan|acos|asin|atan|atan2|floor|round|ceil|ln|log|pow|sqrt|exp|rands|min|max|concat|lookup|str|chr|search|version|version_num|norm|cross|parent_module|echo|import|import_dxf|dxf_linear_extrude|linear_extrude|rotate_extrude|surface|projection|render|dxf_cross|dxf_dim|let|assign|len)\b`, NameBuiltin, nil}, - {`\bchildren\b`, NameBuiltinPseudo, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`-?\d+(\.\d+)?(e[+-]?\d+)?`, Number, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "includes": { - {"(<)([^>]*)(>)", ByGroups(Punctuation, CommentPreprocFile, Punctuation), nil}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/o/org.go b/vendor/github.com/alecthomas/chroma/lexers/o/org.go deleted file mode 100644 index 1064eaf0..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/o/org.go +++ /dev/null @@ -1,102 +0,0 @@ -package o - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Org mode lexer. -var Org = internal.Register(MustNewLexer( - &Config{ - Name: "Org Mode", - Aliases: []string{"org", "orgmode"}, - Filenames: []string{"*.org"}, - MimeTypes: []string{"text/org"}, // https://lists.gnu.org/r/emacs-orgmode/2017-09/msg00087.html - }, - Rules{ - "root": { - {`^# .*$`, Comment, nil}, - // Headings - {`^(\*)( COMMENT)( .*)$`, ByGroups(GenericHeading, NameEntity, GenericStrong), nil}, - {`^(\*\*+)( COMMENT)( .*)$`, ByGroups(GenericSubheading, NameEntity, Text), nil}, - {`^(\*)( DONE)( .*)$`, ByGroups(GenericHeading, LiteralStringRegex, GenericStrong), nil}, - {`^(\*\*+)( DONE)( .*)$`, ByGroups(GenericSubheading, LiteralStringRegex, Text), nil}, - {`^(\*)( TODO)( .*)$`, ByGroups(GenericHeading, Error, GenericStrong), nil}, - {`^(\*\*+)( TODO)( .*)$`, ByGroups(GenericSubheading, Error, Text), nil}, - {`^(\*)( .+?)( :[a-zA-Z0-9_@:]+:)$`, ByGroups(GenericHeading, GenericStrong, GenericEmph), nil}, // Level 1 heading with tags - {`^(\*)( .+)$`, ByGroups(GenericHeading, GenericStrong), nil}, // // Level 1 heading with NO tags - {`^(\*\*+)( .+?)( :[a-zA-Z0-9_@:]+:)$`, ByGroups(GenericSubheading, Text, GenericEmph), nil}, // Level 2+ heading with tags - {`^(\*\*+)( .+)$`, ByGroups(GenericSubheading, Text), nil}, // Level 2+ heading with NO tags - // Checkbox lists - {`^( *)([+-] )(\[[ X]\])( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, - {`^( +)(\* )(\[[ X]\])( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, - // Definition lists - {`^( *)([+-] )([^ \n]+ ::)( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, - {`^( +)(\* )([^ \n]+ ::)( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, - // Unordered lists - {`^( *)([+-] )(.+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil}, - {`^( +)(\* )(.+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil}, - // Ordered lists - {`^( *)([0-9]+[.)])( \[@[0-9]+\])( .+)$`, ByGroups(Text, Keyword, GenericEmph, UsingSelf("inline")), nil}, - {`^( *)([0-9]+[.)])( .+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil}, - // Dynamic Blocks - {`(?i)^( *#\+begin: )([^ ]+)([\w\W]*?\n)([\w\W]*?)(^ *#\+end: *$)`, ByGroups(Comment, CommentSpecial, Comment, UsingSelf("inline"), Comment), nil}, - // Blocks - // - Comment Blocks - {`(?i)^( *#\+begin_comment *\n)([\w\W]*?)(^ *#\+end_comment *$)`, ByGroups(Comment, Comment, Comment), nil}, - // - Src Blocks - {`(?i)^( *#\+begin_src )([^ \n]+)(.*?\n)([\w\W]*?)(^ *#\+end_src *$)`, - UsingByGroup( - internal.Get, - 2, 4, - Comment, CommentSpecial, Comment, Text, Comment, - ), - nil, - }, - // - Export Blocks - {`(?i)^( *#\+begin_export )(\w+)( *\n)([\w\W]*?)(^ *#\+end_export *$)`, - UsingByGroup( - internal.Get, - 2, 4, - Comment, CommentSpecial, Text, Text, Comment, - ), - nil, - }, - // - Org Special, Example, Verse, etc. Blocks - {`(?i)^( *#\+begin_)(\w+)( *\n)([\w\W]*?)(^ *#\+end_\2)( *$)`, ByGroups(Comment, Comment, Text, Text, Comment, Text), nil}, - // Keywords - {`^(#\+\w+)(:.*)$`, ByGroups(CommentSpecial, Comment), nil}, // Other Org keywords like #+title - // Properties and Drawers - {`(?i)^( *:\w+: *\n)([\w\W]*?)(^ *:end: *$)`, ByGroups(Comment, CommentSpecial, Comment), nil}, - // Line break operator - {`^(.*)(\\\\)$`, ByGroups(UsingSelf("inline"), Operator), nil}, - // Deadline/Scheduled - {`(?i)^( *(?:DEADLINE|SCHEDULED): )(<[^<>]+?> *)$`, ByGroups(Comment, CommentSpecial), nil}, // DEADLINE/SCHEDULED: - // DONE state CLOSED - {`(?i)^( *CLOSED: )(\[[^][]+?\] *)$`, ByGroups(Comment, CommentSpecial), nil}, // CLOSED: [datestamp] - // All other lines - Include("inline"), - }, - "inline": { - {`(\s)*(\*[^ \n*][^*]+?[^ \n*]\*)((?=\W|\n|$))`, ByGroups(Text, GenericStrong, Text), nil}, // Bold - {`(\s)*(/[^/]+?/)((?=\W|\n|$))`, ByGroups(Text, GenericEmph, Text), nil}, // Italic - {`(\s)*(=[^\n=]+?=)((?=\W|\n|$))`, ByGroups(Text, NameClass, Text), nil}, // Verbatim - {`(\s)*(~[^\n~]+?~)((?=\W|\n|$))`, ByGroups(Text, NameClass, Text), nil}, // Code - {`(\s)*(\+[^+]+?\+)((?=\W|\n|$))`, ByGroups(Text, GenericDeleted, Text), nil}, // Strikethrough - {`(\s)*(_[^_]+?_)((?=\W|\n|$))`, ByGroups(Text, GenericUnderline, Text), nil}, // Underline - {`(<)([^<>]+?)(>)`, ByGroups(Text, String, Text), nil}, // - {`[{]{3}[^}]+[}]{3}`, NameBuiltin, nil}, // {{{macro(foo,1)}}} - {`([^[])(\[fn:)([^]]+?)(\])([^]])`, ByGroups(Text, NameBuiltinPseudo, LiteralString, NameBuiltinPseudo, Text), nil}, // [fn:1] - // Links - {`(\[\[)([^][]+?)(\]\[)([^][]+)(\]\])`, ByGroups(Text, NameAttribute, Text, NameTag, Text), nil}, // [[link][descr]] - {`(\[\[)([^][]+?)(\]\])`, ByGroups(Text, NameAttribute, Text), nil}, // [[link]] - {`(<<)([^<>]+?)(>>)`, ByGroups(Text, NameAttribute, Text), nil}, // <> - // Tables - {`^( *)(\|[ -].*?[ -]\|)$`, ByGroups(Text, String), nil}, - // Blank lines, newlines - {`\n`, Text, nil}, - // Any other text - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/pacman.go b/vendor/github.com/alecthomas/chroma/lexers/p/pacman.go deleted file mode 100644 index 807b67c5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/pacman.go +++ /dev/null @@ -1,26 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Pacmanconf lexer. -var Pacmanconf = internal.Register(MustNewLexer( - &Config{ - Name: "PacmanConf", - Aliases: []string{"pacmanconf"}, - Filenames: []string{"pacman.conf"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`#.*$`, CommentSingle, nil}, - {`^\s*\[.*?\]\s*$`, Keyword, nil}, - {`(\w+)(\s*)(=)`, ByGroups(NameAttribute, Text, Operator), nil}, - {`^(\s*)(\w+)(\s*)$`, ByGroups(Text, NameAttribute, Text), nil}, - {Words(``, `\b`, `$repo`, `$arch`, `%o`, `%u`), NameVariable, nil}, - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/perl.go b/vendor/github.com/alecthomas/chroma/lexers/p/perl.go deleted file mode 100644 index 0a2b35b9..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/perl.go +++ /dev/null @@ -1,138 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Perl lexer. -var Perl = internal.Register(MustNewLexer( - &Config{ - Name: "Perl", - Aliases: []string{"perl", "pl"}, - Filenames: []string{"*.pl", "*.pm", "*.t"}, - MimeTypes: []string{"text/x-perl", "application/x-perl"}, - DotAll: true, - }, - Rules{ - "balanced-regex": { - {`/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`!(\\\\|\\[^\\]|[^\\!])*![egimosx]*`, LiteralStringRegex, Pop(1)}, - {`\\(\\\\|[^\\])*\\[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`\{(\\\\|\\[^\\]|[^\\}])*\}[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*`, LiteralStringRegex, Pop(1)}, - {`\((\\\\|\\[^\\]|[^\\)])*\)[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*`, LiteralStringRegex, Pop(1)}, - {`\$(\\\\|\\[^\\]|[^\\$])*\$[egimosx]*`, LiteralStringRegex, Pop(1)}, - }, - "root": { - {`\A\#!.+?$`, CommentHashbang, nil}, - {`\#.*?$`, CommentSingle, nil}, - {`^=[a-zA-Z0-9]+\s+.*?\n=cut`, CommentMultiline, nil}, - {Words(``, `\b`, `case`, `continue`, `do`, `else`, `elsif`, `for`, `foreach`, `if`, `last`, `my`, `next`, `our`, `redo`, `reset`, `then`, `unless`, `until`, `while`, `print`, `new`, `BEGIN`, `CHECK`, `INIT`, `END`, `return`), Keyword, nil}, - {`(format)(\s+)(\w+)(\s*)(=)(\s*\n)`, ByGroups(Keyword, Text, Name, Text, Punctuation, Text), Push("format")}, - {`(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b`, OperatorWord, nil}, - {`s/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*`, LiteralStringRegex, nil}, - {`s!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*`, LiteralStringRegex, nil}, - {`s\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*`, LiteralStringRegex, nil}, - {`s@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*`, LiteralStringRegex, nil}, - {`s%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*`, LiteralStringRegex, nil}, - {`s\{(\\\\|\\[^\\]|[^\\}])*\}\s*`, LiteralStringRegex, Push("balanced-regex")}, - {`s<(\\\\|\\[^\\]|[^\\>])*>\s*`, LiteralStringRegex, Push("balanced-regex")}, - {`s\[(\\\\|\\[^\\]|[^\\\]])*\]\s*`, LiteralStringRegex, Push("balanced-regex")}, - {`s\((\\\\|\\[^\\]|[^\\)])*\)\s*`, LiteralStringRegex, Push("balanced-regex")}, - {`m?/(\\\\|\\[^\\]|[^\\/\n])*/[gcimosx]*`, LiteralStringRegex, nil}, - {`m(?=[/!\\{<\[(@%$])`, LiteralStringRegex, Push("balanced-regex")}, - {`((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*`, LiteralStringRegex, nil}, - {`\s+`, Text, nil}, - {Words(``, `\b`, `abs`, `accept`, `alarm`, `atan2`, `bind`, `binmode`, `bless`, `caller`, `chdir`, `chmod`, `chomp`, `chop`, `chown`, `chr`, `chroot`, `close`, `closedir`, `connect`, `continue`, `cos`, `crypt`, `dbmclose`, `dbmopen`, `defined`, `delete`, `die`, `dump`, `each`, `endgrent`, `endhostent`, `endnetent`, `endprotoent`, `endpwent`, `endservent`, `eof`, `eval`, `exec`, `exists`, `exit`, `exp`, `fcntl`, `fileno`, `flock`, `fork`, `format`, `formline`, `getc`, `getgrent`, `getgrgid`, `getgrnam`, `gethostbyaddr`, `gethostbyname`, `gethostent`, `getlogin`, `getnetbyaddr`, `getnetbyname`, `getnetent`, `getpeername`, `getpgrp`, `getppid`, `getpriority`, `getprotobyname`, `getprotobynumber`, `getprotoent`, `getpwent`, `getpwnam`, `getpwuid`, `getservbyname`, `getservbyport`, `getservent`, `getsockname`, `getsockopt`, `glob`, `gmtime`, `goto`, `grep`, `hex`, `import`, `index`, `int`, `ioctl`, `join`, `keys`, `kill`, `last`, `lc`, `lcfirst`, `length`, `link`, `listen`, `local`, `localtime`, `log`, `lstat`, `map`, `mkdir`, `msgctl`, `msgget`, `msgrcv`, `msgsnd`, `my`, `next`, `oct`, `open`, `opendir`, `ord`, `our`, `pack`, `pipe`, `pop`, `pos`, `printf`, `prototype`, `push`, `quotemeta`, `rand`, `read`, `readdir`, `readline`, `readlink`, `readpipe`, `recv`, `redo`, `ref`, `rename`, `reverse`, `rewinddir`, `rindex`, `rmdir`, `scalar`, `seek`, `seekdir`, `select`, `semctl`, `semget`, `semop`, `send`, `setgrent`, `sethostent`, `setnetent`, `setpgrp`, `setpriority`, `setprotoent`, `setpwent`, `setservent`, `setsockopt`, `shift`, `shmctl`, `shmget`, `shmread`, `shmwrite`, `shutdown`, `sin`, `sleep`, `socket`, `socketpair`, `sort`, `splice`, `split`, `sprintf`, `sqrt`, `srand`, `stat`, `study`, `substr`, `symlink`, `syscall`, `sysopen`, `sysread`, `sysseek`, `system`, `syswrite`, `tell`, `telldir`, `tie`, `tied`, `time`, `times`, `tr`, `truncate`, `uc`, `ucfirst`, `umask`, `undef`, `unlink`, `unpack`, `unshift`, `untie`, `utime`, `values`, `vec`, `wait`, `waitpid`, `wantarray`, `warn`, `write`), NameBuiltin, nil}, - {`((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b`, NameBuiltinPseudo, nil}, - {`(<<)([\'"]?)([a-zA-Z_]\w*)(\2;?\n.*?\n)(\3)(\n)`, ByGroups(LiteralString, LiteralString, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, Text), nil}, - {`__END__`, CommentPreproc, Push("end-part")}, - {`\$\^[ADEFHILMOPSTWX]`, NameVariableGlobal, nil}, - {"\\$[\\\\\\\"\\[\\]'&`+*.,;=%~?@$!<>(^|/-](?!\\w)", NameVariableGlobal, nil}, - {`[$@%#]+`, NameVariable, Push("varname")}, - {`0_?[0-7]+(_[0-7]+)*`, LiteralNumberOct, nil}, - {`0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*`, LiteralNumberHex, nil}, - {`0b[01]+(_[01]+)*`, LiteralNumberBin, nil}, - {`(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?`, LiteralNumberFloat, nil}, - {`(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*`, LiteralNumberFloat, nil}, - {`\d+(_\d+)*`, LiteralNumberInteger, nil}, - {`'(\\\\|\\[^\\]|[^'\\])*'`, LiteralString, nil}, - {`"(\\\\|\\[^\\]|[^"\\])*"`, LiteralString, nil}, - {"`(\\\\\\\\|\\\\[^\\\\]|[^`\\\\])*`", LiteralStringBacktick, nil}, - {`<([^\s>]+)>`, LiteralStringRegex, nil}, - {`(q|qq|qw|qr|qx)\{`, LiteralStringOther, Push("cb-string")}, - {`(q|qq|qw|qr|qx)\(`, LiteralStringOther, Push("rb-string")}, - {`(q|qq|qw|qr|qx)\[`, LiteralStringOther, Push("sb-string")}, - {`(q|qq|qw|qr|qx)\<`, LiteralStringOther, Push("lt-string")}, - {`(q|qq|qw|qr|qx)([\W_])(.|\n)*?\2`, LiteralStringOther, nil}, - {`(package)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)`, ByGroups(Keyword, Text, NameNamespace), nil}, - {`(use|require|no)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)`, ByGroups(Keyword, Text, NameNamespace), nil}, - {`(sub)(\s+)`, ByGroups(Keyword, Text), Push("funcname")}, - {Words(``, `\b`, `no`, `package`, `require`, `use`), Keyword, nil}, - {`(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|!~|&&?|\|\||\.{1,3})`, Operator, nil}, - {`[-+/*%=<>&^|!\\~]=?`, Operator, nil}, - {`[()\[\]:;,<>/?{}]`, Punctuation, nil}, - {`(?=\w)`, Name, Push("name")}, - }, - "format": { - {`\.\n`, LiteralStringInterpol, Pop(1)}, - {`[^\n]*\n`, LiteralStringInterpol, nil}, - }, - "varname": { - {`\s+`, Text, nil}, - {`\{`, Punctuation, Pop(1)}, - {`\)|,`, Punctuation, Pop(1)}, - {`\w+::`, NameNamespace, nil}, - {`[\w:]+`, NameVariable, Pop(1)}, - }, - "name": { - {`[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*(::)?(?=\s*->)`, NameNamespace, Pop(1)}, - {`[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*::`, NameNamespace, Pop(1)}, - {`[\w:]+`, Name, Pop(1)}, - {`[A-Z_]+(?=\W)`, NameConstant, Pop(1)}, - {`(?=\W)`, Text, Pop(1)}, - }, - "funcname": { - {`[a-zA-Z_]\w*[!?]?`, NameFunction, nil}, - {`\s+`, Text, nil}, - {`(\([$@%]*\))(\s*)`, ByGroups(Punctuation, Text), nil}, - {`;`, Punctuation, Pop(1)}, - {`.*?\{`, Punctuation, Pop(1)}, - }, - "cb-string": { - {`\\[{}\\]`, LiteralStringOther, nil}, - {`\\`, LiteralStringOther, nil}, - {`\{`, LiteralStringOther, Push("cb-string")}, - {`\}`, LiteralStringOther, Pop(1)}, - {`[^{}\\]+`, LiteralStringOther, nil}, - }, - "rb-string": { - {`\\[()\\]`, LiteralStringOther, nil}, - {`\\`, LiteralStringOther, nil}, - {`\(`, LiteralStringOther, Push("rb-string")}, - {`\)`, LiteralStringOther, Pop(1)}, - {`[^()]+`, LiteralStringOther, nil}, - }, - "sb-string": { - {`\\[\[\]\\]`, LiteralStringOther, nil}, - {`\\`, LiteralStringOther, nil}, - {`\[`, LiteralStringOther, Push("sb-string")}, - {`\]`, LiteralStringOther, Pop(1)}, - {`[^\[\]]+`, LiteralStringOther, nil}, - }, - "lt-string": { - {`\\[<>\\]`, LiteralStringOther, nil}, - {`\\`, LiteralStringOther, nil}, - {`\<`, LiteralStringOther, Push("lt-string")}, - {`\>`, LiteralStringOther, Pop(1)}, - {`[^<>]+`, LiteralStringOther, nil}, - }, - "end-part": { - {`.+`, CommentPreproc, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/pig.go b/vendor/github.com/alecthomas/chroma/lexers/p/pig.go deleted file mode 100644 index 0dbc591a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/pig.go +++ /dev/null @@ -1,57 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Pig lexer. -var Pig = internal.Register(MustNewLexer( - &Config{ - Name: "Pig", - Aliases: []string{"pig"}, - Filenames: []string{"*.pig"}, - MimeTypes: []string{"text/x-pig"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`--.*`, Comment, nil}, - {`/\*[\w\W]*?\*/`, CommentMultiline, nil}, - {`\\\n`, Text, nil}, - {`\\`, Text, nil}, - {`\'(?:\\[ntbrf\\\']|\\u[0-9a-f]{4}|[^\'\\\n\r])*\'`, LiteralString, nil}, - Include("keywords"), - Include("types"), - Include("builtins"), - Include("punct"), - Include("operators"), - {`[0-9]*\.[0-9]+(e[0-9]+)?[fd]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-f]+`, LiteralNumberHex, nil}, - {`[0-9]+L?`, LiteralNumberInteger, nil}, - {`\n`, Text, nil}, - {`([a-z_]\w*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[()#:]`, Text, nil}, - {`[^(:#\'")\s]+`, Text, nil}, - {`\S+\s+`, Text, nil}, - }, - "keywords": { - {`(assert|and|any|all|arrange|as|asc|bag|by|cache|CASE|cat|cd|cp|%declare|%default|define|dense|desc|describe|distinct|du|dump|eval|exex|explain|filter|flatten|foreach|full|generate|group|help|if|illustrate|import|inner|input|into|is|join|kill|left|limit|load|ls|map|matches|mkdir|mv|not|null|onschema|or|order|outer|output|parallel|pig|pwd|quit|register|returns|right|rm|rmf|rollup|run|sample|set|ship|split|stderr|stdin|stdout|store|stream|through|union|using|void)\b`, Keyword, nil}, - }, - "builtins": { - {`(AVG|BinStorage|cogroup|CONCAT|copyFromLocal|copyToLocal|COUNT|cross|DIFF|MAX|MIN|PigDump|PigStorage|SIZE|SUM|TextLoader|TOKENIZE)\b`, NameBuiltin, nil}, - }, - "types": { - {`(bytearray|BIGINTEGER|BIGDECIMAL|chararray|datetime|double|float|int|long|tuple)\b`, KeywordType, nil}, - }, - "punct": { - {`[;(){}\[\]]`, Punctuation, nil}, - }, - "operators": { - {`[#=,./%+\-?]`, Operator, nil}, - {`(eq|gt|lt|gte|lte|neq|matches)\b`, Operator, nil}, - {`(==|<=|<|>=|>|!=)`, Operator, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/pkgconfig.go b/vendor/github.com/alecthomas/chroma/lexers/p/pkgconfig.go deleted file mode 100644 index 0a4872e7..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/pkgconfig.go +++ /dev/null @@ -1,41 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Pkgconfig lexer. -var Pkgconfig = internal.Register(MustNewLexer( - &Config{ - Name: "PkgConfig", - Aliases: []string{"pkgconfig"}, - Filenames: []string{"*.pc"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`#.*$`, CommentSingle, nil}, - {`^(\w+)(=)`, ByGroups(NameAttribute, Operator), nil}, - {`^([\w.]+)(:)`, ByGroups(NameTag, Punctuation), Push("spvalue")}, - Include("interp"), - {`[^${}#=:\n.]+`, Text, nil}, - {`.`, Text, nil}, - }, - "interp": { - {`\$\$`, Text, nil}, - {`\$\{`, LiteralStringInterpol, Push("curly")}, - }, - "curly": { - {`\}`, LiteralStringInterpol, Pop(1)}, - {`\w+`, NameAttribute, nil}, - }, - "spvalue": { - Include("interp"), - {`#.*$`, CommentSingle, Pop(1)}, - {`\n`, Text, Pop(1)}, - {`[^${}#\n]+`, Text, nil}, - {`.`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go b/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go deleted file mode 100644 index 50b8f35d..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go +++ /dev/null @@ -1,16 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var Plaintext = internal.Register(MustNewLexer( - &Config{ - Name: "plaintext", - Aliases: []string{"text", "plain", "no-highlight"}, - Filenames: []string{"*.txt"}, - MimeTypes: []string{"text/plain"}, - }, - internal.PlaintextRules, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/plsql.go b/vendor/github.com/alecthomas/chroma/lexers/p/plsql.go deleted file mode 100644 index a6068fd2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/plsql.go +++ /dev/null @@ -1,58 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Pl/Pgsql lexer. -var PLpgSQL = internal.Register(MustNewLexer( - &Config{ - Name: "PL/pgSQL", - Aliases: []string{"plpgsql"}, - Filenames: []string{}, - MimeTypes: []string{"text/x-plpgsql"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\%[a-z]\w*\b`, NameBuiltin, nil}, - {`:=`, Operator, nil}, - {`\<\<[a-z]\w*\>\>`, NameLabel, nil}, - {`\#[a-z]\w*\b`, KeywordPseudo, nil}, - {`\s+`, Text, nil}, - {`--.*\n?`, CommentSingle, nil}, - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`(bigint|bigserial|bit|bit\s+varying|bool|boolean|box|bytea|char|character|character\s+varying|cidr|circle|date|decimal|double\s+precision|float4|float8|inet|int|int2|int4|int8|integer|interval|json|jsonb|line|lseg|macaddr|money|numeric|path|pg_lsn|point|polygon|real|serial|serial2|serial4|serial8|smallint|smallserial|text|time|timestamp|timestamptz|timetz|tsquery|tsvector|txid_snapshot|uuid|varbit|varchar|with\s+time\s+zone|without\s+time\s+zone|xml|anyarray|anyelement|anyenum|anynonarray|anyrange|cstring|fdw_handler|internal|language_handler|opaque|record|void)\b`, NameBuiltin, nil}, - {Words(``, `\b`, `ABORT`, `ABSOLUTE`, `ACCESS`, `ACTION`, `ADD`, `ADMIN`, `AFTER`, `AGGREGATE`, `ALL`, `ALSO`, `ALTER`, `ALWAYS`, `ANALYSE`, `ANALYZE`, `AND`, `ANY`, `ARRAY`, `AS`, `ASC`, `ASSERTION`, `ASSIGNMENT`, `ASYMMETRIC`, `AT`, `ATTRIBUTE`, `AUTHORIZATION`, `BACKWARD`, `BEFORE`, `BEGIN`, `BETWEEN`, `BIGINT`, `BINARY`, `BIT`, `BOOLEAN`, `BOTH`, `BY`, `CACHE`, `CALLED`, `CASCADE`, `CASCADED`, `CASE`, `CAST`, `CATALOG`, `CHAIN`, `CHAR`, `CHARACTER`, `CHARACTERISTICS`, `CHECK`, `CHECKPOINT`, `CLASS`, `CLOSE`, `CLUSTER`, `COALESCE`, `COLLATE`, `COLLATION`, `COLUMN`, `COMMENT`, `COMMENTS`, `COMMIT`, `COMMITTED`, `CONCURRENTLY`, `CONFIGURATION`, `CONNECTION`, `CONSTRAINT`, `CONSTRAINTS`, `CONTENT`, `CONTINUE`, `CONVERSION`, `COPY`, `COST`, `CREATE`, `CROSS`, `CSV`, `CURRENT`, `CURRENT_CATALOG`, `CURRENT_DATE`, `CURRENT_ROLE`, `CURRENT_SCHEMA`, `CURRENT_TIME`, `CURRENT_TIMESTAMP`, `CURRENT_USER`, `CURSOR`, `CYCLE`, `DATA`, `DATABASE`, `DAY`, `DEALLOCATE`, `DEC`, `DECIMAL`, `DECLARE`, `DEFAULT`, `DEFAULTS`, `DEFERRABLE`, `DEFERRED`, `DEFINER`, `DELETE`, `DELIMITER`, `DELIMITERS`, `DESC`, `DICTIONARY`, `DISABLE`, `DISCARD`, `DISTINCT`, `DO`, `DOCUMENT`, `DOMAIN`, `DOUBLE`, `DROP`, `EACH`, `ELSE`, `ENABLE`, `ENCODING`, `ENCRYPTED`, `END`, `ENUM`, `ESCAPE`, `EVENT`, `EXCEPT`, `EXCLUDE`, `EXCLUDING`, `EXCLUSIVE`, `EXECUTE`, `EXISTS`, `EXPLAIN`, `EXTENSION`, `EXTERNAL`, `EXTRACT`, `FALSE`, `FAMILY`, `FETCH`, `FILTER`, `FIRST`, `FLOAT`, `FOLLOWING`, `FOR`, `FORCE`, `FOREIGN`, `FORWARD`, `FREEZE`, `FROM`, `FULL`, `FUNCTION`, `FUNCTIONS`, `GLOBAL`, `GRANT`, `GRANTED`, `GREATEST`, `GROUP`, `HANDLER`, `HAVING`, `HEADER`, `HOLD`, `HOUR`, `IDENTITY`, `IF`, `ILIKE`, `IMMEDIATE`, `IMMUTABLE`, `IMPLICIT`, `IN`, `INCLUDING`, `INCREMENT`, `INDEX`, `INDEXES`, `INHERIT`, `INHERITS`, `INITIALLY`, `INLINE`, `INNER`, `INOUT`, `INPUT`, `INSENSITIVE`, `INSERT`, `INSTEAD`, `INT`, `INTEGER`, `INTERSECT`, `INTERVAL`, `INTO`, `INVOKER`, `IS`, `ISNULL`, `ISOLATION`, `JOIN`, `KEY`, `LABEL`, `LANGUAGE`, `LARGE`, `LAST`, `LATERAL`, `LC_COLLATE`, `LC_CTYPE`, `LEADING`, `LEAKPROOF`, `LEAST`, `LEFT`, `LEVEL`, `LIKE`, `LIMIT`, `LISTEN`, `LOAD`, `LOCAL`, `LOCALTIME`, `LOCALTIMESTAMP`, `LOCATION`, `LOCK`, `MAPPING`, `MATCH`, `MATERIALIZED`, `MAXVALUE`, `MINUTE`, `MINVALUE`, `MODE`, `MONTH`, `MOVE`, `NAME`, `NAMES`, `NATIONAL`, `NATURAL`, `NCHAR`, `NEXT`, `NO`, `NONE`, `NOT`, `NOTHING`, `NOTIFY`, `NOTNULL`, `NOWAIT`, `NULL`, `NULLIF`, `NULLS`, `NUMERIC`, `OBJECT`, `OF`, `OFF`, `OFFSET`, `OIDS`, `ON`, `ONLY`, `OPERATOR`, `OPTION`, `OPTIONS`, `OR`, `ORDER`, `ORDINALITY`, `OUT`, `OUTER`, `OVER`, `OVERLAPS`, `OVERLAY`, `OWNED`, `OWNER`, `PARSER`, `PARTIAL`, `PARTITION`, `PASSING`, `PASSWORD`, `PLACING`, `PLANS`, `POLICY`, `POSITION`, `PRECEDING`, `PRECISION`, `PREPARE`, `PREPARED`, `PRESERVE`, `PRIMARY`, `PRIOR`, `PRIVILEGES`, `PROCEDURAL`, `PROCEDURE`, `PROGRAM`, `QUOTE`, `RANGE`, `READ`, `REAL`, `REASSIGN`, `RECHECK`, `RECURSIVE`, `REF`, `REFERENCES`, `REFRESH`, `REINDEX`, `RELATIVE`, `RELEASE`, `RENAME`, `REPEATABLE`, `REPLACE`, `REPLICA`, `RESET`, `RESTART`, `RESTRICT`, `RETURNING`, `RETURNS`, `REVOKE`, `RIGHT`, `ROLE`, `ROLLBACK`, `ROW`, `ROWS`, `RULE`, `SAVEPOINT`, `SCHEMA`, `SCROLL`, `SEARCH`, `SECOND`, `SECURITY`, `SELECT`, `SEQUENCE`, `SEQUENCES`, `SERIALIZABLE`, `SERVER`, `SESSION`, `SESSION_USER`, `SET`, `SETOF`, `SHARE`, `SHOW`, `SIMILAR`, `SIMPLE`, `SMALLINT`, `SNAPSHOT`, `SOME`, `STABLE`, `STANDALONE`, `START`, `STATEMENT`, `STATISTICS`, `STDIN`, `STDOUT`, `STORAGE`, `STRICT`, `STRIP`, `SUBSTRING`, `SYMMETRIC`, `SYSID`, `SYSTEM`, `TABLE`, `TABLES`, `TABLESPACE`, `TEMP`, `TEMPLATE`, `TEMPORARY`, `TEXT`, `THEN`, `TIME`, `TIMESTAMP`, `TO`, `TRAILING`, `TRANSACTION`, `TREAT`, `TRIGGER`, `TRIM`, `TRUE`, `TRUNCATE`, `TRUSTED`, `TYPE`, `TYPES`, `UNBOUNDED`, `UNCOMMITTED`, `UNENCRYPTED`, `UNION`, `UNIQUE`, `UNKNOWN`, `UNLISTEN`, `UNLOGGED`, `UNTIL`, `UPDATE`, `USER`, `USING`, `VACUUM`, `VALID`, `VALIDATE`, `VALIDATOR`, `VALUE`, `VALUES`, `VARCHAR`, `VARIADIC`, `VARYING`, `VERBOSE`, `VERSION`, `VIEW`, `VIEWS`, `VOLATILE`, `WHEN`, `WHERE`, `WHITESPACE`, `WINDOW`, `WITH`, `WITHIN`, `WITHOUT`, `WORK`, `WRAPPER`, `WRITE`, `XML`, `XMLATTRIBUTES`, `XMLCONCAT`, `XMLELEMENT`, `XMLEXISTS`, `XMLFOREST`, `XMLPARSE`, `XMLPI`, `XMLROOT`, `XMLSERIALIZE`, `YEAR`, `YES`, `ZONE`, `ALIAS`, `CONSTANT`, `DIAGNOSTICS`, `ELSIF`, `EXCEPTION`, `EXIT`, `FOREACH`, `GET`, `LOOP`, `NOTICE`, `OPEN`, `PERFORM`, `QUERY`, `RAISE`, `RETURN`, `REVERSE`, `SQLSTATE`, `WHILE`), Keyword, nil}, - {"[+*/<>=~!@#%^&|`?-]+", Operator, nil}, - {`::`, Operator, nil}, - {`\$\d+`, NameVariable, nil}, - {`([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`((?:E|U&)?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("string")}, - {`((?:U&)?)(")`, ByGroups(LiteralStringAffix, LiteralStringName), Push("quoted-ident")}, - // { `(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)`, ?? ??, nil }, - {`[a-z_]\w*`, Name, nil}, - {`:(['"]?)[a-z]\w*\b\1`, NameVariable, nil}, - {`[;:()\[\]{},.]`, Punctuation, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "quoted-ident": { - {`[^"]+`, LiteralStringName, nil}, - {`""`, LiteralStringName, nil}, - {`"`, LiteralStringName, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/postgres.go b/vendor/github.com/alecthomas/chroma/lexers/p/postgres.go deleted file mode 100644 index 3afa54de..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/postgres.go +++ /dev/null @@ -1,77 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Postgresql Sql Dialect lexer. -var PostgreSQL = internal.Register(MustNewLexer( - &Config{ - Name: "PostgreSQL SQL dialect", - Aliases: []string{"postgresql", "postgres"}, - Filenames: []string{}, - MimeTypes: []string{"text/x-postgresql"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`--.*\n?`, CommentSingle, nil}, - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`(bigint|bigserial|bit|bit\s+varying|bool|boolean|box|bytea|char|character|character\s+varying|cidr|circle|date|decimal|double\s+precision|float4|float8|inet|int|int2|int4|int8|integer|interval|json|jsonb|line|lseg|macaddr|money|numeric|path|pg_lsn|point|polygon|real|serial|serial2|serial4|serial8|smallint|smallserial|text|time|timestamp|timestamptz|timetz|tsquery|tsvector|txid_snapshot|uuid|varbit|varchar|with\s+time\s+zone|without\s+time\s+zone|xml|anyarray|anyelement|anyenum|anynonarray|anyrange|cstring|fdw_handler|internal|language_handler|opaque|record|void)\b`, NameBuiltin, nil}, - {`(?s)(DO)(\s+)(?:(LANGUAGE)?(\s+)('?)(\w+)?('?)(\s+))?(\$)([^$]*)(\$)(.*?)(\$)(\10)(\$)`, - UsingByGroup( - internal.Get, - 6, 12, - Keyword, Text, Keyword, Text, // DO LANGUAGE - StringSingle, StringSingle, StringSingle, Text, // 'plpgsql' - StringHeredoc, StringHeredoc, StringHeredoc, // $tag$ - StringHeredoc, // (code block) - StringHeredoc, StringHeredoc, StringHeredoc, // $tag$ - ), - nil, - }, - {Words(``, `\b`, `ABORT`, `ABSOLUTE`, `ACCESS`, `ACTION`, `ADD`, `ADMIN`, `AFTER`, `AGGREGATE`, `ALL`, `ALSO`, `ALTER`, `ALWAYS`, `ANALYSE`, `ANALYZE`, `AND`, `ANY`, `ARRAY`, `AS`, `ASC`, `ASSERTION`, `ASSIGNMENT`, `ASYMMETRIC`, `AT`, `ATTRIBUTE`, `AUTHORIZATION`, `BACKWARD`, `BEFORE`, `BEGIN`, `BETWEEN`, `BIGINT`, `BINARY`, `BIT`, `BOOLEAN`, `BOTH`, `BY`, `CACHE`, `CALLED`, `CASCADE`, `CASCADED`, `CASE`, `CAST`, `CATALOG`, `CHAIN`, `CHAR`, `CHARACTER`, `CHARACTERISTICS`, `CHECK`, `CHECKPOINT`, `CLASS`, `CLOSE`, `CLUSTER`, `COALESCE`, `COLLATE`, `COLLATION`, `COLUMN`, `COMMENT`, `COMMENTS`, `COMMIT`, `COMMITTED`, `CONCURRENTLY`, `CONFIGURATION`, `CONNECTION`, `CONSTRAINT`, `CONSTRAINTS`, `CONTENT`, `CONTINUE`, `CONVERSION`, `COPY`, `COST`, `CREATE`, `CROSS`, `CSV`, `CURRENT`, `CURRENT_CATALOG`, `CURRENT_DATE`, `CURRENT_ROLE`, `CURRENT_SCHEMA`, `CURRENT_TIME`, `CURRENT_TIMESTAMP`, `CURRENT_USER`, `CURSOR`, `CYCLE`, `DATA`, `DATABASE`, `DAY`, `DEALLOCATE`, `DEC`, `DECIMAL`, `DECLARE`, `DEFAULT`, `DEFAULTS`, `DEFERRABLE`, `DEFERRED`, `DEFINER`, `DELETE`, `DELIMITER`, `DELIMITERS`, `DESC`, `DICTIONARY`, `DISABLE`, `DISCARD`, `DISTINCT`, `DO`, `DOCUMENT`, `DOMAIN`, `DOUBLE`, `DROP`, `EACH`, `ELSE`, `ENABLE`, `ENCODING`, `ENCRYPTED`, `END`, `ENUM`, `ESCAPE`, `EVENT`, `EXCEPT`, `EXCLUDE`, `EXCLUDING`, `EXCLUSIVE`, `EXECUTE`, `EXISTS`, `EXPLAIN`, `EXTENSION`, `EXTERNAL`, `EXTRACT`, `FALSE`, `FAMILY`, `FETCH`, `FILTER`, `FIRST`, `FLOAT`, `FOLLOWING`, `FOR`, `FORCE`, `FOREIGN`, `FORWARD`, `FREEZE`, `FROM`, `FULL`, `FUNCTION`, `FUNCTIONS`, `GLOBAL`, `GRANT`, `GRANTED`, `GREATEST`, `GROUP`, `HANDLER`, `HAVING`, `HEADER`, `HOLD`, `HOUR`, `IDENTITY`, `IF`, `ILIKE`, `IMMEDIATE`, `IMMUTABLE`, `IMPLICIT`, `IN`, `INCLUDING`, `INCREMENT`, `INDEX`, `INDEXES`, `INHERIT`, `INHERITS`, `INITIALLY`, `INLINE`, `INNER`, `INOUT`, `INPUT`, `INSENSITIVE`, `INSERT`, `INSTEAD`, `INT`, `INTEGER`, `INTERSECT`, `INTERVAL`, `INTO`, `INVOKER`, `IS`, `ISNULL`, `ISOLATION`, `JOIN`, `KEY`, `LABEL`, `LANGUAGE`, `LARGE`, `LAST`, `LATERAL`, `LC_COLLATE`, `LC_CTYPE`, `LEADING`, `LEAKPROOF`, `LEAST`, `LEFT`, `LEVEL`, `LIKE`, `LIMIT`, `LISTEN`, `LOAD`, `LOCAL`, `LOCALTIME`, `LOCALTIMESTAMP`, `LOCATION`, `LOCK`, `MAPPING`, `MATCH`, `MATERIALIZED`, `MAXVALUE`, `MINUTE`, `MINVALUE`, `MODE`, `MONTH`, `MOVE`, `NAME`, `NAMES`, `NATIONAL`, `NATURAL`, `NCHAR`, `NEXT`, `NO`, `NONE`, `NOT`, `NOTHING`, `NOTIFY`, `NOTNULL`, `NOWAIT`, `NULL`, `NULLIF`, `NULLS`, `NUMERIC`, `OBJECT`, `OF`, `OFF`, `OFFSET`, `OIDS`, `ON`, `ONLY`, `OPERATOR`, `OPTION`, `OPTIONS`, `OR`, `ORDER`, `ORDINALITY`, `OUT`, `OUTER`, `OVER`, `OVERLAPS`, `OVERLAY`, `OWNED`, `OWNER`, `PARSER`, `PARTIAL`, `PARTITION`, `PASSING`, `PASSWORD`, `PLACING`, `PLANS`, `POLICY`, `POSITION`, `PRECEDING`, `PRECISION`, `PREPARE`, `PREPARED`, `PRESERVE`, `PRIMARY`, `PRIOR`, `PRIVILEGES`, `PROCEDURAL`, `PROCEDURE`, `PROGRAM`, `QUOTE`, `RANGE`, `READ`, `REAL`, `REASSIGN`, `RECHECK`, `RECURSIVE`, `REF`, `REFERENCES`, `REFRESH`, `REINDEX`, `RELATIVE`, `RELEASE`, `RENAME`, `REPEATABLE`, `REPLACE`, `REPLICA`, `RESET`, `RESTART`, `RESTRICT`, `RETURNING`, `RETURNS`, `REVOKE`, `RIGHT`, `ROLE`, `ROLLBACK`, `ROW`, `ROWS`, `RULE`, `SAVEPOINT`, `SCHEMA`, `SCROLL`, `SEARCH`, `SECOND`, `SECURITY`, `SELECT`, `SEQUENCE`, `SEQUENCES`, `SERIALIZABLE`, `SERVER`, `SESSION`, `SESSION_USER`, `SET`, `SETOF`, `SHARE`, `SHOW`, `SIMILAR`, `SIMPLE`, `SMALLINT`, `SNAPSHOT`, `SOME`, `STABLE`, `STANDALONE`, `START`, `STATEMENT`, `STATISTICS`, `STDIN`, `STDOUT`, `STORAGE`, `STRICT`, `STRIP`, `SUBSTRING`, `SYMMETRIC`, `SYSID`, `SYSTEM`, `TABLE`, `TABLES`, `TABLESPACE`, `TEMP`, `TEMPLATE`, `TEMPORARY`, `TEXT`, `THEN`, `TIME`, `TIMESTAMP`, `TO`, `TRAILING`, `TRANSACTION`, `TREAT`, `TRIGGER`, `TRIM`, `TRUE`, `TRUNCATE`, `TRUSTED`, `TYPE`, `TYPES`, `UNBOUNDED`, `UNCOMMITTED`, `UNENCRYPTED`, `UNION`, `UNIQUE`, `UNKNOWN`, `UNLISTEN`, `UNLOGGED`, `UNTIL`, `UPDATE`, `USER`, `USING`, `VACUUM`, `VALID`, `VALIDATE`, `VALIDATOR`, `VALUE`, `VALUES`, `VARCHAR`, `VARIADIC`, `VARYING`, `VERBOSE`, `VERSION`, `VIEW`, `VIEWS`, `VOLATILE`, `WHEN`, `WHERE`, `WHITESPACE`, `WINDOW`, `WITH`, `WITHIN`, `WITHOUT`, `WORK`, `WRAPPER`, `WRITE`, `XML`, `XMLATTRIBUTES`, `XMLCONCAT`, `XMLELEMENT`, `XMLEXISTS`, `XMLFOREST`, `XMLPARSE`, `XMLPI`, `XMLROOT`, `XMLSERIALIZE`, `YEAR`, `YES`, `ZONE`), Keyword, nil}, - {"[+*/<>=~!@#%^&|`?-]+", Operator, nil}, - {`::`, Operator, nil}, - {`\$\d+`, NameVariable, nil}, - {`([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`((?:E|U&)?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("string")}, - {`((?:U&)?)(")`, ByGroups(LiteralStringAffix, LiteralStringName), Push("quoted-ident")}, - {`(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)(\s+)(LANGUAGE)?(\s+)('?)(\w+)?('?)`, - UsingByGroup(internal.Get, - 12, 4, - StringHeredoc, StringHeredoc, StringHeredoc, // $tag$ - StringHeredoc, // (code block) - StringHeredoc, StringHeredoc, StringHeredoc, // $tag$ - Text, Keyword, Text, // LANGUAGE - StringSingle, StringSingle, StringSingle, // 'type' - ), - nil, - }, - {`(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)`, LiteralStringHeredoc, nil}, - {`[a-z_]\w*`, Name, nil}, - {`:(['"]?)[a-z]\w*\b\1`, NameVariable, nil}, - {`[;:()\[\]{},.]`, Punctuation, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "quoted-ident": { - {`[^"]+`, LiteralStringName, nil}, - {`""`, LiteralStringName, nil}, - {`"`, LiteralStringName, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/postscript.go b/vendor/github.com/alecthomas/chroma/lexers/p/postscript.go deleted file mode 100644 index 0cfa3a5f..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/postscript.go +++ /dev/null @@ -1,46 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Postscript lexer. -var Postscript = internal.Register(MustNewLexer( - &Config{ - Name: "PostScript", - Aliases: []string{"postscript", "postscr"}, - Filenames: []string{"*.ps", "*.eps"}, - MimeTypes: []string{"application/postscript"}, - }, - Rules{ - "root": { - {`^%!.+\n`, CommentPreproc, nil}, - {`%%.*\n`, CommentSpecial, nil}, - {`(^%.*\n){2,}`, CommentMultiline, nil}, - {`%.*\n`, CommentSingle, nil}, - {`\(`, LiteralString, Push("stringliteral")}, - {`[{}<>\[\]]`, Punctuation, nil}, - {`<[0-9A-Fa-f]+>(?=[()<>\[\]{}/%\s])`, LiteralNumberHex, nil}, - {`[0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])`, LiteralNumberOct, nil}, - {`(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])`, LiteralNumberFloat, nil}, - {`(\-|\+)?[0-9]+(?=[()<>\[\]{}/%\s])`, LiteralNumberInteger, nil}, - {`\/[^()<>\[\]{}/%\s]+(?=[()<>\[\]{}/%\s])`, NameVariable, nil}, - {`[^()<>\[\]{}/%\s]+(?=[()<>\[\]{}/%\s])`, NameFunction, nil}, - {`(false|true)(?=[()<>\[\]{}/%\s])`, KeywordConstant, nil}, - {`(eq|ne|g[et]|l[et]|and|or|not|if(?:else)?|for(?:all)?)(?=[()<>\[\]{}/%\s])`, KeywordReserved, nil}, - {Words(``, `(?=[()<>\[\]{}/%\s])`, `abs`, `add`, `aload`, `arc`, `arcn`, `array`, `atan`, `begin`, `bind`, `ceiling`, `charpath`, `clip`, `closepath`, `concat`, `concatmatrix`, `copy`, `cos`, `currentlinewidth`, `currentmatrix`, `currentpoint`, `curveto`, `cvi`, `cvs`, `def`, `defaultmatrix`, `dict`, `dictstackoverflow`, `div`, `dtransform`, `dup`, `end`, `exch`, `exec`, `exit`, `exp`, `fill`, `findfont`, `floor`, `get`, `getinterval`, `grestore`, `gsave`, `gt`, `identmatrix`, `idiv`, `idtransform`, `index`, `invertmatrix`, `itransform`, `length`, `lineto`, `ln`, `load`, `log`, `loop`, `matrix`, `mod`, `moveto`, `mul`, `neg`, `newpath`, `pathforall`, `pathbbox`, `pop`, `print`, `pstack`, `put`, `quit`, `rand`, `rangecheck`, `rcurveto`, `repeat`, `restore`, `rlineto`, `rmoveto`, `roll`, `rotate`, `round`, `run`, `save`, `scale`, `scalefont`, `setdash`, `setfont`, `setgray`, `setlinecap`, `setlinejoin`, `setlinewidth`, `setmatrix`, `setrgbcolor`, `shfill`, `show`, `showpage`, `sin`, `sqrt`, `stack`, `stringwidth`, `stroke`, `strokepath`, `sub`, `syntaxerror`, `transform`, `translate`, `truncate`, `typecheck`, `undefined`, `undefinedfilename`, `undefinedresult`), NameBuiltin, nil}, - {`\s+`, Text, nil}, - }, - "stringliteral": { - {`[^()\\]+`, LiteralString, nil}, - {`\\`, LiteralStringEscape, Push("escape")}, - {`\(`, LiteralString, Push()}, - {`\)`, LiteralString, Pop(1)}, - }, - "escape": { - {`[0-8]{3}|n|r|t|b|f|\\|\(|\)`, LiteralStringEscape, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/povray.go b/vendor/github.com/alecthomas/chroma/lexers/p/povray.go deleted file mode 100644 index 6f1bb524..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/povray.go +++ /dev/null @@ -1,35 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Povray lexer. -var Povray = internal.Register(MustNewLexer( - &Config{ - Name: "POVRay", - Aliases: []string{"pov"}, - Filenames: []string{"*.pov", "*.inc"}, - MimeTypes: []string{"text/x-povray"}, - }, - Rules{ - "root": { - {`/\*[\w\W]*?\*/`, CommentMultiline, nil}, - {`//.*\n`, CommentSingle, nil}, - {`(?s)"(?:\\.|[^"\\])+"`, LiteralStringDouble, nil}, - {Words(`#`, `\b`, `break`, `case`, `debug`, `declare`, `default`, `define`, `else`, `elseif`, `end`, `error`, `fclose`, `fopen`, `for`, `if`, `ifdef`, `ifndef`, `include`, `local`, `macro`, `range`, `read`, `render`, `statistics`, `switch`, `undef`, `version`, `warning`, `while`, `write`), CommentPreproc, nil}, - {Words(`\b`, `\b`, `aa_level`, `aa_threshold`, `abs`, `acos`, `acosh`, `adaptive`, `adc_bailout`, `agate`, `agate_turb`, `all`, `alpha`, `ambient`, `ambient_light`, `angle`, `aperture`, `arc_angle`, `area_light`, `asc`, `asin`, `asinh`, `assumed_gamma`, `atan`, `atan2`, `atanh`, `atmosphere`, `atmospheric_attenuation`, `attenuating`, `average`, `background`, `black_hole`, `blue`, `blur_samples`, `bounded_by`, `box_mapping`, `bozo`, `break`, `brick`, `brick_size`, `brightness`, `brilliance`, `bumps`, `bumpy1`, `bumpy2`, `bumpy3`, `bump_map`, `bump_size`, `case`, `caustics`, `ceil`, `checker`, `chr`, `clipped_by`, `clock`, `color`, `color_map`, `colour`, `colour_map`, `component`, `composite`, `concat`, `confidence`, `conic_sweep`, `constant`, `control0`, `control1`, `cos`, `cosh`, `count`, `crackle`, `crand`, `cube`, `cubic_spline`, `cylindrical_mapping`, `debug`, `declare`, `default`, `degrees`, `dents`, `diffuse`, `direction`, `distance`, `distance_maximum`, `div`, `dust`, `dust_type`, `eccentricity`, `else`, `emitting`, `end`, `error`, `error_bound`, `exp`, `exponent`, `fade_distance`, `fade_power`, `falloff`, `falloff_angle`, `false`, `file_exists`, `filter`, `finish`, `fisheye`, `flatness`, `flip`, `floor`, `focal_point`, `fog`, `fog_alt`, `fog_offset`, `fog_type`, `frequency`, `gif`, `global_settings`, `glowing`, `gradient`, `granite`, `gray_threshold`, `green`, `halo`, `hexagon`, `hf_gray_16`, `hierarchy`, `hollow`, `hypercomplex`, `if`, `ifdef`, `iff`, `image_map`, `incidence`, `include`, `int`, `interpolate`, `inverse`, `ior`, `irid`, `irid_wavelength`, `jitter`, `lambda`, `leopard`, `linear`, `linear_spline`, `linear_sweep`, `location`, `log`, `looks_like`, `look_at`, `low_error_factor`, `mandel`, `map_type`, `marble`, `material_map`, `matrix`, `max`, `max_intersections`, `max_iteration`, `max_trace_level`, `max_value`, `metallic`, `min`, `minimum_reuse`, `mod`, `mortar`, `nearest_count`, `no`, `normal`, `normal_map`, `no_shadow`, `number_of_waves`, `octaves`, `off`, `offset`, `omega`, `omnimax`, `on`, `once`, `onion`, `open`, `orthographic`, `panoramic`, `pattern1`, `pattern2`, `pattern3`, `perspective`, `pgm`, `phase`, `phong`, `phong_size`, `pi`, `pigment`, `pigment_map`, `planar_mapping`, `png`, `point_at`, `pot`, `pow`, `ppm`, `precision`, `pwr`, `quadratic_spline`, `quaternion`, `quick_color`, `quick_colour`, `quilted`, `radial`, `radians`, `radiosity`, `radius`, `rainbow`, `ramp_wave`, `rand`, `range`, `reciprocal`, `recursion_limit`, `red`, `reflection`, `refraction`, `render`, `repeat`, `rgb`, `rgbf`, `rgbft`, `rgbt`, `right`, `ripples`, `rotate`, `roughness`, `samples`, `scale`, `scallop_wave`, `scattering`, `seed`, `shadowless`, `sin`, `sine_wave`, `sinh`, `sky`, `sky_sphere`, `slice`, `slope_map`, `smooth`, `specular`, `spherical_mapping`, `spiral`, `spiral1`, `spiral2`, `spotlight`, `spotted`, `sqr`, `sqrt`, `statistics`, `str`, `strcmp`, `strength`, `strlen`, `strlwr`, `strupr`, `sturm`, `substr`, `switch`, `sys`, `t`, `tan`, `tanh`, `test_camera_1`, `test_camera_2`, `test_camera_3`, `test_camera_4`, `texture`, `texture_map`, `tga`, `thickness`, `threshold`, `tightness`, `tile2`, `tiles`, `track`, `transform`, `translate`, `transmit`, `triangle_wave`, `true`, `ttf`, `turbulence`, `turb_depth`, `type`, `ultra_wide_angle`, `up`, `use_color`, `use_colour`, `use_index`, `u_steps`, `val`, `variance`, `vaxis_rotate`, `vcross`, `vdot`, `version`, `vlength`, `vnormalize`, `volume_object`, `volume_rendered`, `vol_with_light`, `vrotate`, `v_steps`, `warning`, `warp`, `water_level`, `waves`, `while`, `width`, `wood`, `wrinkles`, `yes`), Keyword, nil}, - {Words(``, `\b`, `bicubic_patch`, `blob`, `box`, `camera`, `cone`, `cubic`, `cylinder`, `difference`, `disc`, `height_field`, `intersection`, `julia_fractal`, `lathe`, `light_source`, `merge`, `mesh`, `object`, `plane`, `poly`, `polygon`, `prism`, `quadric`, `quartic`, `smooth_triangle`, `sor`, `sphere`, `superellipsoid`, `text`, `torus`, `triangle`, `union`), NameBuiltin, nil}, - {`[\[\](){}<>;,]`, Punctuation, nil}, - {`[-+*/=]`, Operator, nil}, - {`\b(x|y|z|u|v)\b`, NameBuiltinPseudo, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - {`[0-9]+\.[0-9]*`, LiteralNumberFloat, nil}, - {`\.[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`\s+`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/powershell.go b/vendor/github.com/alecthomas/chroma/lexers/p/powershell.go deleted file mode 100644 index 10eba4f9..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/powershell.go +++ /dev/null @@ -1,66 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Powershell lexer. -var Powershell = internal.Register(MustNewLexer( - &Config{ - Name: "PowerShell", - Aliases: []string{"powershell", "posh", "ps1", "psm1"}, - Filenames: []string{"*.ps1", "*.psm1"}, - MimeTypes: []string{"text/x-powershell"}, - DotAll: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\(`, Punctuation, Push("child")}, - {`\s+`, Text, nil}, - {`^(\s*#[#\s]*)(\.(?:component|description|example|externalhelp|forwardhelpcategory|forwardhelptargetname|functionality|inputs|link|notes|outputs|parameter|remotehelprunspace|role|synopsis))([^\n]*$)`, ByGroups(Comment, LiteralStringDoc, Comment), nil}, - {`#[^\n]*?$`, Comment, nil}, - {`(<|<)#`, CommentMultiline, Push("multline")}, - {`(?i)([A-Z]:)`, Name, nil}, - {`@"\n`, LiteralStringHeredoc, Push("heredoc-double")}, - {`@'\n.*?\n'@`, LiteralStringHeredoc, nil}, - {"`[\\'\"$@-]", Punctuation, nil}, - {`"`, LiteralStringDouble, Push("string")}, - {`'([^']|'')*'`, LiteralStringSingle, nil}, - {`(\$|@@|@)((global|script|private|env):)?\w+`, NameVariable, nil}, - {`(while|validateset|validaterange|validatepattern|validatelength|validatecount|until|trap|switch|return|ref|process|param|parameter|in|if|global:|function|foreach|for|finally|filter|end|elseif|else|dynamicparam|do|default|continue|cmdletbinding|break|begin|alias|\?|%|#script|#private|#local|#global|mandatory|parametersetname|position|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|helpmessage|try|catch|throw)\b`, Keyword, nil}, - {`-(and|as|band|bnot|bor|bxor|casesensitive|ccontains|ceq|cge|cgt|cle|clike|clt|cmatch|cne|cnotcontains|cnotlike|cnotmatch|contains|creplace|eq|exact|f|file|ge|gt|icontains|ieq|ige|igt|ile|ilike|ilt|imatch|ine|inotcontains|inotlike|inotmatch|ireplace|is|isnot|le|like|lt|match|ne|not|notcontains|notlike|notmatch|or|regex|replace|wildcard)\b`, Operator, nil}, - {`(write|where|watch|wait|use|update|unregister|unpublish|unprotect|unlock|uninstall|undo|unblock|trace|test|tee|take|sync|switch|suspend|submit|stop|step|start|split|sort|skip|show|set|send|select|search|scroll|save|revoke|resume|restore|restart|resolve|resize|reset|request|repair|rename|remove|register|redo|receive|read|push|publish|protect|pop|ping|out|optimize|open|new|move|mount|merge|measure|lock|limit|join|invoke|install|initialize|import|hide|group|grant|get|format|foreach|find|export|expand|exit|enter|enable|edit|dismount|disconnect|disable|deny|debug|cxnew|copy|convertto|convertfrom|convert|connect|confirm|compress|complete|compare|close|clear|checkpoint|block|backup|assert|approve|aggregate|add)-[a-z_]\w*\b`, NameBuiltin, nil}, - {`(ac|asnp|cat|cd|cfs|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|curl|cvpa|dbp|del|diff|dir|dnsn|ebp|echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fhx|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps|gpv|group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md|measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri|rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|wget|where|wjb|write)\s`, NameBuiltin, nil}, - {"\\[[a-z_\\[][\\w. `,\\[\\]]*\\]", NameConstant, nil}, - {`-[a-z_]\w*`, Name, nil}, - {`\w+`, Name, nil}, - {"[.,;@{}\\[\\]$()=+*/\\\\&%!~?^`|<>-]|::", Punctuation, nil}, - }, - "child": { - {`\)`, Punctuation, Pop(1)}, - Include("root"), - }, - "multline": { - {`[^#&.]+`, CommentMultiline, nil}, - {`#(>|>)`, CommentMultiline, Pop(1)}, - {`\.(component|description|example|externalhelp|forwardhelpcategory|forwardhelptargetname|functionality|inputs|link|notes|outputs|parameter|remotehelprunspace|role|synopsis)`, LiteralStringDoc, nil}, - {`[#&.]`, CommentMultiline, nil}, - }, - "string": { - {"`[0abfnrtv'\\\"$`]", LiteralStringEscape, nil}, - {"[^$`\"]+", LiteralStringDouble, nil}, - {`\$\(`, Punctuation, Push("child")}, - {`""`, LiteralStringDouble, nil}, - {"[`$]", LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "heredoc-double": { - {`\n"@`, LiteralStringHeredoc, Pop(1)}, - {`\$\(`, Punctuation, Push("child")}, - {`[^@\n]+"]`, LiteralStringHeredoc, nil}, - {`.`, LiteralStringHeredoc, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/prolog.go b/vendor/github.com/alecthomas/chroma/lexers/p/prolog.go deleted file mode 100644 index 08b48121..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/prolog.go +++ /dev/null @@ -1,50 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Prolog lexer. -var Prolog = internal.Register(MustNewLexer( - &Config{ - Name: "Prolog", - Aliases: []string{"prolog"}, - Filenames: []string{"*.ecl", "*.prolog", "*.pro", "*.pl"}, - MimeTypes: []string{"text/x-prolog"}, - }, - Rules{ - "root": { - {`/\*`, CommentMultiline, Push("nested-comment")}, - {`%.*`, CommentSingle, nil}, - {`0\'.`, LiteralStringChar, nil}, - {`0b[01]+`, LiteralNumberBin, nil}, - {`0o[0-7]+`, LiteralNumberOct, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`\d\d?\'[a-zA-Z0-9]+`, LiteralNumberInteger, nil}, - {`(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`[\[\](){}|.,;!]`, Punctuation, nil}, - {`:-|-->`, Punctuation, nil}, - {`"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|\\[0-7]+\\|\\["\nabcefnrstv]|[^\\"])*"`, LiteralStringDouble, nil}, - {`'(?:''|[^'])*'`, LiteralStringAtom, nil}, - {`is\b`, Operator, nil}, - {`(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])`, Operator, nil}, - {`(mod|div|not)\b`, Operator, nil}, - {`_`, Keyword, nil}, - {`([a-z]+)(:)`, ByGroups(NameNamespace, Punctuation), nil}, - {`([a-zÀ-῿぀-퟿-￯][\w$À-῿぀-퟿-￯]*)(\s*)(:-|-->)`, ByGroups(NameFunction, Text, Operator), nil}, - {`([a-zÀ-῿぀-퟿-￯][\w$À-῿぀-퟿-￯]*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil}, - {`[a-zÀ-῿぀-퟿-￯][\w$À-῿぀-퟿-￯]*`, LiteralStringAtom, nil}, - {`[#&*+\-./:<=>?@\\^~¡-¿‐-〿]+`, LiteralStringAtom, nil}, - {`[A-Z_]\w*`, NameVariable, nil}, - {`\s+|[ -‏￰-￾￯]`, Text, nil}, - }, - "nested-comment": { - {`\*/`, CommentMultiline, Pop(1)}, - {`/\*`, CommentMultiline, Push()}, - {`[^*/]+`, CommentMultiline, nil}, - {`[*/]`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/protobuf.go b/vendor/github.com/alecthomas/chroma/lexers/p/protobuf.go deleted file mode 100644 index 30140131..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/protobuf.go +++ /dev/null @@ -1,53 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// ProtocolBuffer lexer. -var ProtocolBuffer = internal.Register(MustNewLexer( - &Config{ - Name: "Protocol Buffer", - Aliases: []string{"protobuf", "proto"}, - Filenames: []string{"*.proto"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`[ \t]+`, Text, nil}, - {`[,;{}\[\]()<>]`, Punctuation, nil}, - {`/(\\\n)?/(\n|(.|\n)*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?\*(.|\n)*?\*(\\\n)?/`, CommentMultiline, nil}, - {Words(`\b`, `\b`, `import`, `option`, `optional`, `required`, `repeated`, `default`, `packed`, `ctype`, `extensions`, `to`, `max`, `rpc`, `returns`, `oneof`), Keyword, nil}, - {Words(``, `\b`, `int32`, `int64`, `uint32`, `uint64`, `sint32`, `sint64`, `fixed32`, `fixed64`, `sfixed32`, `sfixed64`, `float`, `double`, `bool`, `string`, `bytes`), KeywordType, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`(package)(\s+)`, ByGroups(KeywordNamespace, Text), Push("package")}, - {`(message|extend)(\s+)`, ByGroups(KeywordDeclaration, Text), Push("message")}, - {`(enum|group|service)(\s+)`, ByGroups(KeywordDeclaration, Text), Push("type")}, - {`\".*?\"`, LiteralString, nil}, - {`\'.*?\'`, LiteralString, nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`(\-?(inf|nan))\b`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+[LlUu]*`, LiteralNumberHex, nil}, - {`0[0-7]+[LlUu]*`, LiteralNumberOct, nil}, - {`\d+[LlUu]*`, LiteralNumberInteger, nil}, - {`[+-=]`, Operator, nil}, - {`([a-zA-Z_][\w.]*)([ \t]*)(=)`, ByGroups(Name, Text, Operator), nil}, - {`[a-zA-Z_][\w.]*`, Name, nil}, - }, - "package": { - {`[a-zA-Z_]\w*`, NameNamespace, Pop(1)}, - Default(Pop(1)), - }, - "message": { - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - Default(Pop(1)), - }, - "type": { - {`[a-zA-Z_]\w*`, Name, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/puppet.go b/vendor/github.com/alecthomas/chroma/lexers/p/puppet.go deleted file mode 100644 index a1db0d27..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/puppet.go +++ /dev/null @@ -1,56 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Puppet lexer. -var Puppet = internal.Register(MustNewLexer( - &Config{ - Name: "Puppet", - Aliases: []string{"puppet"}, - Filenames: []string{"*.pp"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - Include("comments"), - Include("keywords"), - Include("names"), - Include("numbers"), - Include("operators"), - Include("strings"), - {`[]{}:(),;[]`, Punctuation, nil}, - {`[^\S\n]+`, Text, nil}, - }, - "comments": { - {`\s*#.*$`, Comment, nil}, - {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, - }, - "operators": { - {`(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)`, Operator, nil}, - {`(in|and|or|not)\b`, OperatorWord, nil}, - }, - "names": { - {`[a-zA-Z_]\w*`, NameAttribute, nil}, - {`(\$\S+)(\[)(\S+)(\])`, ByGroups(NameVariable, Punctuation, LiteralString, Punctuation), nil}, - {`\$\S+`, NameVariable, nil}, - }, - "numbers": { - {`(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?`, LiteralNumberFloat, nil}, - {`\d+[eE][+-]?[0-9]+j?`, LiteralNumberFloat, nil}, - {`0[0-7]+j?`, LiteralNumberOct, nil}, - {`0[xX][a-fA-F0-9]+`, LiteralNumberHex, nil}, - {`\d+L`, LiteralNumberIntegerLong, nil}, - {`\d+j?`, LiteralNumberInteger, nil}, - }, - "keywords": { - {Words(`(?i)`, `\b`, `absent`, `alert`, `alias`, `audit`, `augeas`, `before`, `case`, `check`, `class`, `computer`, `configured`, `contained`, `create_resources`, `crit`, `cron`, `debug`, `default`, `define`, `defined`, `directory`, `else`, `elsif`, `emerg`, `err`, `exec`, `extlookup`, `fail`, `false`, `file`, `filebucket`, `fqdn_rand`, `generate`, `host`, `if`, `import`, `include`, `info`, `inherits`, `inline_template`, `installed`, `interface`, `k5login`, `latest`, `link`, `loglevel`, `macauthorization`, `mailalias`, `maillist`, `mcx`, `md5`, `mount`, `mounted`, `nagios_command`, `nagios_contact`, `nagios_contactgroup`, `nagios_host`, `nagios_hostdependency`, `nagios_hostescalation`, `nagios_hostextinfo`, `nagios_hostgroup`, `nagios_service`, `nagios_servicedependency`, `nagios_serviceescalation`, `nagios_serviceextinfo`, `nagios_servicegroup`, `nagios_timeperiod`, `node`, `noop`, `notice`, `notify`, `package`, `present`, `purged`, `realize`, `regsubst`, `resources`, `role`, `router`, `running`, `schedule`, `scheduled_task`, `search`, `selboolean`, `selmodule`, `service`, `sha1`, `shellquote`, `split`, `sprintf`, `ssh_authorized_key`, `sshkey`, `stage`, `stopped`, `subscribe`, `tag`, `tagged`, `template`, `tidy`, `true`, `undef`, `unmounted`, `user`, `versioncmp`, `vlan`, `warning`, `yumrepo`, `zfs`, `zone`, `zpool`), Keyword, nil}, - }, - "strings": { - {`"([^"])*"`, LiteralString, nil}, - {`'(\\'|[^'])*'`, LiteralString, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/python.go b/vendor/github.com/alecthomas/chroma/lexers/p/python.go deleted file mode 100644 index 77f2c8db..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/p/python.go +++ /dev/null @@ -1,137 +0,0 @@ -package p - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Python lexer. -var Python = internal.Register(MustNewLexer( - &Config{ - Name: "Python", - Aliases: []string{"python", "py", "sage"}, - Filenames: []string{"*.py", "*.pyw", "*.sc", "SConstruct", "SConscript", "*.tac", "*.sage"}, - MimeTypes: []string{"text/x-python", "application/x-python"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")`, ByGroups(Text, LiteralStringAffix, LiteralStringDoc), nil}, - {`^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')`, ByGroups(Text, LiteralStringAffix, LiteralStringDoc), nil}, - {`[^\S\n]+`, Text, nil}, - {`\A#!.+$`, CommentHashbang, nil}, - {`#.*$`, CommentSingle, nil}, - {`[]{}:(),;[]`, Punctuation, nil}, - {`\\\n`, Text, nil}, - {`\\`, Text, nil}, - {`(in|is|and|or|not)\b`, OperatorWord, nil}, - {`!=|==|<<|>>|[-~+/*%=<>&^|.]`, Operator, nil}, - Include("keywords"), - {`(def)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("funcname")}, - {`(class)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("classname")}, - {`(from)((?:\s|\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("fromimport")}, - {`(import)((?:\s|\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - Include("builtins"), - Include("magicfuncs"), - Include("magicvars"), - Include("backtick"), - {`([rR]|[uUbB][rR]|[rR][uUbB])(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("tdqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("tsqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("dqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("sqs")}, - {`([uUbB]?)(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "tdqs")}, - {`([uUbB]?)(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "tsqs")}, - {`([uUbB]?)(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "dqs")}, - {`([uUbB]?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "sqs")}, - Include("name"), - Include("numbers"), - }, - "keywords": { - {Words(``, `\b`, `assert`, `break`, `continue`, `del`, `elif`, `else`, `except`, `exec`, `finally`, `for`, `global`, `if`, `lambda`, `pass`, `print`, `raise`, `return`, `try`, `while`, `yield`, `yield from`, `as`, `with`), Keyword, nil}, - }, - "builtins": { - {Words(`(?>|[-~+/*%=<>&^|.]`, Operator, nil}, - Include("keywords"), - {`(def)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("funcname")}, - {`(class)((?:\s|\\\s)+)`, ByGroups(Keyword, Text), Push("classname")}, - {`(from)((?:\s|\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("fromimport")}, - {`(import)((?:\s|\\\s)+)`, ByGroups(KeywordNamespace, Text), Push("import")}, - Include("builtins"), - Include("magicfuncs"), - Include("magicvars"), - Include("backtick"), - {`([rR]|[uUbB][rR]|[rR][uUbB])(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("tdqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("tsqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("dqs")}, - {`([rR]|[uUbB][rR]|[rR][uUbB])(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("sqs")}, - {`([uUbB]?)(""")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "tdqs")}, - {`([uUbB]?)(''')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "tsqs")}, - {`([uUbB]?)(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Combined("stringescape", "dqs")}, - {`([uUbB]?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Combined("stringescape", "sqs")}, - Include("name"), - Include("numbers"), - }, - "keywords": { - {Words(``, `\b`, `assert`, `async`, `await`, `break`, `continue`, `del`, `elif`, `else`, `except`, `finally`, `for`, `global`, `if`, `lambda`, `pass`, `raise`, `nonlocal`, `return`, `try`, `while`, `yield`, `yield from`, `as`, `with`), Keyword, nil}, - {Words(``, `\b`, `True`, `False`, `None`), KeywordConstant, nil}, - }, - "builtins": { - {Words(`(?=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}`, LiteralStringInterpol, nil}, - {`[^\\\'"%{\n]+`, LiteralStringSingle, nil}, - {`[\'"\\]`, LiteralStringSingle, nil}, - {`%|(\{{1,2})`, LiteralStringSingle, nil}, - }, - "strings-double": { - {`%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]`, LiteralStringInterpol, nil}, - {`\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\![sra])?(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}`, LiteralStringInterpol, nil}, - {`[^\\\'"%{\n]+`, LiteralStringDouble, nil}, - {`[\'"\\]`, LiteralStringDouble, nil}, - {`%|(\{{1,2})`, LiteralStringDouble, nil}, - }, - "dqs": { - {`"`, LiteralStringDouble, Pop(1)}, - {`\\\\|\\"|\\\n`, LiteralStringEscape, nil}, - Include("strings-double"), - }, - "sqs": { - {`'`, LiteralStringSingle, Pop(1)}, - {`\\\\|\\'|\\\n`, LiteralStringEscape, nil}, - Include("strings-single"), - }, - "tdqs": { - {`"""`, LiteralStringDouble, Pop(1)}, - Include("strings-double"), - {`\n`, LiteralStringDouble, nil}, - }, - "tsqs": { - {`'''`, LiteralStringSingle, Pop(1)}, - Include("strings-single"), - {`\n`, LiteralStringSingle, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/q/qbasic.go b/vendor/github.com/alecthomas/chroma/lexers/q/qbasic.go deleted file mode 100644 index fd47c080..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/q/qbasic.go +++ /dev/null @@ -1,67 +0,0 @@ -package q - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Qbasic lexer. -var Qbasic = internal.Register(MustNewLexer( - &Config{ - Name: "QBasic", - Aliases: []string{"qbasic", "basic"}, - Filenames: []string{"*.BAS", "*.bas"}, - MimeTypes: []string{"text/basic"}, - }, - Rules{ - "root": { - {`\n+`, Text, nil}, - {`\s+`, TextWhitespace, nil}, - {`^(\s*)(\d*)(\s*)(REM .*)$`, ByGroups(TextWhitespace, NameLabel, TextWhitespace, CommentSingle), nil}, - {`^(\s*)(\d+)(\s*)`, ByGroups(TextWhitespace, NameLabel, TextWhitespace), nil}, - {`(?=[\s]*)(\w+)(?=[\s]*=)`, NameVariableGlobal, nil}, - {`(?=[^"]*)\'.*$`, CommentSingle, nil}, - {`"[^\n"]*"`, LiteralStringDouble, nil}, - {`(END)(\s+)(FUNCTION|IF|SELECT|SUB)`, ByGroups(KeywordReserved, TextWhitespace, KeywordReserved), nil}, - {`(DECLARE)(\s+)([A-Z]+)(\s+)(\S+)`, ByGroups(KeywordDeclaration, TextWhitespace, NameVariable, TextWhitespace, Name), nil}, - {`(DIM)(\s+)(SHARED)(\s+)([^\s(]+)`, ByGroups(KeywordDeclaration, TextWhitespace, NameVariable, TextWhitespace, NameVariableGlobal), nil}, - {`(DIM)(\s+)([^\s(]+)`, ByGroups(KeywordDeclaration, TextWhitespace, NameVariableGlobal), nil}, - {`^(\s*)([a-zA-Z_]+)(\s*)(\=)`, ByGroups(TextWhitespace, NameVariableGlobal, TextWhitespace, Operator), nil}, - {`(GOTO|GOSUB)(\s+)(\w+\:?)`, ByGroups(KeywordReserved, TextWhitespace, NameLabel), nil}, - {`(SUB)(\s+)(\w+\:?)`, ByGroups(KeywordReserved, TextWhitespace, NameLabel), nil}, - Include("declarations"), - Include("functions"), - Include("metacommands"), - Include("operators"), - Include("statements"), - Include("keywords"), - {`[a-zA-Z_]\w*[$@#&!]`, NameVariableGlobal, nil}, - {`[a-zA-Z_]\w*\:`, NameLabel, nil}, - {`\-?\d*\.\d+[@|#]?`, LiteralNumberFloat, nil}, - {`\-?\d+[@|#]`, LiteralNumberFloat, nil}, - {`\-?\d+#?`, LiteralNumberIntegerLong, nil}, - {`\-?\d+#?`, LiteralNumberInteger, nil}, - {`!=|==|:=|\.=|<<|>>|[-~+/\\*%=<>&^|?:!.]`, Operator, nil}, - {`[\[\]{}(),;]`, Punctuation, nil}, - {`[\w]+`, NameVariableGlobal, nil}, - }, - "declarations": { - {`\b(DATA|LET)(?=\(|\b)`, KeywordDeclaration, nil}, - }, - "functions": { - {`\b(ABS|ASC|ATN|CDBL|CHR\$|CINT|CLNG|COMMAND\$|COS|CSNG|CSRLIN|CVD|CVDMBF|CVI|CVL|CVS|CVSMBF|DATE\$|ENVIRON\$|EOF|ERDEV|ERDEV\$|ERL|ERR|EXP|FILEATTR|FIX|FRE|FREEFILE|HEX\$|INKEY\$|INP|INPUT\$|INSTR|INT|IOCTL\$|LBOUND|LCASE\$|LEFT\$|LEN|LOC|LOF|LOG|LPOS|LTRIM\$|MID\$|MKD\$|MKDMBF\$|MKI\$|MKL\$|MKS\$|MKSMBF\$|OCT\$|PEEK|PEN|PLAY|PMAP|POINT|POS|RIGHT\$|RND|RTRIM\$|SADD|SCREEN|SEEK|SETMEM|SGN|SIN|SPACE\$|SPC|SQR|STICK|STR\$|STRIG|STRING\$|TAB|TAN|TIME\$|TIMER|UBOUND|UCASE\$|VAL|VARPTR|VARPTR\$|VARSEG)(?=\(|\b)`, KeywordReserved, nil}, - }, - "metacommands": { - {`\b(\$DYNAMIC|\$INCLUDE|\$STATIC)(?=\(|\b)`, KeywordConstant, nil}, - }, - "operators": { - {`\b(AND|EQV|IMP|NOT|OR|XOR)(?=\(|\b)`, OperatorWord, nil}, - }, - "statements": { - {`\b(BEEP|BLOAD|BSAVE|CALL|CALL\ ABSOLUTE|CALL\ INTERRUPT|CALLS|CHAIN|CHDIR|CIRCLE|CLEAR|CLOSE|CLS|COLOR|COM|COMMON|CONST|DATA|DATE\$|DECLARE|DEF\ FN|DEF\ SEG|DEFDBL|DEFINT|DEFLNG|DEFSNG|DEFSTR|DEF|DIM|DO|LOOP|DRAW|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|NEXT|FUNCTION|GET|GOSUB|GOTO|IF|THEN|INPUT|INPUT\ \#|IOCTL|KEY|KEY|KILL|LET|LINE|LINE\ INPUT|LINE\ INPUT\ \#|LOCATE|LOCK|UNLOCK|LPRINT|LSET|MID\$|MKDIR|NAME|ON\ COM|ON\ ERROR|ON\ KEY|ON\ PEN|ON\ PLAY|ON\ STRIG|ON\ TIMER|ON\ UEVENT|ON|OPEN|OPEN\ COM|OPTION\ BASE|OUT|PAINT|PALETTE|PCOPY|PEN|PLAY|POKE|PRESET|PRINT|PRINT\ \#|PRINT\ USING|PSET|PUT|PUT|RANDOMIZE|READ|REDIM|REM|RESET|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SCREEN|SEEK|SELECT\ CASE|SHARED|SHELL|SLEEP|SOUND|STATIC|STOP|STRIG|SUB|SWAP|SYSTEM|TIME\$|TIMER|TROFF|TRON|TYPE|UEVENT|UNLOCK|VIEW|WAIT|WHILE|WEND|WIDTH|WINDOW|WRITE)\b`, KeywordReserved, nil}, - }, - "keywords": { - {`\b(ACCESS|ALIAS|ANY|APPEND|AS|BASE|BINARY|BYVAL|CASE|CDECL|DOUBLE|ELSE|ELSEIF|ENDIF|INTEGER|IS|LIST|LOCAL|LONG|LOOP|MOD|NEXT|OFF|ON|OUTPUT|RANDOM|SIGNAL|SINGLE|STEP|STRING|THEN|TO|UNTIL|USING|WEND)\b`, Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/r.go b/vendor/github.com/alecthomas/chroma/lexers/r/r.go deleted file mode 100644 index c2d3f56c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/r.go +++ /dev/null @@ -1,66 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// R/S lexer. -var R = internal.Register(MustNewLexer( - &Config{ - Name: "R", - Aliases: []string{"splus", "s", "r"}, - Filenames: []string{"*.S", "*.R", "*.r", ".Rhistory", ".Rprofile", ".Renviron"}, - MimeTypes: []string{"text/S-plus", "text/S", "text/x-r-source", "text/x-r", "text/x-R", "text/x-r-history", "text/x-r-profile"}, - }, - Rules{ - "comments": { - {`#.*$`, CommentSingle, nil}, - }, - "valid_name": { - {"(?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\\w_.]*)", Name, nil}, - }, - "punctuation": { - {`\[{1,2}|\]{1,2}|\(|\)|;|,`, Punctuation, nil}, - }, - "keywords": { - {`(if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])`, KeywordReserved, nil}, - }, - "operators": { - {`<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\?`, Operator, nil}, - {`\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}`, Operator, nil}, - }, - "builtin_symbols": { - {`(NULL|NA(_(integer|real|complex|character)_)?|letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))(?![\w.])`, KeywordConstant, nil}, - {`(T|F)\b`, NameBuiltinPseudo, nil}, - }, - "numbers": { - {`0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?`, LiteralNumberHex, nil}, - {`[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?`, LiteralNumber, nil}, - }, - "statements": { - Include("comments"), - {`\s+`, Text, nil}, - {`\'`, LiteralString, Push("string_squote")}, - {`\"`, LiteralString, Push("string_dquote")}, - Include("builtin_symbols"), - Include("valid_name"), - Include("numbers"), - Include("keywords"), - Include("punctuation"), - Include("operators"), - }, - "root": { - {"((?:`[^`\\\\]*(?:\\\\.[^`\\\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\\w_.]*))\\s*(?=\\()", NameFunction, nil}, - Include("statements"), - {`\{|\}`, Punctuation, nil}, - {`.`, Text, nil}, - }, - "string_squote": { - {`([^\'\\]|\\.)*\'`, LiteralString, Pop(1)}, - }, - "string_dquote": { - {`([^"\\]|\\.)*"`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/racket.go b/vendor/github.com/alecthomas/chroma/lexers/r/racket.go deleted file mode 100644 index cf27ea10..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/racket.go +++ /dev/null @@ -1,102 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Racket lexer. -var Racket = internal.Register(MustNewLexer( - &Config{ - Name: "Racket", - Aliases: []string{"racket", "rkt"}, - Filenames: []string{"*.rkt", "*.rktd", "*.rktl"}, - MimeTypes: []string{"text/x-racket", "application/x-racket"}, - }, - Rules{ - "root": { - {`[)\]}]`, Error, nil}, - {`(?!\Z)`, Text, Push("unquoted-datum")}, - }, - "datum": { - {`(?s)#;|#![ /]([^\\\n]|\\.)*`, Comment, nil}, - {`;[^\n\r…

]*`, CommentSingle, nil}, - {`#\|`, CommentMultiline, Push("block-comment")}, - {`\s+`, Text, nil}, - {"(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?\\d+(?=[()[\\]{}\",\\'`;\\s])", LiteralNumberInteger, Pop(1)}, - {"(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([deflst][-+]?\\d+)?(?=[()[\\]{}\",\\'`;\\s])", LiteralNumberFloat, Pop(1)}, - {"(?i)(?:#e)?(?:#d)?(?:#e)?[-+]?((?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)(?:[defls][-+]?\\d+)?)([-+](?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)(?:[defls][-+]?\\d+)?)?i)?|[-+](?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)(?:[defls][-+]?\\d+)?)?i)(?=[()[\\]{}\",\\'`;\\s])", LiteralNumber, Pop(1)}, - {"(?i)(#d)?((?:[-+]?(?:(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))(?:[defls][-+]?\\d+)?)|[-+](?:(?:inf|nan)\\.[0f]))([-+](?:(?:(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))(?:[defls][-+]?\\d+)?)|(?:(?:inf|nan)\\.[0f]))?i)?|[-+](?:(?:(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))(?:[defls][-+]?\\d+)?)|(?:(?:inf|nan)\\.[0f]))?i|(?:[-+]?(?:(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))(?:[defls][-+]?\\d+)?)|[-+](?:(?:inf|nan)\\.[0f]))@(?:[-+]?(?:(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))(?:[defls][-+]?\\d+)?)|[-+](?:(?:inf|nan)\\.[0f])))(?=[()[\\]{}\",\\'`;\\s])", LiteralNumberFloat, Pop(1)}, - {"(?i)(([-+]?(?:(?:\\d+(?:/\\d+|\\.\\d*)?|\\.\\d+)|(?:\\d+#+(?:\\.#*|/\\d+#*)?|\\.\\d+#+|\\d+(?:\\.\\d*#+|/\\d+#+)))t[-+]?\\d+)|[-+](inf|nan)\\.t)(?=[()[\\]{}\",\\'`;\\s])", LiteralNumberFloat, Pop(1)}, - {"(?i)(#[ei])?#b(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", LiteralNumberBin, Pop(1)}, - {"(?i)(#[ei])?#o(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", LiteralNumberOct, Pop(1)}, - {"(?i)(#[ei])?#x(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", LiteralNumberHex, Pop(1)}, - {"(?i)(#d)?#i(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", LiteralNumberFloat, Pop(1)}, - {`#?"`, LiteralStringDouble, Push("#pop", "string")}, - {`#<<(.+)\n(^(?!\1$).*$\n)*^\1$`, LiteralStringHeredoc, Pop(1)}, - {`#\\(u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8})`, LiteralStringChar, Pop(1)}, - {`(?is)#\\([0-7]{3}|[a-z]+|.)`, LiteralStringChar, Pop(1)}, - {`(?s)#[pr]x#?"(\\?.)*?"`, LiteralStringRegex, Pop(1)}, - {`#(true|false|[tTfF])`, NameConstant, Pop(1)}, - {"#:(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", KeywordDeclaration, Pop(1)}, - {`(#lang |#!)(\S+)`, ByGroups(KeywordNamespace, NameNamespace), nil}, - {`#reader`, KeywordNamespace, Push("quoted-datum")}, - {"(?i)\\.(?=[()[\\]{}\",\\'`;\\s])|#c[is]|#['`]|#,@?", Operator, nil}, - {`'|#[s&]|#hash(eqv?)?|#\d*(?=[([{])`, Operator, Push("#pop", "quoted-datum")}, - }, - "datum*": { - {"`|,@?", Operator, nil}, - {"(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", LiteralStringSymbol, Pop(1)}, - {`[|\\]`, Error, nil}, - Default(Pop(1)), - }, - "list": { - {`[)\]}]`, Punctuation, Pop(1)}, - }, - "unquoted-datum": { - Include("datum"), - {"quote(?=[()[\\]{}\",\\'`;\\s])", Keyword, Push("#pop", "quoted-datum")}, - {"`", Operator, Push("#pop", "quasiquoted-datum")}, - {"quasiquote(?=[()[\\]{}\",\\'`;\\s])", Keyword, Push("#pop", "quasiquoted-datum")}, - {`[([{]`, Punctuation, Push("#pop", "unquoted-list")}, - {Words(``, "(?=[()[\\]{}\",\\'`;\\s])", `#%app`, `#%datum`, `#%declare`, `#%expression`, `#%module-begin`, `#%plain-app`, `#%plain-lambda`, `#%plain-module-begin`, `#%printing-module-begin`, `#%provide`, `#%require`, `#%stratified-body`, `#%top`, `#%top-interaction`, `#%variable-reference`, `->`, `->*`, `->*m`, `->d`, `->dm`, `->i`, `->m`, `...`, `:do-in`, `==`, `=>`, `_`, `absent`, `abstract`, `all-defined-out`, `all-from-out`, `and`, `any`, `augment`, `augment*`, `augment-final`, `augment-final*`, `augride`, `augride*`, `begin`, `begin-for-syntax`, `begin0`, `case`, `case->`, `case->m`, `case-lambda`, `class`, `class*`, `class-field-accessor`, `class-field-mutator`, `class/c`, `class/derived`, `combine-in`, `combine-out`, `command-line`, `compound-unit`, `compound-unit/infer`, `cond`, `cons/dc`, `contract`, `contract-out`, `contract-struct`, `contracted`, `define`, `define-compound-unit`, `define-compound-unit/infer`, `define-contract-struct`, `define-custom-hash-types`, `define-custom-set-types`, `define-for-syntax`, `define-local-member-name`, `define-logger`, `define-match-expander`, `define-member-name`, `define-module-boundary-contract`, `define-namespace-anchor`, `define-opt/c`, `define-sequence-syntax`, `define-serializable-class`, `define-serializable-class*`, `define-signature`, `define-signature-form`, `define-struct`, `define-struct/contract`, `define-struct/derived`, `define-syntax`, `define-syntax-rule`, `define-syntaxes`, `define-unit`, `define-unit-binding`, `define-unit-from-context`, `define-unit/contract`, `define-unit/new-import-export`, `define-unit/s`, `define-values`, `define-values-for-export`, `define-values-for-syntax`, `define-values/invoke-unit`, `define-values/invoke-unit/infer`, `define/augment`, `define/augment-final`, `define/augride`, `define/contract`, `define/final-prop`, `define/match`, `define/overment`, `define/override`, `define/override-final`, `define/private`, `define/public`, `define/public-final`, `define/pubment`, `define/subexpression-pos-prop`, `define/subexpression-pos-prop/name`, `delay`, `delay/idle`, `delay/name`, `delay/strict`, `delay/sync`, `delay/thread`, `do`, `else`, `except`, `except-in`, `except-out`, `export`, `extends`, `failure-cont`, `false`, `false/c`, `field`, `field-bound?`, `file`, `flat-murec-contract`, `flat-rec-contract`, `for`, `for*`, `for*/and`, `for*/async`, `for*/first`, `for*/fold`, `for*/fold/derived`, `for*/hash`, `for*/hasheq`, `for*/hasheqv`, `for*/last`, `for*/list`, `for*/lists`, `for*/mutable-set`, `for*/mutable-seteq`, `for*/mutable-seteqv`, `for*/or`, `for*/product`, `for*/set`, `for*/seteq`, `for*/seteqv`, `for*/stream`, `for*/sum`, `for*/vector`, `for*/weak-set`, `for*/weak-seteq`, `for*/weak-seteqv`, `for-label`, `for-meta`, `for-syntax`, `for-template`, `for/and`, `for/async`, `for/first`, `for/fold`, `for/fold/derived`, `for/hash`, `for/hasheq`, `for/hasheqv`, `for/last`, `for/list`, `for/lists`, `for/mutable-set`, `for/mutable-seteq`, `for/mutable-seteqv`, `for/or`, `for/product`, `for/set`, `for/seteq`, `for/seteqv`, `for/stream`, `for/sum`, `for/vector`, `for/weak-set`, `for/weak-seteq`, `for/weak-seteqv`, `gen:custom-write`, `gen:dict`, `gen:equal+hash`, `gen:set`, `gen:stream`, `generic`, `get-field`, `hash/dc`, `if`, `implies`, `import`, `include`, `include-at/relative-to`, `include-at/relative-to/reader`, `include/reader`, `inherit`, `inherit-field`, `inherit/inner`, `inherit/super`, `init`, `init-depend`, `init-field`, `init-rest`, `inner`, `inspect`, `instantiate`, `interface`, `interface*`, `invariant-assertion`, `invoke-unit`, `invoke-unit/infer`, `lambda`, `lazy`, `let`, `let*`, `let*-values`, `let-syntax`, `let-syntaxes`, `let-values`, `let/cc`, `let/ec`, `letrec`, `letrec-syntax`, `letrec-syntaxes`, `letrec-syntaxes+values`, `letrec-values`, `lib`, `link`, `local`, `local-require`, `log-debug`, `log-error`, `log-fatal`, `log-info`, `log-warning`, `match`, `match*`, `match*/derived`, `match-define`, `match-define-values`, `match-lambda`, `match-lambda*`, `match-lambda**`, `match-let`, `match-let*`, `match-let*-values`, `match-let-values`, `match-letrec`, `match-letrec-values`, `match/derived`, `match/values`, `member-name-key`, `mixin`, `module`, `module*`, `module+`, `nand`, `new`, `nor`, `object-contract`, `object/c`, `only`, `only-in`, `only-meta-in`, `open`, `opt/c`, `or`, `overment`, `overment*`, `override`, `override*`, `override-final`, `override-final*`, `parameterize`, `parameterize*`, `parameterize-break`, `parametric->/c`, `place`, `place*`, `place/context`, `planet`, `prefix`, `prefix-in`, `prefix-out`, `private`, `private*`, `prompt-tag/c`, `protect-out`, `provide`, `provide-signature-elements`, `provide/contract`, `public`, `public*`, `public-final`, `public-final*`, `pubment`, `pubment*`, `quasiquote`, `quasisyntax`, `quasisyntax/loc`, `quote`, `quote-syntax`, `quote-syntax/prune`, `recontract-out`, `recursive-contract`, `relative-in`, `rename`, `rename-in`, `rename-inner`, `rename-out`, `rename-super`, `require`, `send`, `send*`, `send+`, `send-generic`, `send/apply`, `send/keyword-apply`, `set!`, `set!-values`, `set-field!`, `shared`, `stream`, `stream*`, `stream-cons`, `struct`, `struct*`, `struct-copy`, `struct-field-index`, `struct-out`, `struct/c`, `struct/ctc`, `struct/dc`, `submod`, `super`, `super-instantiate`, `super-make-object`, `super-new`, `syntax`, `syntax-case`, `syntax-case*`, `syntax-id-rules`, `syntax-rules`, `syntax/loc`, `tag`, `this`, `this%`, `thunk`, `thunk*`, `time`, `unconstrained-domain->`, `unit`, `unit-from-context`, `unit/c`, `unit/new-import-export`, `unit/s`, `unless`, `unquote`, `unquote-splicing`, `unsyntax`, `unsyntax-splicing`, `values/drop`, `when`, `with-continuation-mark`, `with-contract`, `with-contract-continuation-mark`, `with-handlers`, `with-handlers*`, `with-method`, `with-syntax`, `λ`), Keyword, Pop(1)}, - {Words(``, "(?=[()[\\]{}\",\\'`;\\s])", `*`, `*list/c`, `+`, `-`, `/`, `<`, ``, `>/c`, `>=`, `>=/c`, `abort-current-continuation`, `abs`, `absolute-path?`, `acos`, `add-between`, `add1`, `alarm-evt`, `always-evt`, `and/c`, `andmap`, `angle`, `any/c`, `append`, `append*`, `append-map`, `apply`, `argmax`, `argmin`, `arithmetic-shift`, `arity-at-least`, `arity-at-least-value`, `arity-at-least?`, `arity-checking-wrapper`, `arity-includes?`, `arity=?`, `arrow-contract-info`, `arrow-contract-info-accepts-arglist`, `arrow-contract-info-chaperone-procedure`, `arrow-contract-info-check-first-order`, `arrow-contract-info?`, `asin`, `assf`, `assoc`, `assq`, `assv`, `atan`, `bad-number-of-results`, `banner`, `base->-doms/c`, `base->-rngs/c`, `base->?`, `between/c`, `bitwise-and`, `bitwise-bit-field`, `bitwise-bit-set?`, `bitwise-ior`, `bitwise-not`, `bitwise-xor`, `blame-add-car-context`, `blame-add-cdr-context`, `blame-add-context`, `blame-add-missing-party`, `blame-add-nth-arg-context`, `blame-add-range-context`, `blame-add-unknown-context`, `blame-context`, `blame-contract`, `blame-fmt->-string`, `blame-missing-party?`, `blame-negative`, `blame-original?`, `blame-positive`, `blame-replace-negative`, `blame-source`, `blame-swap`, `blame-swapped?`, `blame-update`, `blame-value`, `blame?`, `boolean=?`, `boolean?`, `bound-identifier=?`, `box`, `box-cas!`, `box-immutable`, `box-immutable/c`, `box/c`, `box?`, `break-enabled`, `break-parameterization?`, `break-thread`, `build-chaperone-contract-property`, `build-compound-type-name`, `build-contract-property`, `build-flat-contract-property`, `build-list`, `build-path`, `build-path/convention-type`, `build-string`, `build-vector`, `byte-pregexp`, `byte-pregexp?`, `byte-ready?`, `byte-regexp`, `byte-regexp?`, `byte?`, `bytes`, `bytes->immutable-bytes`, `bytes->list`, `bytes->path`, `bytes->path-element`, `bytes->string/latin-1`, `bytes->string/locale`, `bytes->string/utf-8`, `bytes-append`, `bytes-append*`, `bytes-close-converter`, `bytes-convert`, `bytes-convert-end`, `bytes-converter?`, `bytes-copy`, `bytes-copy!`, `bytes-environment-variable-name?`, `bytes-fill!`, `bytes-join`, `bytes-length`, `bytes-no-nuls?`, `bytes-open-converter`, `bytes-ref`, `bytes-set!`, `bytes-utf-8-index`, `bytes-utf-8-length`, `bytes-utf-8-ref`, `bytes?`, `bytes?`, `caaaar`, `caaadr`, `caaar`, `caadar`, `caaddr`, `caadr`, `caar`, `cadaar`, `cadadr`, `cadar`, `caddar`, `cadddr`, `caddr`, `cadr`, `call-in-nested-thread`, `call-with-atomic-output-file`, `call-with-break-parameterization`, `call-with-composable-continuation`, `call-with-continuation-barrier`, `call-with-continuation-prompt`, `call-with-current-continuation`, `call-with-default-reading-parameterization`, `call-with-escape-continuation`, `call-with-exception-handler`, `call-with-file-lock/timeout`, `call-with-immediate-continuation-mark`, `call-with-input-bytes`, `call-with-input-file`, `call-with-input-file*`, `call-with-input-string`, `call-with-output-bytes`, `call-with-output-file`, `call-with-output-file*`, `call-with-output-string`, `call-with-parameterization`, `call-with-semaphore`, `call-with-semaphore/enable-break`, `call-with-values`, `call/cc`, `call/ec`, `car`, `cartesian-product`, `cdaaar`, `cdaadr`, `cdaar`, `cdadar`, `cdaddr`, `cdadr`, `cdar`, `cddaar`, `cddadr`, `cddar`, `cdddar`, `cddddr`, `cdddr`, `cddr`, `cdr`, `ceiling`, `channel-get`, `channel-put`, `channel-put-evt`, `channel-put-evt?`, `channel-try-get`, `channel/c`, `channel?`, `chaperone-box`, `chaperone-channel`, `chaperone-continuation-mark-key`, `chaperone-contract-property?`, `chaperone-contract?`, `chaperone-evt`, `chaperone-hash`, `chaperone-hash-set`, `chaperone-of?`, `chaperone-procedure`, `chaperone-procedure*`, `chaperone-prompt-tag`, `chaperone-struct`, `chaperone-struct-type`, `chaperone-vector`, `chaperone?`, `char->integer`, `char-alphabetic?`, `char-blank?`, `char-ci<=?`, `char-ci=?`, `char-ci>?`, `char-downcase`, `char-foldcase`, `char-general-category`, `char-graphic?`, `char-in`, `char-in/c`, `char-iso-control?`, `char-lower-case?`, `char-numeric?`, `char-punctuation?`, `char-ready?`, `char-symbolic?`, `char-title-case?`, `char-titlecase`, `char-upcase`, `char-upper-case?`, `char-utf-8-length`, `char-whitespace?`, `char<=?`, `char=?`, `char>?`, `char?`, `check-duplicate-identifier`, `check-duplicates`, `checked-procedure-check-and-extract`, `choice-evt`, `class->interface`, `class-info`, `class-seal`, `class-unseal`, `class?`, `cleanse-path`, `close-input-port`, `close-output-port`, `coerce-chaperone-contract`, `coerce-chaperone-contracts`, `coerce-contract`, `coerce-contract/f`, `coerce-contracts`, `coerce-flat-contract`, `coerce-flat-contracts`, `collect-garbage`, `collection-file-path`, `collection-path`, `combinations`, `compile`, `compile-allow-set!-undefined`, `compile-context-preservation-enabled`, `compile-enforce-module-constants`, `compile-syntax`, `compiled-expression-recompile`, `compiled-expression?`, `compiled-module-expression?`, `complete-path?`, `complex?`, `compose`, `compose1`, `conjoin`, `conjugate`, `cons`, `cons/c`, `cons?`, `const`, `continuation-mark-key/c`, `continuation-mark-key?`, `continuation-mark-set->context`, `continuation-mark-set->list`, `continuation-mark-set->list*`, `continuation-mark-set-first`, `continuation-mark-set?`, `continuation-marks`, `continuation-prompt-available?`, `continuation-prompt-tag?`, `continuation?`, `contract-continuation-mark-key`, `contract-custom-write-property-proc`, `contract-exercise`, `contract-first-order`, `contract-first-order-passes?`, `contract-late-neg-projection`, `contract-name`, `contract-proc`, `contract-projection`, `contract-property?`, `contract-random-generate`, `contract-random-generate-fail`, `contract-random-generate-fail?`, `contract-random-generate-get-current-environment`, `contract-random-generate-stash`, `contract-random-generate/choose`, `contract-stronger?`, `contract-struct-exercise`, `contract-struct-generate`, `contract-struct-late-neg-projection`, `contract-struct-list-contract?`, `contract-val-first-projection`, `contract?`, `convert-stream`, `copy-directory/files`, `copy-file`, `copy-port`, `cos`, `cosh`, `count`, `current-blame-format`, `current-break-parameterization`, `current-code-inspector`, `current-command-line-arguments`, `current-compile`, `current-compiled-file-roots`, `current-continuation-marks`, `current-contract-region`, `current-custodian`, `current-directory`, `current-directory-for-user`, `current-drive`, `current-environment-variables`, `current-error-port`, `current-eval`, `current-evt-pseudo-random-generator`, `current-force-delete-permissions`, `current-future`, `current-gc-milliseconds`, `current-get-interaction-input-port`, `current-inexact-milliseconds`, `current-input-port`, `current-inspector`, `current-library-collection-links`, `current-library-collection-paths`, `current-load`, `current-load-extension`, `current-load-relative-directory`, `current-load/use-compiled`, `current-locale`, `current-logger`, `current-memory-use`, `current-milliseconds`, `current-module-declare-name`, `current-module-declare-source`, `current-module-name-resolver`, `current-module-path-for-load`, `current-namespace`, `current-output-port`, `current-parameterization`, `current-plumber`, `current-preserved-thread-cell-values`, `current-print`, `current-process-milliseconds`, `current-prompt-read`, `current-pseudo-random-generator`, `current-read-interaction`, `current-reader-guard`, `current-readtable`, `current-seconds`, `current-security-guard`, `current-subprocess-custodian-mode`, `current-thread`, `current-thread-group`, `current-thread-initial-stack-size`, `current-write-relative-directory`, `curry`, `curryr`, `custodian-box-value`, `custodian-box?`, `custodian-limit-memory`, `custodian-managed-list`, `custodian-memory-accounting-available?`, `custodian-require-memory`, `custodian-shutdown-all`, `custodian?`, `custom-print-quotable-accessor`, `custom-print-quotable?`, `custom-write-accessor`, `custom-write-property-proc`, `custom-write?`, `date`, `date*`, `date*-nanosecond`, `date*-time-zone-name`, `date*?`, `date-day`, `date-dst?`, `date-hour`, `date-minute`, `date-month`, `date-second`, `date-time-zone-offset`, `date-week-day`, `date-year`, `date-year-day`, `date?`, `datum->syntax`, `datum-intern-literal`, `default-continuation-prompt-tag`, `degrees->radians`, `delete-directory`, `delete-directory/files`, `delete-file`, `denominator`, `dict->list`, `dict-can-functional-set?`, `dict-can-remove-keys?`, `dict-clear`, `dict-clear!`, `dict-copy`, `dict-count`, `dict-empty?`, `dict-for-each`, `dict-has-key?`, `dict-implements/c`, `dict-implements?`, `dict-iter-contract`, `dict-iterate-first`, `dict-iterate-key`, `dict-iterate-next`, `dict-iterate-value`, `dict-key-contract`, `dict-keys`, `dict-map`, `dict-mutable?`, `dict-ref`, `dict-ref!`, `dict-remove`, `dict-remove!`, `dict-set`, `dict-set!`, `dict-set*`, `dict-set*!`, `dict-update`, `dict-update!`, `dict-value-contract`, `dict-values`, `dict?`, `directory-exists?`, `directory-list`, `disjoin`, `display`, `display-lines`, `display-lines-to-file`, `display-to-file`, `displayln`, `double-flonum?`, `drop`, `drop-common-prefix`, `drop-right`, `dropf`, `dropf-right`, `dump-memory-stats`, `dup-input-port`, `dup-output-port`, `dynamic->*`, `dynamic-get-field`, `dynamic-object/c`, `dynamic-place`, `dynamic-place*`, `dynamic-require`, `dynamic-require-for-syntax`, `dynamic-send`, `dynamic-set-field!`, `dynamic-wind`, `eighth`, `empty`, `empty-sequence`, `empty-stream`, `empty?`, `environment-variables-copy`, `environment-variables-names`, `environment-variables-ref`, `environment-variables-set!`, `environment-variables?`, `eof`, `eof-evt`, `eof-object?`, `ephemeron-value`, `ephemeron?`, `eprintf`, `eq-contract-val`, `eq-contract?`, `eq-hash-code`, `eq?`, `equal-contract-val`, `equal-contract?`, `equal-hash-code`, `equal-secondary-hash-code`, `equal<%>`, `equal?`, `equal?/recur`, `eqv-hash-code`, `eqv?`, `error`, `error-display-handler`, `error-escape-handler`, `error-print-context-length`, `error-print-source-location`, `error-print-width`, `error-value->string-handler`, `eval`, `eval-jit-enabled`, `eval-syntax`, `even?`, `evt/c`, `evt?`, `exact->inexact`, `exact-ceiling`, `exact-floor`, `exact-integer?`, `exact-nonnegative-integer?`, `exact-positive-integer?`, `exact-round`, `exact-truncate`, `exact?`, `executable-yield-handler`, `exit`, `exit-handler`, `exn`, `exn-continuation-marks`, `exn-message`, `exn:break`, `exn:break-continuation`, `exn:break:hang-up`, `exn:break:hang-up?`, `exn:break:terminate`, `exn:break:terminate?`, `exn:break?`, `exn:fail`, `exn:fail:contract`, `exn:fail:contract:arity`, `exn:fail:contract:arity?`, `exn:fail:contract:blame`, `exn:fail:contract:blame-object`, `exn:fail:contract:blame?`, `exn:fail:contract:continuation`, `exn:fail:contract:continuation?`, `exn:fail:contract:divide-by-zero`, `exn:fail:contract:divide-by-zero?`, `exn:fail:contract:non-fixnum-result`, `exn:fail:contract:non-fixnum-result?`, `exn:fail:contract:variable`, `exn:fail:contract:variable-id`, `exn:fail:contract:variable?`, `exn:fail:contract?`, `exn:fail:filesystem`, `exn:fail:filesystem:errno`, `exn:fail:filesystem:errno-errno`, `exn:fail:filesystem:errno?`, `exn:fail:filesystem:exists`, `exn:fail:filesystem:exists?`, `exn:fail:filesystem:missing-module`, `exn:fail:filesystem:missing-module-path`, `exn:fail:filesystem:missing-module?`, `exn:fail:filesystem:version`, `exn:fail:filesystem:version?`, `exn:fail:filesystem?`, `exn:fail:network`, `exn:fail:network:errno`, `exn:fail:network:errno-errno`, `exn:fail:network:errno?`, `exn:fail:network?`, `exn:fail:object`, `exn:fail:object?`, `exn:fail:out-of-memory`, `exn:fail:out-of-memory?`, `exn:fail:read`, `exn:fail:read-srclocs`, `exn:fail:read:eof`, `exn:fail:read:eof?`, `exn:fail:read:non-char`, `exn:fail:read:non-char?`, `exn:fail:read?`, `exn:fail:syntax`, `exn:fail:syntax-exprs`, `exn:fail:syntax:missing-module`, `exn:fail:syntax:missing-module-path`, `exn:fail:syntax:missing-module?`, `exn:fail:syntax:unbound`, `exn:fail:syntax:unbound?`, `exn:fail:syntax?`, `exn:fail:unsupported`, `exn:fail:unsupported?`, `exn:fail:user`, `exn:fail:user?`, `exn:fail?`, `exn:misc:match?`, `exn:missing-module-accessor`, `exn:missing-module?`, `exn:srclocs-accessor`, `exn:srclocs?`, `exn?`, `exp`, `expand`, `expand-once`, `expand-syntax`, `expand-syntax-once`, `expand-syntax-to-top-form`, `expand-to-top-form`, `expand-user-path`, `explode-path`, `expt`, `externalizable<%>`, `failure-result/c`, `false?`, `field-names`, `fifth`, `file->bytes`, `file->bytes-lines`, `file->lines`, `file->list`, `file->string`, `file->value`, `file-exists?`, `file-name-from-path`, `file-or-directory-identity`, `file-or-directory-modify-seconds`, `file-or-directory-permissions`, `file-position`, `file-position*`, `file-size`, `file-stream-buffer-mode`, `file-stream-port?`, `file-truncate`, `filename-extension`, `filesystem-change-evt`, `filesystem-change-evt-cancel`, `filesystem-change-evt?`, `filesystem-root-list`, `filter`, `filter-map`, `filter-not`, `filter-read-input-port`, `find-executable-path`, `find-files`, `find-library-collection-links`, `find-library-collection-paths`, `find-relative-path`, `find-system-path`, `findf`, `first`, `first-or/c`, `fixnum?`, `flat-contract`, `flat-contract-predicate`, `flat-contract-property?`, `flat-contract?`, `flat-named-contract`, `flatten`, `floating-point-bytes->real`, `flonum?`, `floor`, `flush-output`, `fold-files`, `foldl`, `foldr`, `for-each`, `force`, `format`, `fourth`, `fprintf`, `free-identifier=?`, `free-label-identifier=?`, `free-template-identifier=?`, `free-transformer-identifier=?`, `fsemaphore-count`, `fsemaphore-post`, `fsemaphore-try-wait?`, `fsemaphore-wait`, `fsemaphore?`, `future`, `future?`, `futures-enabled?`, `gcd`, `generate-member-key`, `generate-temporaries`, `generic-set?`, `generic?`, `gensym`, `get-output-bytes`, `get-output-string`, `get-preference`, `get/build-late-neg-projection`, `get/build-val-first-projection`, `getenv`, `global-port-print-handler`, `group-by`, `group-execute-bit`, `group-read-bit`, `group-write-bit`, `guard-evt`, `handle-evt`, `handle-evt?`, `has-blame?`, `has-contract?`, `hash`, `hash->list`, `hash-clear`, `hash-clear!`, `hash-copy`, `hash-copy-clear`, `hash-count`, `hash-empty?`, `hash-eq?`, `hash-equal?`, `hash-eqv?`, `hash-for-each`, `hash-has-key?`, `hash-iterate-first`, `hash-iterate-key`, `hash-iterate-key+value`, `hash-iterate-next`, `hash-iterate-pair`, `hash-iterate-value`, `hash-keys`, `hash-map`, `hash-placeholder?`, `hash-ref`, `hash-ref!`, `hash-remove`, `hash-remove!`, `hash-set`, `hash-set!`, `hash-set*`, `hash-set*!`, `hash-update`, `hash-update!`, `hash-values`, `hash-weak?`, `hash/c`, `hash?`, `hasheq`, `hasheqv`, `identifier-binding`, `identifier-binding-symbol`, `identifier-label-binding`, `identifier-prune-lexical-context`, `identifier-prune-to-source-module`, `identifier-remove-from-definition-context`, `identifier-template-binding`, `identifier-transformer-binding`, `identifier?`, `identity`, `if/c`, `imag-part`, `immutable?`, `impersonate-box`, `impersonate-channel`, `impersonate-continuation-mark-key`, `impersonate-hash`, `impersonate-hash-set`, `impersonate-procedure`, `impersonate-procedure*`, `impersonate-prompt-tag`, `impersonate-struct`, `impersonate-vector`, `impersonator-contract?`, `impersonator-ephemeron`, `impersonator-of?`, `impersonator-prop:application-mark`, `impersonator-prop:blame`, `impersonator-prop:contracted`, `impersonator-property-accessor-procedure?`, `impersonator-property?`, `impersonator?`, `implementation?`, `implementation?/c`, `in-bytes`, `in-bytes-lines`, `in-combinations`, `in-cycle`, `in-dict`, `in-dict-keys`, `in-dict-pairs`, `in-dict-values`, `in-directory`, `in-hash`, `in-hash-keys`, `in-hash-pairs`, `in-hash-values`, `in-immutable-hash`, `in-immutable-hash-keys`, `in-immutable-hash-pairs`, `in-immutable-hash-values`, `in-immutable-set`, `in-indexed`, `in-input-port-bytes`, `in-input-port-chars`, `in-lines`, `in-list`, `in-mlist`, `in-mutable-hash`, `in-mutable-hash-keys`, `in-mutable-hash-pairs`, `in-mutable-hash-values`, `in-mutable-set`, `in-naturals`, `in-parallel`, `in-permutations`, `in-port`, `in-producer`, `in-range`, `in-sequences`, `in-set`, `in-slice`, `in-stream`, `in-string`, `in-syntax`, `in-value`, `in-values*-sequence`, `in-values-sequence`, `in-vector`, `in-weak-hash`, `in-weak-hash-keys`, `in-weak-hash-pairs`, `in-weak-hash-values`, `in-weak-set`, `inexact->exact`, `inexact-real?`, `inexact?`, `infinite?`, `input-port-append`, `input-port?`, `inspector?`, `instanceof/c`, `integer->char`, `integer->integer-bytes`, `integer-bytes->integer`, `integer-in`, `integer-length`, `integer-sqrt`, `integer-sqrt/remainder`, `integer?`, `interface->method-names`, `interface-extension?`, `interface?`, `internal-definition-context-binding-identifiers`, `internal-definition-context-introduce`, `internal-definition-context-seal`, `internal-definition-context?`, `is-a?`, `is-a?/c`, `keyword->string`, `keyword-apply`, `keywordbytes`, `list->mutable-set`, `list->mutable-seteq`, `list->mutable-seteqv`, `list->set`, `list->seteq`, `list->seteqv`, `list->string`, `list->vector`, `list->weak-set`, `list->weak-seteq`, `list->weak-seteqv`, `list-contract?`, `list-prefix?`, `list-ref`, `list-set`, `list-tail`, `list-update`, `list/c`, `list?`, `listen-port-number?`, `listof`, `load`, `load-extension`, `load-on-demand-enabled`, `load-relative`, `load-relative-extension`, `load/cd`, `load/use-compiled`, `local-expand`, `local-expand/capture-lifts`, `local-transformer-expand`, `local-transformer-expand/capture-lifts`, `locale-string-encoding`, `log`, `log-all-levels`, `log-level-evt`, `log-level?`, `log-max-level`, `log-message`, `log-receiver?`, `logger-name`, `logger?`, `magnitude`, `make-arity-at-least`, `make-base-empty-namespace`, `make-base-namespace`, `make-bytes`, `make-channel`, `make-chaperone-contract`, `make-continuation-mark-key`, `make-continuation-prompt-tag`, `make-contract`, `make-custodian`, `make-custodian-box`, `make-custom-hash`, `make-custom-hash-types`, `make-custom-set`, `make-custom-set-types`, `make-date`, `make-date*`, `make-derived-parameter`, `make-directory`, `make-directory*`, `make-do-sequence`, `make-empty-namespace`, `make-environment-variables`, `make-ephemeron`, `make-exn`, `make-exn:break`, `make-exn:break:hang-up`, `make-exn:break:terminate`, `make-exn:fail`, `make-exn:fail:contract`, `make-exn:fail:contract:arity`, `make-exn:fail:contract:blame`, `make-exn:fail:contract:continuation`, `make-exn:fail:contract:divide-by-zero`, `make-exn:fail:contract:non-fixnum-result`, `make-exn:fail:contract:variable`, `make-exn:fail:filesystem`, `make-exn:fail:filesystem:errno`, `make-exn:fail:filesystem:exists`, `make-exn:fail:filesystem:missing-module`, `make-exn:fail:filesystem:version`, `make-exn:fail:network`, `make-exn:fail:network:errno`, `make-exn:fail:object`, `make-exn:fail:out-of-memory`, `make-exn:fail:read`, `make-exn:fail:read:eof`, `make-exn:fail:read:non-char`, `make-exn:fail:syntax`, `make-exn:fail:syntax:missing-module`, `make-exn:fail:syntax:unbound`, `make-exn:fail:unsupported`, `make-exn:fail:user`, `make-file-or-directory-link`, `make-flat-contract`, `make-fsemaphore`, `make-generic`, `make-handle-get-preference-locked`, `make-hash`, `make-hash-placeholder`, `make-hasheq`, `make-hasheq-placeholder`, `make-hasheqv`, `make-hasheqv-placeholder`, `make-immutable-custom-hash`, `make-immutable-hash`, `make-immutable-hasheq`, `make-immutable-hasheqv`, `make-impersonator-property`, `make-input-port`, `make-input-port/read-to-peek`, `make-inspector`, `make-keyword-procedure`, `make-known-char-range-list`, `make-limited-input-port`, `make-list`, `make-lock-file-name`, `make-log-receiver`, `make-logger`, `make-mixin-contract`, `make-mutable-custom-set`, `make-none/c`, `make-object`, `make-output-port`, `make-parameter`, `make-parent-directory*`, `make-phantom-bytes`, `make-pipe`, `make-pipe-with-specials`, `make-placeholder`, `make-plumber`, `make-polar`, `make-prefab-struct`, `make-primitive-class`, `make-proj-contract`, `make-pseudo-random-generator`, `make-reader-graph`, `make-readtable`, `make-rectangular`, `make-rename-transformer`, `make-resolved-module-path`, `make-security-guard`, `make-semaphore`, `make-set!-transformer`, `make-shared-bytes`, `make-sibling-inspector`, `make-special-comment`, `make-srcloc`, `make-string`, `make-struct-field-accessor`, `make-struct-field-mutator`, `make-struct-type`, `make-struct-type-property`, `make-syntax-delta-introducer`, `make-syntax-introducer`, `make-temporary-file`, `make-tentative-pretty-print-output-port`, `make-thread-cell`, `make-thread-group`, `make-vector`, `make-weak-box`, `make-weak-custom-hash`, `make-weak-custom-set`, `make-weak-hash`, `make-weak-hasheq`, `make-weak-hasheqv`, `make-will-executor`, `map`, `match-equality-test`, `matches-arity-exactly?`, `max`, `mcar`, `mcdr`, `mcons`, `member`, `member-name-key-hash-code`, `member-name-key=?`, `member-name-key?`, `memf`, `memq`, `memv`, `merge-input`, `method-in-interface?`, `min`, `mixin-contract`, `module->exports`, `module->imports`, `module->language-info`, `module->namespace`, `module-compiled-cross-phase-persistent?`, `module-compiled-exports`, `module-compiled-imports`, `module-compiled-language-info`, `module-compiled-name`, `module-compiled-submodules`, `module-declared?`, `module-path-index-join`, `module-path-index-resolve`, `module-path-index-split`, `module-path-index-submodule`, `module-path-index?`, `module-path?`, `module-predefined?`, `module-provide-protected?`, `modulo`, `mpair?`, `mutable-set`, `mutable-seteq`, `mutable-seteqv`, `n->th`, `nack-guard-evt`, `namespace-anchor->empty-namespace`, `namespace-anchor->namespace`, `namespace-anchor?`, `namespace-attach-module`, `namespace-attach-module-declaration`, `namespace-base-phase`, `namespace-mapped-symbols`, `namespace-module-identifier`, `namespace-module-registry`, `namespace-require`, `namespace-require/constant`, `namespace-require/copy`, `namespace-require/expansion-time`, `namespace-set-variable-value!`, `namespace-symbol->identifier`, `namespace-syntax-introduce`, `namespace-undefine-variable!`, `namespace-unprotect-module`, `namespace-variable-value`, `namespace?`, `nan?`, `natural-number/c`, `negate`, `negative?`, `never-evt`, `new-∀/c`, `new-∃/c`, `newline`, `ninth`, `non-empty-listof`, `non-empty-string?`, `none/c`, `normal-case-path`, `normalize-arity`, `normalize-path`, `normalized-arity?`, `not`, `not/c`, `null`, `null?`, `number->string`, `number?`, `numerator`, `object%`, `object->vector`, `object-info`, `object-interface`, `object-method-arity-includes?`, `object-name`, `object-or-false=?`, `object=?`, `object?`, `odd?`, `one-of/c`, `open-input-bytes`, `open-input-file`, `open-input-output-file`, `open-input-string`, `open-output-bytes`, `open-output-file`, `open-output-nowhere`, `open-output-string`, `or/c`, `order-of-magnitude`, `ormap`, `other-execute-bit`, `other-read-bit`, `other-write-bit`, `output-port?`, `pair?`, `parameter-procedure=?`, `parameter/c`, `parameter?`, `parameterization?`, `parse-command-line`, `partition`, `path->bytes`, `path->complete-path`, `path->directory-path`, `path->string`, `path-add-suffix`, `path-convention-type`, `path-element->bytes`, `path-element->string`, `path-element?`, `path-for-some-system?`, `path-list-string->path-list`, `path-only`, `path-replace-suffix`, `path-string?`, `pathbytes`, `port->bytes-lines`, `port->lines`, `port->list`, `port->string`, `port-closed-evt`, `port-closed?`, `port-commit-peeked`, `port-count-lines!`, `port-count-lines-enabled`, `port-counts-lines?`, `port-display-handler`, `port-file-identity`, `port-file-unlock`, `port-next-location`, `port-number?`, `port-print-handler`, `port-progress-evt`, `port-provides-progress-evts?`, `port-read-handler`, `port-try-file-lock?`, `port-write-handler`, `port-writes-atomic?`, `port-writes-special?`, `port?`, `positive?`, `predicate/c`, `prefab-key->struct-type`, `prefab-key?`, `prefab-struct-key`, `preferences-lock-file-mode`, `pregexp`, `pregexp?`, `pretty-display`, `pretty-format`, `pretty-print`, `pretty-print-.-symbol-without-bars`, `pretty-print-abbreviate-read-macros`, `pretty-print-columns`, `pretty-print-current-style-table`, `pretty-print-depth`, `pretty-print-exact-as-decimal`, `pretty-print-extend-style-table`, `pretty-print-handler`, `pretty-print-newline`, `pretty-print-post-print-hook`, `pretty-print-pre-print-hook`, `pretty-print-print-hook`, `pretty-print-print-line`, `pretty-print-remap-stylable`, `pretty-print-show-inexactness`, `pretty-print-size-hook`, `pretty-print-style-table?`, `pretty-printing`, `pretty-write`, `primitive-closure?`, `primitive-result-arity`, `primitive?`, `print`, `print-as-expression`, `print-boolean-long-form`, `print-box`, `print-graph`, `print-hash-table`, `print-mpair-curly-braces`, `print-pair-curly-braces`, `print-reader-abbreviations`, `print-struct`, `print-syntax-width`, `print-unreadable`, `print-vector-length`, `printable/c`, `printable<%>`, `printf`, `println`, `procedure->method`, `procedure-arity`, `procedure-arity-includes/c`, `procedure-arity-includes?`, `procedure-arity?`, `procedure-closure-contents-eq?`, `procedure-extract-target`, `procedure-keywords`, `procedure-reduce-arity`, `procedure-reduce-keyword-arity`, `procedure-rename`, `procedure-result-arity`, `procedure-specialize`, `procedure-struct-type?`, `procedure?`, `process`, `process*`, `process*/ports`, `process/ports`, `processor-count`, `progress-evt?`, `promise-forced?`, `promise-running?`, `promise/c`, `promise/name?`, `promise?`, `prop:arity-string`, `prop:arrow-contract`, `prop:arrow-contract-get-info`, `prop:arrow-contract?`, `prop:blame`, `prop:chaperone-contract`, `prop:checked-procedure`, `prop:contract`, `prop:contracted`, `prop:custom-print-quotable`, `prop:custom-write`, `prop:dict`, `prop:dict/contract`, `prop:equal+hash`, `prop:evt`, `prop:exn:missing-module`, `prop:exn:srclocs`, `prop:expansion-contexts`, `prop:flat-contract`, `prop:impersonator-of`, `prop:input-port`, `prop:liberal-define-context`, `prop:object-name`, `prop:opt-chaperone-contract`, `prop:opt-chaperone-contract-get-test`, `prop:opt-chaperone-contract?`, `prop:orc-contract`, `prop:orc-contract-get-subcontracts`, `prop:orc-contract?`, `prop:output-port`, `prop:place-location`, `prop:procedure`, `prop:recursive-contract`, `prop:recursive-contract-unroll`, `prop:recursive-contract?`, `prop:rename-transformer`, `prop:sequence`, `prop:set!-transformer`, `prop:stream`, `proper-subset?`, `pseudo-random-generator->vector`, `pseudo-random-generator-vector?`, `pseudo-random-generator?`, `put-preferences`, `putenv`, `quotient`, `quotient/remainder`, `radians->degrees`, `raise`, `raise-argument-error`, `raise-arguments-error`, `raise-arity-error`, `raise-blame-error`, `raise-contract-error`, `raise-mismatch-error`, `raise-not-cons-blame-error`, `raise-range-error`, `raise-result-error`, `raise-syntax-error`, `raise-type-error`, `raise-user-error`, `random`, `random-seed`, `range`, `rational?`, `rationalize`, `read`, `read-accept-bar-quote`, `read-accept-box`, `read-accept-compiled`, `read-accept-dot`, `read-accept-graph`, `read-accept-infix-dot`, `read-accept-lang`, `read-accept-quasiquote`, `read-accept-reader`, `read-byte`, `read-byte-or-special`, `read-bytes`, `read-bytes!`, `read-bytes!-evt`, `read-bytes-avail!`, `read-bytes-avail!*`, `read-bytes-avail!-evt`, `read-bytes-avail!/enable-break`, `read-bytes-evt`, `read-bytes-line`, `read-bytes-line-evt`, `read-case-sensitive`, `read-cdot`, `read-char`, `read-char-or-special`, `read-curly-brace-as-paren`, `read-curly-brace-with-tag`, `read-decimal-as-inexact`, `read-eval-print-loop`, `read-language`, `read-line`, `read-line-evt`, `read-on-demand-source`, `read-square-bracket-as-paren`, `read-square-bracket-with-tag`, `read-string`, `read-string!`, `read-string!-evt`, `read-string-evt`, `read-syntax`, `read-syntax/recursive`, `read/recursive`, `readtable-mapping`, `readtable?`, `real->decimal-string`, `real->double-flonum`, `real->floating-point-bytes`, `real->single-flonum`, `real-in`, `real-part`, `real?`, `reencode-input-port`, `reencode-output-port`, `regexp`, `regexp-match`, `regexp-match*`, `regexp-match-evt`, `regexp-match-exact?`, `regexp-match-peek`, `regexp-match-peek-immediate`, `regexp-match-peek-positions`, `regexp-match-peek-positions*`, `regexp-match-peek-positions-immediate`, `regexp-match-peek-positions-immediate/end`, `regexp-match-peek-positions/end`, `regexp-match-positions`, `regexp-match-positions*`, `regexp-match-positions/end`, `regexp-match/end`, `regexp-match?`, `regexp-max-lookbehind`, `regexp-quote`, `regexp-replace`, `regexp-replace*`, `regexp-replace-quote`, `regexp-replaces`, `regexp-split`, `regexp-try-match`, `regexp?`, `relative-path?`, `relocate-input-port`, `relocate-output-port`, `remainder`, `remf`, `remf*`, `remove`, `remove*`, `remove-duplicates`, `remq`, `remq*`, `remv`, `remv*`, `rename-contract`, `rename-file-or-directory`, `rename-transformer-target`, `rename-transformer?`, `replace-evt`, `reroot-path`, `resolve-path`, `resolved-module-path-name`, `resolved-module-path?`, `rest`, `reverse`, `round`, `second`, `seconds->date`, `security-guard?`, `semaphore-peek-evt`, `semaphore-peek-evt?`, `semaphore-post`, `semaphore-try-wait?`, `semaphore-wait`, `semaphore-wait/enable-break`, `semaphore?`, `sequence->list`, `sequence->stream`, `sequence-add-between`, `sequence-andmap`, `sequence-append`, `sequence-count`, `sequence-filter`, `sequence-fold`, `sequence-for-each`, `sequence-generate`, `sequence-generate*`, `sequence-length`, `sequence-map`, `sequence-ormap`, `sequence-ref`, `sequence-tail`, `sequence/c`, `sequence?`, `set`, `set!-transformer-procedure`, `set!-transformer?`, `set->list`, `set->stream`, `set-add`, `set-add!`, `set-box!`, `set-clear`, `set-clear!`, `set-copy`, `set-copy-clear`, `set-count`, `set-empty?`, `set-eq?`, `set-equal?`, `set-eqv?`, `set-first`, `set-for-each`, `set-implements/c`, `set-implements?`, `set-intersect`, `set-intersect!`, `set-map`, `set-mcar!`, `set-mcdr!`, `set-member?`, `set-mutable?`, `set-phantom-bytes!`, `set-port-next-location!`, `set-remove`, `set-remove!`, `set-rest`, `set-some-basic-contracts!`, `set-subtract`, `set-subtract!`, `set-symmetric-difference`, `set-symmetric-difference!`, `set-union`, `set-union!`, `set-weak?`, `set/c`, `set=?`, `set?`, `seteq`, `seteqv`, `seventh`, `sgn`, `shared-bytes`, `shell-execute`, `shrink-path-wrt`, `shuffle`, `simple-form-path`, `simplify-path`, `sin`, `single-flonum?`, `sinh`, `sixth`, `skip-projection-wrapper?`, `sleep`, `some-system-path->string`, `sort`, `special-comment-value`, `special-comment?`, `special-filter-input-port`, `split-at`, `split-at-right`, `split-common-prefix`, `split-path`, `splitf-at`, `splitf-at-right`, `sqr`, `sqrt`, `srcloc`, `srcloc->string`, `srcloc-column`, `srcloc-line`, `srcloc-position`, `srcloc-source`, `srcloc-span`, `srcloc?`, `stop-after`, `stop-before`, `stream->list`, `stream-add-between`, `stream-andmap`, `stream-append`, `stream-count`, `stream-empty?`, `stream-filter`, `stream-first`, `stream-fold`, `stream-for-each`, `stream-length`, `stream-map`, `stream-ormap`, `stream-ref`, `stream-rest`, `stream-tail`, `stream/c`, `stream?`, `string`, `string->bytes/latin-1`, `string->bytes/locale`, `string->bytes/utf-8`, `string->immutable-string`, `string->keyword`, `string->list`, `string->number`, `string->path`, `string->path-element`, `string->some-system-path`, `string->symbol`, `string->uninterned-symbol`, `string->unreadable-symbol`, `string-append`, `string-append*`, `string-ci<=?`, `string-ci=?`, `string-ci>?`, `string-contains?`, `string-copy`, `string-copy!`, `string-downcase`, `string-environment-variable-name?`, `string-fill!`, `string-foldcase`, `string-join`, `string-len/c`, `string-length`, `string-locale-ci?`, `string-locale-downcase`, `string-locale-upcase`, `string-locale?`, `string-no-nuls?`, `string-normalize-nfc`, `string-normalize-nfd`, `string-normalize-nfkc`, `string-normalize-nfkd`, `string-normalize-spaces`, `string-port?`, `string-prefix?`, `string-ref`, `string-replace`, `string-set!`, `string-split`, `string-suffix?`, `string-titlecase`, `string-trim`, `string-upcase`, `string-utf-8-length`, `string<=?`, `string=?`, `string>?`, `string?`, `struct->vector`, `struct-accessor-procedure?`, `struct-constructor-procedure?`, `struct-info`, `struct-mutator-procedure?`, `struct-predicate-procedure?`, `struct-type-info`, `struct-type-make-constructor`, `struct-type-make-predicate`, `struct-type-property-accessor-procedure?`, `struct-type-property/c`, `struct-type-property?`, `struct-type?`, `struct:arity-at-least`, `struct:arrow-contract-info`, `struct:date`, `struct:date*`, `struct:exn`, `struct:exn:break`, `struct:exn:break:hang-up`, `struct:exn:break:terminate`, `struct:exn:fail`, `struct:exn:fail:contract`, `struct:exn:fail:contract:arity`, `struct:exn:fail:contract:blame`, `struct:exn:fail:contract:continuation`, `struct:exn:fail:contract:divide-by-zero`, `struct:exn:fail:contract:non-fixnum-result`, `struct:exn:fail:contract:variable`, `struct:exn:fail:filesystem`, `struct:exn:fail:filesystem:errno`, `struct:exn:fail:filesystem:exists`, `struct:exn:fail:filesystem:missing-module`, `struct:exn:fail:filesystem:version`, `struct:exn:fail:network`, `struct:exn:fail:network:errno`, `struct:exn:fail:object`, `struct:exn:fail:out-of-memory`, `struct:exn:fail:read`, `struct:exn:fail:read:eof`, `struct:exn:fail:read:non-char`, `struct:exn:fail:syntax`, `struct:exn:fail:syntax:missing-module`, `struct:exn:fail:syntax:unbound`, `struct:exn:fail:unsupported`, `struct:exn:fail:user`, `struct:srcloc`, `struct:wrapped-extra-arg-arrow`, `struct?`, `sub1`, `subbytes`, `subclass?`, `subclass?/c`, `subprocess`, `subprocess-group-enabled`, `subprocess-kill`, `subprocess-pid`, `subprocess-status`, `subprocess-wait`, `subprocess?`, `subset?`, `substring`, `suggest/c`, `symbol->string`, `symbol-interned?`, `symbol-unreadable?`, `symboldatum`, `syntax->list`, `syntax-arm`, `syntax-column`, `syntax-debug-info`, `syntax-disarm`, `syntax-e`, `syntax-line`, `syntax-local-bind-syntaxes`, `syntax-local-certifier`, `syntax-local-context`, `syntax-local-expand-expression`, `syntax-local-get-shadower`, `syntax-local-identifier-as-binding`, `syntax-local-introduce`, `syntax-local-lift-context`, `syntax-local-lift-expression`, `syntax-local-lift-module`, `syntax-local-lift-module-end-declaration`, `syntax-local-lift-provide`, `syntax-local-lift-require`, `syntax-local-lift-values-expression`, `syntax-local-make-definition-context`, `syntax-local-make-delta-introducer`, `syntax-local-module-defined-identifiers`, `syntax-local-module-exports`, `syntax-local-module-required-identifiers`, `syntax-local-name`, `syntax-local-phase-level`, `syntax-local-submodules`, `syntax-local-transforming-module-provides?`, `syntax-local-value`, `syntax-local-value/immediate`, `syntax-original?`, `syntax-position`, `syntax-property`, `syntax-property-preserved?`, `syntax-property-symbol-keys`, `syntax-protect`, `syntax-rearm`, `syntax-recertify`, `syntax-shift-phase-level`, `syntax-source`, `syntax-source-module`, `syntax-span`, `syntax-taint`, `syntax-tainted?`, `syntax-track-origin`, `syntax-transforming-module-expression?`, `syntax-transforming-with-lifts?`, `syntax-transforming?`, `syntax/c`, `syntax?`, `system`, `system*`, `system*/exit-code`, `system-big-endian?`, `system-idle-evt`, `system-language+country`, `system-library-subpath`, `system-path-convention-type`, `system-type`, `system/exit-code`, `tail-marks-match?`, `take`, `take-common-prefix`, `take-right`, `takef`, `takef-right`, `tan`, `tanh`, `tcp-abandon-port`, `tcp-accept`, `tcp-accept-evt`, `tcp-accept-ready?`, `tcp-accept/enable-break`, `tcp-addresses`, `tcp-close`, `tcp-connect`, `tcp-connect/enable-break`, `tcp-listen`, `tcp-listener?`, `tcp-port?`, `tentative-pretty-print-port-cancel`, `tentative-pretty-print-port-transfer`, `tenth`, `terminal-port?`, `the-unsupplied-arg`, `third`, `thread`, `thread-cell-ref`, `thread-cell-set!`, `thread-cell-values?`, `thread-cell?`, `thread-dead-evt`, `thread-dead?`, `thread-group?`, `thread-receive`, `thread-receive-evt`, `thread-resume`, `thread-resume-evt`, `thread-rewind-receive`, `thread-running?`, `thread-send`, `thread-suspend`, `thread-suspend-evt`, `thread-try-receive`, `thread-wait`, `thread/suspend-to-kill`, `thread?`, `time-apply`, `touch`, `transplant-input-port`, `transplant-output-port`, `true`, `truncate`, `udp-addresses`, `udp-bind!`, `udp-bound?`, `udp-close`, `udp-connect!`, `udp-connected?`, `udp-multicast-interface`, `udp-multicast-join-group!`, `udp-multicast-leave-group!`, `udp-multicast-loopback?`, `udp-multicast-set-interface!`, `udp-multicast-set-loopback!`, `udp-multicast-set-ttl!`, `udp-multicast-ttl`, `udp-open-socket`, `udp-receive!`, `udp-receive!*`, `udp-receive!-evt`, `udp-receive!/enable-break`, `udp-receive-ready-evt`, `udp-send`, `udp-send*`, `udp-send-evt`, `udp-send-ready-evt`, `udp-send-to`, `udp-send-to*`, `udp-send-to-evt`, `udp-send-to/enable-break`, `udp-send/enable-break`, `udp?`, `unbox`, `uncaught-exception-handler`, `unit?`, `unspecified-dom`, `unsupplied-arg?`, `use-collection-link-paths`, `use-compiled-file-paths`, `use-user-specific-search-paths`, `user-execute-bit`, `user-read-bit`, `user-write-bit`, `value-blame`, `value-contract`, `values`, `variable-reference->empty-namespace`, `variable-reference->module-base-phase`, `variable-reference->module-declaration-inspector`, `variable-reference->module-path-index`, `variable-reference->module-source`, `variable-reference->namespace`, `variable-reference->phase`, `variable-reference->resolved-module-path`, `variable-reference-constant?`, `variable-reference?`, `vector`, `vector->immutable-vector`, `vector->list`, `vector->pseudo-random-generator`, `vector->pseudo-random-generator!`, `vector->values`, `vector-append`, `vector-argmax`, `vector-argmin`, `vector-copy`, `vector-copy!`, `vector-count`, `vector-drop`, `vector-drop-right`, `vector-fill!`, `vector-filter`, `vector-filter-not`, `vector-immutable`, `vector-immutable/c`, `vector-immutableof`, `vector-length`, `vector-map`, `vector-map!`, `vector-member`, `vector-memq`, `vector-memv`, `vector-ref`, `vector-set!`, `vector-set*!`, `vector-set-performance-stats!`, `vector-split-at`, `vector-split-at-right`, `vector-take`, `vector-take-right`, `vector/c`, `vector?`, `vectorof`, `version`, `void`, `void?`, `weak-box-value`, `weak-box?`, `weak-set`, `weak-seteq`, `weak-seteqv`, `will-execute`, `will-executor?`, `will-register`, `will-try-execute`, `with-input-from-bytes`, `with-input-from-file`, `with-input-from-string`, `with-output-to-bytes`, `with-output-to-file`, `with-output-to-string`, `would-be-future`, `wrap-evt`, `wrapped-extra-arg-arrow`, `wrapped-extra-arg-arrow-extra-neg-party-argument`, `wrapped-extra-arg-arrow-real-func`, `wrapped-extra-arg-arrow?`, `writable<%>`, `write`, `write-byte`, `write-bytes`, `write-bytes-avail`, `write-bytes-avail*`, `write-bytes-avail-evt`, `write-bytes-avail/enable-break`, `write-char`, `write-special`, `write-special-avail*`, `write-special-evt`, `write-string`, `write-to-file`, `writeln`, `xor`, `zero?`, `~.a`, `~.s`, `~.v`, `~a`, `~e`, `~r`, `~s`, `~v`), NameBuiltin, Pop(1)}, - {"(?:\\|[^|]*\\||\\\\[\\w\\W]|[^|\\\\()[\\]{}\",\\'`;\\s]+)+", Name, Pop(1)}, - Include("datum*"), - }, - "unquoted-list": { - Include("list"), - {`(?!\Z)`, Text, Push("unquoted-datum")}, - }, - "quasiquoted-datum": { - Include("datum"), - {`,@?`, Operator, Push("#pop", "unquoted-datum")}, - {"unquote(-splicing)?(?=[()[\\]{}\",\\'`;\\s])", Keyword, Push("#pop", "unquoted-datum")}, - {`[([{]`, Punctuation, Push("#pop", "quasiquoted-list")}, - Include("datum*"), - }, - "quasiquoted-list": { - Include("list"), - {`(?!\Z)`, Text, Push("quasiquoted-datum")}, - }, - "quoted-datum": { - Include("datum"), - {`[([{]`, Punctuation, Push("#pop", "quoted-list")}, - Include("datum*"), - }, - "quoted-list": { - Include("list"), - {`(?!\Z)`, Text, Push("quoted-datum")}, - }, - "block-comment": { - {`#\|`, CommentMultiline, Push()}, - {`\|#`, CommentMultiline, Pop(1)}, - {`[^#|]+|.`, CommentMultiline, nil}, - }, - "string": { - {`"`, LiteralStringDouble, Pop(1)}, - {`(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8}|.)`, LiteralStringEscape, nil}, - {`[^\\"]+`, LiteralStringDouble, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/ragel.go b/vendor/github.com/alecthomas/chroma/lexers/r/ragel.go deleted file mode 100644 index 3da0ea70..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/ragel.go +++ /dev/null @@ -1,76 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ragel lexer. -var Ragel = internal.Register(MustNewLexer( - &Config{ - Name: "Ragel", - Aliases: []string{"ragel"}, - Filenames: []string{}, - MimeTypes: []string{}, - }, - Rules{ - "whitespace": { - {`\s+`, TextWhitespace, nil}, - }, - "comments": { - {`\#.*$`, Comment, nil}, - }, - "keywords": { - {`(access|action|alphtype)\b`, Keyword, nil}, - {`(getkey|write|machine|include)\b`, Keyword, nil}, - {`(any|ascii|extend|alpha|digit|alnum|lower|upper)\b`, Keyword, nil}, - {`(xdigit|cntrl|graph|print|punct|space|zlen|empty)\b`, Keyword, nil}, - }, - "numbers": { - {`0x[0-9A-Fa-f]+`, LiteralNumberHex, nil}, - {`[+-]?[0-9]+`, LiteralNumberInteger, nil}, - }, - "literals": { - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralString, nil}, - {`\[(\\\\|\\\]|[^\]])*\]`, LiteralString, nil}, - {`/(?!\*)(\\\\|\\/|[^/])*/`, LiteralStringRegex, nil}, - }, - "identifiers": { - {`[a-zA-Z_]\w*`, NameVariable, nil}, - }, - "operators": { - {`,`, Operator, nil}, - {`\||&|--?`, Operator, nil}, - {`\.|<:|:>>?`, Operator, nil}, - {`:`, Operator, nil}, - {`->`, Operator, nil}, - {`(>|\$|%|<|@|<>)(/|eof\b)`, Operator, nil}, - {`(>|\$|%|<|@|<>)(!|err\b)`, Operator, nil}, - {`(>|\$|%|<|@|<>)(\^|lerr\b)`, Operator, nil}, - {`(>|\$|%|<|@|<>)(~|to\b)`, Operator, nil}, - {`(>|\$|%|<|@|<>)(\*|from\b)`, Operator, nil}, - {`>|@|\$|%`, Operator, nil}, - {`\*|\?|\+|\{[0-9]*,[0-9]*\}`, Operator, nil}, - {`!|\^`, Operator, nil}, - {`\(|\)`, Operator, nil}, - }, - "root": { - Include("literals"), - Include("whitespace"), - Include("comments"), - Include("keywords"), - Include("numbers"), - Include("identifiers"), - Include("operators"), - {`\{`, Punctuation, Push("host")}, - {`=`, Operator, nil}, - {`;`, Punctuation, nil}, - }, - "host": { - {`([^{}\'"/#]+|[^\\]\\[{}]|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|\#.*$\n?|/(?!\*)(\\\\|\\/|[^/])*/|/)+`, Other, nil}, - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/regedit.go b/vendor/github.com/alecthomas/chroma/lexers/r/regedit.go deleted file mode 100644 index 7ee9cb58..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/regedit.go +++ /dev/null @@ -1,32 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Reg lexer. -var Reg = internal.Register(MustNewLexer( - &Config{ - Name: "reg", - Aliases: []string{"registry"}, - Filenames: []string{"*.reg"}, - MimeTypes: []string{"text/x-windows-registry"}, - }, - Rules{ - "root": { - {`Windows Registry Editor.*`, Text, nil}, - {`\s+`, Text, nil}, - {`[;#].*`, CommentSingle, nil}, - {`(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$`, ByGroups(Keyword, Operator, NameBuiltin, Keyword), nil}, - {`("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)`, ByGroups(NameAttribute, Text, Operator, Text), Push("value")}, - {`(.*?)([ \t]*)(=)([ \t]*)`, ByGroups(NameAttribute, Text, Operator, Text), Push("value")}, - }, - "value": { - {`-`, Operator, Pop(1)}, - {`(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+)`, ByGroups(NameVariable, Punctuation, LiteralNumber), Pop(1)}, - {`.+`, LiteralString, Pop(1)}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/rexx.go b/vendor/github.com/alecthomas/chroma/lexers/r/rexx.go deleted file mode 100644 index 1f5550a5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/rexx.go +++ /dev/null @@ -1,59 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Rexx lexer. -var Rexx = internal.Register(MustNewLexer( - &Config{ - Name: "Rexx", - Aliases: []string{"rexx", "arexx"}, - Filenames: []string{"*.rexx", "*.rex", "*.rx", "*.arexx"}, - MimeTypes: []string{"text/x-rexx"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s`, TextWhitespace, nil}, - {`/\*`, CommentMultiline, Push("comment")}, - {`"`, LiteralString, Push("string_double")}, - {`'`, LiteralString, Push("string_single")}, - {`[0-9]+(\.[0-9]+)?(e[+-]?[0-9])?`, LiteralNumber, nil}, - {`([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b`, ByGroups(NameFunction, TextWhitespace, Operator, TextWhitespace, KeywordDeclaration), nil}, - {`([a-z_]\w*)(\s*)(:)`, ByGroups(NameLabel, TextWhitespace, Operator), nil}, - Include("function"), - Include("keyword"), - Include("operator"), - {`[a-z_]\w*`, Text, nil}, - }, - "function": { - {Words(``, `(\s*)(\()`, `abbrev`, `abs`, `address`, `arg`, `b2x`, `bitand`, `bitor`, `bitxor`, `c2d`, `c2x`, `center`, `charin`, `charout`, `chars`, `compare`, `condition`, `copies`, `d2c`, `d2x`, `datatype`, `date`, `delstr`, `delword`, `digits`, `errortext`, `form`, `format`, `fuzz`, `insert`, `lastpos`, `left`, `length`, `linein`, `lineout`, `lines`, `max`, `min`, `overlay`, `pos`, `queued`, `random`, `reverse`, `right`, `sign`, `sourceline`, `space`, `stream`, `strip`, `substr`, `subword`, `symbol`, `time`, `trace`, `translate`, `trunc`, `value`, `verify`, `word`, `wordindex`, `wordlength`, `wordpos`, `words`, `x2b`, `x2c`, `x2d`, `xrange`), ByGroups(NameBuiltin, TextWhitespace, Operator), nil}, - }, - "keyword": { - {`(address|arg|by|call|do|drop|else|end|exit|for|forever|if|interpret|iterate|leave|nop|numeric|off|on|options|parse|pull|push|queue|return|say|select|signal|to|then|trace|until|while)\b`, KeywordReserved, nil}, - }, - "operator": { - {`(-|//|/|\(|\)|\*\*|\*|\\<<|\\<|\\==|\\=|\\>>|\\>|\\|\|\||\||&&|&|%|\+|<<=|<<|<=|<>|<|==|=|><|>=|>>=|>>|>|¬<<|¬<|¬==|¬=|¬>>|¬>|¬|\.|,)`, Operator, nil}, - }, - "string_double": { - {`[^"\n]+`, LiteralString, nil}, - {`""`, LiteralString, nil}, - {`"`, LiteralString, Pop(1)}, - {`\n`, Text, Pop(1)}, - }, - "string_single": { - {`[^\'\n]`, LiteralString, nil}, - {`\'\'`, LiteralString, nil}, - {`\'`, LiteralString, Pop(1)}, - {`\n`, Text, Pop(1)}, - }, - "comment": { - {`[^*]+`, CommentMultiline, nil}, - {`\*/`, CommentMultiline, Pop(1)}, - {`\*`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/rst.go b/vendor/github.com/alecthomas/chroma/lexers/r/rst.go deleted file mode 100644 index f09dad09..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/rst.go +++ /dev/null @@ -1,86 +0,0 @@ -package r - -import ( - "strings" - - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Restructuredtext lexer. -var Restructuredtext = internal.Register(MustNewLexer( - &Config{ - Name: "reStructuredText", - Aliases: []string{"rst", "rest", "restructuredtext"}, - Filenames: []string{"*.rst", "*.rest"}, - MimeTypes: []string{"text/x-rst", "text/prs.fallenstein.rst"}, - }, - Rules{ - "root": { - {"^(=+|-+|`+|:+|\\.+|\\'+|\"+|~+|\\^+|_+|\\*+|\\++|#+)([ \\t]*\\n)(.+)(\\n)(\\1)(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text, GenericHeading, Text), nil}, - {"^(\\S.*)(\\n)(={3,}|-{3,}|`{3,}|:{3,}|\\.{3,}|\\'{3,}|\"{3,}|~{3,}|\\^{3,}|_{3,}|\\*{3,}|\\+{3,}|#{3,})(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text), nil}, - {`^(\s*)([-*+])( .+\n(?:\1 .+\n)*)`, ByGroups(Text, LiteralNumber, UsingSelf("inline")), nil}, - {`^(\s*)([0-9#ivxlcmIVXLCM]+\.)( .+\n(?:\1 .+\n)*)`, ByGroups(Text, LiteralNumber, UsingSelf("inline")), nil}, - {`^(\s*)(\(?[0-9#ivxlcmIVXLCM]+\))( .+\n(?:\1 .+\n)*)`, ByGroups(Text, LiteralNumber, UsingSelf("inline")), nil}, - {`^(\s*)([A-Z]+\.)( .+\n(?:\1 .+\n)+)`, ByGroups(Text, LiteralNumber, UsingSelf("inline")), nil}, - {`^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1 .+\n)+)`, ByGroups(Text, LiteralNumber, UsingSelf("inline")), nil}, - {`^(\s*)(\|)( .+\n(?:\| .+\n)*)`, ByGroups(Text, Operator, UsingSelf("inline")), nil}, - {`^( *\.\.)(\s*)((?:source)?code(?:-block)?)(::)([ \t]*)([^\n]+)(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)`, EmitterFunc(rstCodeBlock), nil}, - {`^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))`, ByGroups(Punctuation, Text, OperatorWord, Punctuation, Text, UsingSelf("inline")), nil}, - {`^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$`, ByGroups(Punctuation, Text, NameTag, UsingSelf("inline")), nil}, - {`^( *\.\.)(\s*)(\[.+\])(.*?)$`, ByGroups(Punctuation, Text, NameTag, UsingSelf("inline")), nil}, - {`^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))`, ByGroups(Punctuation, Text, NameTag, Text, OperatorWord, Punctuation, Text, UsingSelf("inline")), nil}, - {`^ *\.\..*(\n( +.*\n|\n)+)?`, CommentPreproc, nil}, - {`^( *)(:[a-zA-Z-]+:)(\s*)$`, ByGroups(Text, NameClass, Text), nil}, - {`^( *)(:.*?:)([ \t]+)(.*?)$`, ByGroups(Text, NameClass, Text, NameFunction), nil}, - {`^(\S.*(?)(`__?)", ByGroups(LiteralString, LiteralStringInterpol, LiteralString), nil}, - {"`.+?`__?", LiteralString, nil}, - {"(`.+?`)(:[a-zA-Z0-9:-]+?:)?", ByGroups(NameVariable, NameAttribute), nil}, - {"(:[a-zA-Z0-9:-]+?:)(`.+?`)", ByGroups(NameAttribute, NameVariable), nil}, - {`\*\*.+?\*\*`, GenericStrong, nil}, - {`\*.+?\*`, GenericEmph, nil}, - {`\[.*?\]_`, LiteralString, nil}, - {`<.+?>`, NameTag, nil}, - {"[^\\\\\\n\\[*`:]+", Text, nil}, - {`.`, Text, nil}, - }, - "literal": { - {"[^`]+", LiteralString, nil}, - {"``((?=$)|(?=[-/:.,; \\n\\x00\\\u2010\\\u2011\\\u2012\\\u2013\\\u2014\\\u00a0\\'\\\"\\)\\]\\}\\>\\\u2019\\\u201d\\\u00bb\\!\\?]))", LiteralString, Pop(1)}, - {"`", LiteralString, nil}, - }, - }, -)) - -func rstCodeBlock(groups []string, lexer Lexer) Iterator { - iterators := []Iterator{} - tokens := []Token{ - {Punctuation, groups[1]}, - {Text, groups[2]}, - {OperatorWord, groups[3]}, - {Punctuation, groups[4]}, - {Text, groups[5]}, - {Keyword, groups[6]}, - {Text, groups[7]}, - } - code := strings.Join(groups[8:], "") - lexer = internal.Get(groups[6]) - if lexer == nil { - tokens = append(tokens, Token{String, code}) - iterators = append(iterators, Literator(tokens...)) - } else { - sub, err := lexer.Tokenise(nil, code) - if err != nil { - panic(err) - } - iterators = append(iterators, Literator(tokens...), sub) - } - return Concaterator(iterators...) -} diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/ruby.go b/vendor/github.com/alecthomas/chroma/lexers/r/ruby.go deleted file mode 100644 index 6af8db20..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/ruby.go +++ /dev/null @@ -1,250 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Ruby lexer. -var Ruby = internal.Register(MustNewLexer( - &Config{ - Name: "Ruby", - Aliases: []string{"rb", "ruby", "duby"}, - Filenames: []string{"*.rb", "*.rbw", "Rakefile", "*.rake", "*.gemspec", "*.rbx", "*.duby", "Gemfile"}, - MimeTypes: []string{"text/x-ruby", "application/x-ruby"}, - DotAll: true, - }, - Rules{ - "root": { - {`\A#!.+?$`, CommentHashbang, nil}, - {`#.*?$`, CommentSingle, nil}, - {`=begin\s.*?\n=end.*?$`, CommentMultiline, nil}, - {Words(``, `\b`, `BEGIN`, `END`, `alias`, `begin`, `break`, `case`, `defined?`, `do`, `else`, `elsif`, `end`, `ensure`, `for`, `if`, `in`, `next`, `redo`, `rescue`, `raise`, `retry`, `return`, `super`, `then`, `undef`, `unless`, `until`, `when`, `while`, `yield`), Keyword, nil}, - {`(module)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)`, ByGroups(Keyword, Text, NameNamespace), nil}, - {`(def)(\s+)`, ByGroups(Keyword, Text), Push("funcname")}, - {"def(?=[*%&^`~+-/\\[<>=])", Keyword, Push("funcname")}, - {`(class)(\s+)`, ByGroups(Keyword, Text), Push("classname")}, - {Words(``, `\b`, `initialize`, `new`, `loop`, `include`, `extend`, `raise`, `attr_reader`, `attr_writer`, `attr_accessor`, `attr`, `catch`, `throw`, `private`, `module_function`, `public`, `protected`, `true`, `false`, `nil`), KeywordPseudo, nil}, - {`(not|and|or)\b`, OperatorWord, nil}, - {Words(``, `\?`, `autoload`, `block_given`, `const_defined`, `eql`, `equal`, `frozen`, `include`, `instance_of`, `is_a`, `iterator`, `kind_of`, `method_defined`, `nil`, `private_method_defined`, `protected_method_defined`, `public_method_defined`, `respond_to`, `tainted`), NameBuiltin, nil}, - {`(chomp|chop|exit|gsub|sub)!`, NameBuiltin, nil}, - {Words(`(?~!:])|(?<=(?:\s|;)when\s)|(?<=(?:\s|;)or\s)|(?<=(?:\s|;)and\s)|(?<=\.index\s)|(?<=\.scan\s)|(?<=\.sub\s)|(?<=\.sub!\s)|(?<=\.gsub\s)|(?<=\.gsub!\s)|(?<=\.match\s)|(?<=(?:\s|;)if\s)|(?<=(?:\s|;)elsif\s)|(?<=^when\s)|(?<=^index\s)|(?<=^scan\s)|(?<=^sub\s)|(?<=^gsub\s)|(?<=^sub!\s)|(?<=^gsub!\s)|(?<=^match\s)|(?<=^if\s)|(?<=^elsif\s))(\s*)(/)`, ByGroups(Text, LiteralStringRegex), Push("multiline-regex")}, - {`(?<=\(|,|\[)/`, LiteralStringRegex, Push("multiline-regex")}, - {`(\s+)(/)(?![\s=])`, ByGroups(Text, LiteralStringRegex), Push("multiline-regex")}, - {`(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberOct, Text, Operator), nil}, - {`(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberHex, Text, Operator), nil}, - {`(0b[01]+(?:_[01]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberBin, Text, Operator), nil}, - {`([\d]+(?:_\d+)*)(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil}, - {`@@[a-zA-Z_]\w*`, NameVariableClass, nil}, - {`@[a-zA-Z_]\w*`, NameVariableInstance, nil}, - {`\$\w+`, NameVariableGlobal, nil}, - {"\\$[!@&`\\'+~=/\\\\,;.<>_*$?:\"^-]", NameVariableGlobal, nil}, - {`\$-[0adFiIlpvw]`, NameVariableGlobal, nil}, - {`::`, Operator, nil}, - Include("strings"), - {`\?(\\[MC]-)*(\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)(?!\w)`, LiteralStringChar, nil}, - {`[A-Z]\w+`, NameConstant, nil}, - {Words(`(\.|::)`, ``, `*`, `**`, `-`, `+`, `-@`, `+@`, `/`, `%`, `&`, `|`, `^`, "`", `~`, `[]`, `[]=`, `<<`, `>>`, `<`, `<>`, `<=>`, `>`, `>=`, `==`, `===`), ByGroups(Operator, NameOperator), nil}, - {"(\\.|::)([a-zA-Z_]\\w*[!?]?|[*%&^`~+\\-/\\[<>=])", ByGroups(Operator, Name), nil}, - {`[a-zA-Z_]\w*[!?]?`, Name, nil}, - {`(\[|\]|\*\*|<>?|>=|<=|<=>|=~|={3}|!~|&&?|\|\||\.{1,3})`, Operator, nil}, - {`[-+/*%=<>&!^|~]=?`, Operator, nil}, - {`[(){};,/?:\\]`, Punctuation, nil}, - {`\s+`, Text, nil}, - }, - "funcname": { - {`\(`, Punctuation, Push("defexpr")}, - {"(?:([a-zA-Z_]\\w*)(\\.))?([a-zA-Z_]\\w*[!?]?|\\*\\*?|[-+]@?|[/%&|^`~]|\\[\\]=?|<<|>>|<=?>|>=?|===?)", ByGroups(NameClass, Operator, NameFunction), Pop(1)}, - Default(Pop(1)), - }, - "classname": { - {`\(`, Punctuation, Push("defexpr")}, - {`<<`, Operator, Pop(1)}, - {`[A-Z_]\w*`, NameClass, Pop(1)}, - Default(Pop(1)), - }, - "defexpr": { - {`(\))(\.|::)?`, ByGroups(Punctuation, Operator), Pop(1)}, - {`\(`, Operator, Push()}, - Include("root"), - }, - "in-intp": { - {`\{`, LiteralStringInterpol, Push()}, - {`\}`, LiteralStringInterpol, Pop(1)}, - Include("root"), - }, - "string-intp": { - {`#\{`, LiteralStringInterpol, Push("in-intp")}, - {`#@@?[a-zA-Z_]\w*`, LiteralStringInterpol, nil}, - {`#\$[a-zA-Z_]\w*`, LiteralStringInterpol, nil}, - }, - "string-intp-escaped": { - Include("string-intp"), - {`\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})`, LiteralStringEscape, nil}, - }, - "interpolated-regex": { - Include("string-intp"), - {`[\\#]`, LiteralStringRegex, nil}, - {`[^\\#]+`, LiteralStringRegex, nil}, - }, - "interpolated-string": { - Include("string-intp"), - {`[\\#]`, LiteralStringOther, nil}, - {`[^\\#]+`, LiteralStringOther, nil}, - }, - "multiline-regex": { - Include("string-intp"), - {`\\\\`, LiteralStringRegex, nil}, - {`\\/`, LiteralStringRegex, nil}, - {`[\\#]`, LiteralStringRegex, nil}, - {`[^\\/#]+`, LiteralStringRegex, nil}, - {`/[mixounse]*`, LiteralStringRegex, Pop(1)}, - }, - "end-part": { - {`.+`, CommentPreproc, Pop(1)}, - }, - "strings": { - {`\:@{0,2}[a-zA-Z_]\w*[!?]?`, LiteralStringSymbol, nil}, - {Words(`\:@{0,2}`, ``, `*`, `**`, `-`, `+`, `-@`, `+@`, `/`, `%`, `&`, `|`, `^`, "`", `~`, `[]`, `[]=`, `<<`, `>>`, `<`, `<>`, `<=>`, `>`, `>=`, `==`, `===`), LiteralStringSymbol, nil}, - {`:'(\\\\|\\'|[^'])*'`, LiteralStringSymbol, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`:"`, LiteralStringSymbol, Push("simple-sym")}, - {`([a-zA-Z_]\w*)(:)(?!:)`, ByGroups(LiteralStringSymbol, Punctuation), nil}, - {`"`, LiteralStringDouble, Push("simple-string")}, - {"(?&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)`, ByGroups(Text, LiteralStringOther, None), nil}, - {`^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)`, ByGroups(Text, LiteralStringOther, None), nil}, - {`(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)`, String, nil}, - }, - "simple-string": { - Include("string-intp-escaped"), - {`[^\\"#]+`, LiteralStringDouble, nil}, - {`[\\#]`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "simple-sym": { - Include("string-intp-escaped"), - {`[^\\"#]+`, LiteralStringSymbol, nil}, - {`[\\#]`, LiteralStringSymbol, nil}, - {`"`, LiteralStringSymbol, Pop(1)}, - }, - "simple-backtick": { - Include("string-intp-escaped"), - {"[^\\\\`#]+", LiteralStringBacktick, nil}, - {`[\\#]`, LiteralStringBacktick, nil}, - {"`", LiteralStringBacktick, Pop(1)}, - }, - "cb-intp-string": { - {`\\[\\{}]`, LiteralStringOther, nil}, - {`\{`, LiteralStringOther, Push()}, - {`\}`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#{}]`, LiteralStringOther, nil}, - {`[^\\#{}]+`, LiteralStringOther, nil}, - }, - "cb-string": { - {`\\[\\{}]`, LiteralStringOther, nil}, - {`\{`, LiteralStringOther, Push()}, - {`\}`, LiteralStringOther, Pop(1)}, - {`[\\#{}]`, LiteralStringOther, nil}, - {`[^\\#{}]+`, LiteralStringOther, nil}, - }, - "cb-regex": { - {`\\[\\{}]`, LiteralStringRegex, nil}, - {`\{`, LiteralStringRegex, Push()}, - {`\}[mixounse]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#{}]`, LiteralStringRegex, nil}, - {`[^\\#{}]+`, LiteralStringRegex, nil}, - }, - "sb-intp-string": { - {`\\[\\\[\]]`, LiteralStringOther, nil}, - {`\[`, LiteralStringOther, Push()}, - {`\]`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#\[\]]`, LiteralStringOther, nil}, - {`[^\\#\[\]]+`, LiteralStringOther, nil}, - }, - "sb-string": { - {`\\[\\\[\]]`, LiteralStringOther, nil}, - {`\[`, LiteralStringOther, Push()}, - {`\]`, LiteralStringOther, Pop(1)}, - {`[\\#\[\]]`, LiteralStringOther, nil}, - {`[^\\#\[\]]+`, LiteralStringOther, nil}, - }, - "sb-regex": { - {`\\[\\\[\]]`, LiteralStringRegex, nil}, - {`\[`, LiteralStringRegex, Push()}, - {`\][mixounse]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#\[\]]`, LiteralStringRegex, nil}, - {`[^\\#\[\]]+`, LiteralStringRegex, nil}, - }, - "pa-intp-string": { - {`\\[\\()]`, LiteralStringOther, nil}, - {`\(`, LiteralStringOther, Push()}, - {`\)`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#()]`, LiteralStringOther, nil}, - {`[^\\#()]+`, LiteralStringOther, nil}, - }, - "pa-string": { - {`\\[\\()]`, LiteralStringOther, nil}, - {`\(`, LiteralStringOther, Push()}, - {`\)`, LiteralStringOther, Pop(1)}, - {`[\\#()]`, LiteralStringOther, nil}, - {`[^\\#()]+`, LiteralStringOther, nil}, - }, - "pa-regex": { - {`\\[\\()]`, LiteralStringRegex, nil}, - {`\(`, LiteralStringRegex, Push()}, - {`\)[mixounse]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#()]`, LiteralStringRegex, nil}, - {`[^\\#()]+`, LiteralStringRegex, nil}, - }, - "ab-intp-string": { - {`\\[\\<>]`, LiteralStringOther, nil}, - {`<`, LiteralStringOther, Push()}, - {`>`, LiteralStringOther, Pop(1)}, - Include("string-intp-escaped"), - {`[\\#<>]`, LiteralStringOther, nil}, - {`[^\\#<>]+`, LiteralStringOther, nil}, - }, - "ab-string": { - {`\\[\\<>]`, LiteralStringOther, nil}, - {`<`, LiteralStringOther, Push()}, - {`>`, LiteralStringOther, Pop(1)}, - {`[\\#<>]`, LiteralStringOther, nil}, - {`[^\\#<>]+`, LiteralStringOther, nil}, - }, - "ab-regex": { - {`\\[\\<>]`, LiteralStringRegex, nil}, - {`<`, LiteralStringRegex, Push()}, - {`>[mixounse]*`, LiteralStringRegex, Pop(1)}, - Include("string-intp"), - {`[\\#<>]`, LiteralStringRegex, nil}, - {`[^\\#<>]+`, LiteralStringRegex, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/rust.go b/vendor/github.com/alecthomas/chroma/lexers/r/rust.go deleted file mode 100644 index 5e18b8fb..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/r/rust.go +++ /dev/null @@ -1,135 +0,0 @@ -package r - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Rust lexer. -var Rust = internal.Register(MustNewLexer( - &Config{ - Name: "Rust", - Aliases: []string{"rust"}, - Filenames: []string{"*.rs", "*.rs.in"}, - MimeTypes: []string{"text/rust"}, - EnsureNL: true, - }, - Rules{ - "root": { - {`#![^[\r\n].*$`, CommentPreproc, nil}, - Default(Push("base")), - }, - "base": { - {`\n`, TextWhitespace, nil}, - {`\s+`, TextWhitespace, nil}, - {`//!.*?\n`, LiteralStringDoc, nil}, - {`///(\n|[^/].*?\n)`, LiteralStringDoc, nil}, - {`//(.*?)\n`, CommentSingle, nil}, - {`/\*\*(\n|[^/*])`, LiteralStringDoc, Push("doccomment")}, - {`/\*!`, LiteralStringDoc, Push("doccomment")}, - {`/\*`, CommentMultiline, Push("comment")}, - {`r#*"(?:\\.|[^\\\r\n;])*"#*`, LiteralString, nil}, - {`"(?:\\.|[^\\\r\n"])*"`, LiteralString, nil}, - {`\$([a-zA-Z_]\w*|\(,?|\),?|,?)`, CommentPreproc, nil}, - {Words(``, `\b`, `as`, `box`, `const`, `crate`, `else`, `extern`, `for`, `if`, `impl`, `in`, `loop`, `match`, `move`, `mut`, `pub`, `ref`, `return`, `static`, `super`, `trait`, `unsafe`, `use`, `where`, `while`), Keyword, nil}, - {Words(``, `\b`, `abstract`, `alignof`, `become`, `do`, `final`, `macro`, `offsetof`, `override`, `priv`, `proc`, `pure`, `sizeof`, `typeof`, `unsized`, `virtual`, `yield`), KeywordReserved, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`mod\b`, Keyword, Push("modname")}, - {`let\b`, KeywordDeclaration, nil}, - {`fn\b`, Keyword, Push("funcname")}, - {`(struct|enum|type|union)\b`, Keyword, Push("typename")}, - {`(default)(\s+)(type|fn)\b`, ByGroups(Keyword, Text, Keyword), nil}, - {Words(``, `\b`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`, `usize`, `isize`, `f32`, `f64`, `str`, `bool`), KeywordType, nil}, - {`self\b`, NameBuiltinPseudo, nil}, - {Words(``, `\b`, `Copy`, `Send`, `Sized`, `Sync`, `Drop`, `Fn`, `FnMut`, `FnOnce`, `Box`, `ToOwned`, `Clone`, `PartialEq`, `PartialOrd`, `Eq`, `Ord`, `AsRef`, `AsMut`, `Into`, `From`, `Default`, `Iterator`, `Extend`, `IntoIterator`, `DoubleEndedIterator`, `ExactSizeIterator`, `Option`, `Some`, `None`, `Result`, `Ok`, `Err`, `SliceConcatExt`, `String`, `ToString`, `Vec`), NameBuiltin, nil}, - {`::\b`, Text, nil}, - {`(?::|->)`, Text, Push("typename")}, - {`(break|continue)(\s*)(\'[A-Za-z_]\w*)?`, ByGroups(Keyword, TextWhitespace, NameLabel), nil}, - {`'(\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0|\\u\{[0-9a-fA-F]{1,6}\}|.)'`, LiteralStringChar, nil}, - {`b'(\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\0|\\u\{[0-9a-fA-F]{1,6}\}|.)'`, LiteralStringChar, nil}, - {`0b[01_]+`, LiteralNumberBin, Push("number_lit")}, - {`0o[0-7_]+`, LiteralNumberOct, Push("number_lit")}, - {`0[xX][0-9a-fA-F_]+`, LiteralNumberHex, Push("number_lit")}, - {`[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|\.[0-9_]*(?!\.)|[eE][+\-]?[0-9_]+)`, LiteralNumberFloat, Push("number_lit")}, - {`[0-9][0-9_]*`, LiteralNumberInteger, Push("number_lit")}, - {`b"`, LiteralString, Push("bytestring")}, - {`b?r(#*)".*?"\1`, LiteralString, nil}, - {`'static`, NameBuiltin, nil}, - {`'[a-zA-Z_]\w*`, NameAttribute, nil}, - {`[{}()\[\],.;]`, Punctuation, nil}, - {`[+\-*/%&|<>^!~@=:?]`, Operator, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - {`#!?\[`, CommentPreproc, Push("attribute[")}, - {`([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)`, ByGroups(CommentPreproc, Punctuation, TextWhitespace, Name, TextWhitespace, Punctuation), Push("macro{")}, - {`([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\()`, ByGroups(CommentPreproc, Punctuation, TextWhitespace, Name, Punctuation), Push("macro(")}, - }, - "comment": { - {`[^*/]+`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "doccomment": { - {`[^*/]+`, LiteralStringDoc, nil}, - {`/\*`, LiteralStringDoc, Push()}, - {`\*/`, LiteralStringDoc, Pop(1)}, - {`[*/]`, LiteralStringDoc, nil}, - }, - "modname": { - {`\s+`, Text, nil}, - {`[a-zA-Z_]\w*`, NameNamespace, Pop(1)}, - Default(Pop(1)), - }, - "funcname": { - {`\s+`, Text, nil}, - {`[a-zA-Z_]\w*`, NameFunction, Pop(1)}, - Default(Pop(1)), - }, - "typename": { - {`\s+`, Text, nil}, - {`&`, KeywordPseudo, nil}, - {Words(``, `\b`, `Copy`, `Send`, `Sized`, `Sync`, `Drop`, `Fn`, `FnMut`, `FnOnce`, `Box`, `ToOwned`, `Clone`, `PartialEq`, `PartialOrd`, `Eq`, `Ord`, `AsRef`, `AsMut`, `Into`, `From`, `Default`, `Iterator`, `Extend`, `IntoIterator`, `DoubleEndedIterator`, `ExactSizeIterator`, `Option`, `Some`, `None`, `Result`, `Ok`, `Err`, `SliceConcatExt`, `String`, `ToString`, `Vec`), NameBuiltin, nil}, - {Words(``, `\b`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`, `usize`, `isize`, `f32`, `f64`, `str`, `bool`), KeywordType, nil}, - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - Default(Pop(1)), - }, - "number_lit": { - {`[ui](8|16|32|64|size)`, Keyword, Pop(1)}, - {`f(32|64)`, Keyword, Pop(1)}, - Default(Pop(1)), - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\['"\\nrt]|\\x[0-7][0-9a-fA-F]|\\0|\\u\{[0-9a-fA-F]{1,6}\}`, LiteralStringEscape, nil}, - {`[^\\"]+`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "bytestring": { - {`\\x[89a-fA-F][0-9a-fA-F]`, LiteralStringEscape, nil}, - Include("string"), - }, - "macro{": { - {`\{`, Operator, Push()}, - {`\}`, Operator, Pop(1)}, - }, - "macro(": { - {`\(`, Operator, Push()}, - {`\)`, Operator, Pop(1)}, - }, - "attribute_common": { - {`"`, LiteralString, Push("string")}, - {`\[`, CommentPreproc, Push("attribute[")}, - {`\(`, CommentPreproc, Push("attribute(")}, - }, - "attribute[": { - Include("attribute_common"), - {`\];?`, CommentPreproc, Pop(1)}, - {`[^"\]]+`, CommentPreproc, nil}, - }, - "attribute(": { - Include("attribute_common"), - {`\);?`, CommentPreproc, Pop(1)}, - {`[^")]+`, CommentPreproc, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/sass.go b/vendor/github.com/alecthomas/chroma/lexers/s/sass.go deleted file mode 100644 index 6200f6a3..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/sass.go +++ /dev/null @@ -1,144 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Sass lexer. -var Sass = internal.Register(MustNewLexer( - &Config{ - Name: "Sass", - Aliases: []string{"sass"}, - Filenames: []string{"*.sass"}, - MimeTypes: []string{"text/x-sass"}, - CaseInsensitive: true, - }, - Rules{ - // "root": { - // }, - "root": { - {`[ \t]*\n`, Text, nil}, - // { `[ \t]*`, ?? ??, nil }, - // { `//[^\n]*`, ?? .callback at 0x106936048> ??, Push("root") }, - // { `/\*[^\n]*`, ?? .callback at 0x1069360d0> ??, Push("root") }, - {`@import`, Keyword, Push("import")}, - {`@for`, Keyword, Push("for")}, - {`@(debug|warn|if|while)`, Keyword, Push("value")}, - {`(@mixin)( [\w-]+)`, ByGroups(Keyword, NameFunction), Push("value")}, - {`(@include)( [\w-]+)`, ByGroups(Keyword, NameDecorator), Push("value")}, - {`@extend`, Keyword, Push("selector")}, - {`@[\w-]+`, Keyword, Push("selector")}, - {`=[\w-]+`, NameFunction, Push("value")}, - {`\+[\w-]+`, NameDecorator, Push("value")}, - {`([!$][\w-]\w*)([ \t]*(?:(?:\|\|)?=|:))`, ByGroups(NameVariable, Operator), Push("value")}, - {`:`, NameAttribute, Push("old-style-attr")}, - {`(?=.+?[=:]([^a-z]|$))`, NameAttribute, Push("new-style-attr")}, - Default(Push("selector")), - }, - "single-comment": { - {`.+`, CommentSingle, nil}, - {`\n`, Text, Push("root")}, - }, - "multi-comment": { - {`.+`, CommentMultiline, nil}, - {`\n`, Text, Push("root")}, - }, - "import": { - {`[ \t]+`, Text, nil}, - {`\S+`, LiteralString, nil}, - {`\n`, Text, Push("root")}, - }, - "old-style-attr": { - {`[^\s:="\[]+`, NameAttribute, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`[ \t]*=`, Operator, Push("value")}, - Default(Push("value")), - }, - "new-style-attr": { - {`[^\s:="\[]+`, NameAttribute, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`[ \t]*[=:]`, Operator, Push("value")}, - }, - "inline-comment": { - {`(\\#|#(?=[^\n{])|\*(?=[^\n/])|[^\n#*])+`, CommentMultiline, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`\*/`, Comment, Pop(1)}, - }, - "value": { - {`[ \t]+`, Text, nil}, - {`[!$][\w-]+`, NameVariable, nil}, - {`url\(`, LiteralStringOther, Push("string-url")}, - {`[a-z_-][\w-]*(?=\()`, NameFunction, nil}, - {Words(``, `\b`, `align-content`, `align-items`, `align-self`, `alignment-baseline`, `all`, `animation`, `animation-delay`, `animation-direction`, `animation-duration`, `animation-fill-mode`, `animation-iteration-count`, `animation-name`, `animation-play-state`, `animation-timing-function`, `appearance`, `azimuth`, `backface-visibility`, `background`, `background-attachment`, `background-blend-mode`, `background-clip`, `background-color`, `background-image`, `background-origin`, `background-position`, `background-repeat`, `background-size`, `baseline-shift`, `bookmark-label`, `bookmark-level`, `bookmark-state`, `border`, `border-bottom`, `border-bottom-color`, `border-bottom-left-radius`, `border-bottom-right-radius`, `border-bottom-style`, `border-bottom-width`, `border-boundary`, `border-collapse`, `border-color`, `border-image`, `border-image-outset`, `border-image-repeat`, `border-image-slice`, `border-image-source`, `border-image-width`, `border-left`, `border-left-color`, `border-left-style`, `border-left-width`, `border-radius`, `border-right`, `border-right-color`, `border-right-style`, `border-right-width`, `border-spacing`, `border-style`, `border-top`, `border-top-color`, `border-top-left-radius`, `border-top-right-radius`, `border-top-style`, `border-top-width`, `border-width`, `bottom`, `box-decoration-break`, `box-shadow`, `box-sizing`, `box-snap`, `box-suppress`, `break-after`, `break-before`, `break-inside`, `caption-side`, `caret`, `caret-animation`, `caret-color`, `caret-shape`, `chains`, `clear`, `clip`, `clip-path`, `clip-rule`, `color`, `color-interpolation-filters`, `column-count`, `column-fill`, `column-gap`, `column-rule`, `column-rule-color`, `column-rule-style`, `column-rule-width`, `column-span`, `column-width`, `columns`, `content`, `counter-increment`, `counter-reset`, `counter-set`, `crop`, `cue`, `cue-after`, `cue-before`, `cursor`, `direction`, `display`, `dominant-baseline`, `elevation`, `empty-cells`, `filter`, `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `float`, `float-defer`, `float-offset`, `float-reference`, `flood-color`, `flood-opacity`, `flow`, `flow-from`, `flow-into`, `font`, `font-family`, `font-feature-settings`, `font-kerning`, `font-language-override`, `font-size`, `font-size-adjust`, `font-stretch`, `font-style`, `font-synthesis`, `font-variant`, `font-variant-alternates`, `font-variant-caps`, `font-variant-east-asian`, `font-variant-ligatures`, `font-variant-numeric`, `font-variant-position`, `font-weight`, `footnote-display`, `footnote-policy`, `glyph-orientation-vertical`, `grid`, `grid-area`, `grid-auto-columns`, `grid-auto-flow`, `grid-auto-rows`, `grid-column`, `grid-column-end`, `grid-column-gap`, `grid-column-start`, `grid-gap`, `grid-row`, `grid-row-end`, `grid-row-gap`, `grid-row-start`, `grid-template`, `grid-template-areas`, `grid-template-columns`, `grid-template-rows`, `hanging-punctuation`, `height`, `hyphenate-character`, `hyphenate-limit-chars`, `hyphenate-limit-last`, `hyphenate-limit-lines`, `hyphenate-limit-zone`, `hyphens`, `image-orientation`, `image-resolution`, `initial-letter`, `initial-letter-align`, `initial-letter-wrap`, `isolation`, `justify-content`, `justify-items`, `justify-self`, `left`, `letter-spacing`, `lighting-color`, `line-break`, `line-grid`, `line-height`, `line-snap`, `list-style`, `list-style-image`, `list-style-position`, `list-style-type`, `margin`, `margin-bottom`, `margin-left`, `margin-right`, `margin-top`, `marker-side`, `marquee-direction`, `marquee-loop`, `marquee-speed`, `marquee-style`, `mask`, `mask-border`, `mask-border-mode`, `mask-border-outset`, `mask-border-repeat`, `mask-border-slice`, `mask-border-source`, `mask-border-width`, `mask-clip`, `mask-composite`, `mask-image`, `mask-mode`, `mask-origin`, `mask-position`, `mask-repeat`, `mask-size`, `mask-type`, `max-height`, `max-lines`, `max-width`, `min-height`, `min-width`, `mix-blend-mode`, `motion`, `motion-offset`, `motion-path`, `motion-rotation`, `move-to`, `nav-down`, `nav-left`, `nav-right`, `nav-up`, `object-fit`, `object-position`, `offset-after`, `offset-before`, `offset-end`, `offset-start`, `opacity`, `order`, `orphans`, `outline`, `outline-color`, `outline-offset`, `outline-style`, `outline-width`, `overflow`, `overflow-style`, `overflow-wrap`, `overflow-x`, `overflow-y`, `padding`, `padding-bottom`, `padding-left`, `padding-right`, `padding-top`, `page`, `page-break-after`, `page-break-before`, `page-break-inside`, `page-policy`, `pause`, `pause-after`, `pause-before`, `perspective`, `perspective-origin`, `pitch`, `pitch-range`, `play-during`, `polar-angle`, `polar-distance`, `position`, `presentation-level`, `quotes`, `region-fragment`, `resize`, `rest`, `rest-after`, `rest-before`, `richness`, `right`, `rotation`, `rotation-point`, `ruby-align`, `ruby-merge`, `ruby-position`, `running`, `scroll-snap-coordinate`, `scroll-snap-destination`, `scroll-snap-points-x`, `scroll-snap-points-y`, `scroll-snap-type`, `shape-image-threshold`, `shape-inside`, `shape-margin`, `shape-outside`, `size`, `speak`, `speak-as`, `speak-header`, `speak-numeral`, `speak-punctuation`, `speech-rate`, `stress`, `string-set`, `tab-size`, `table-layout`, `text-align`, `text-align-last`, `text-combine-upright`, `text-decoration`, `text-decoration-color`, `text-decoration-line`, `text-decoration-skip`, `text-decoration-style`, `text-emphasis`, `text-emphasis-color`, `text-emphasis-position`, `text-emphasis-style`, `text-indent`, `text-justify`, `text-orientation`, `text-overflow`, `text-shadow`, `text-space-collapse`, `text-space-trim`, `text-spacing`, `text-transform`, `text-underline-position`, `text-wrap`, `top`, `transform`, `transform-origin`, `transform-style`, `transition`, `transition-delay`, `transition-duration`, `transition-property`, `transition-timing-function`, `unicode-bidi`, `user-select`, `vertical-align`, `visibility`, `voice-balance`, `voice-duration`, `voice-family`, `voice-pitch`, `voice-range`, `voice-rate`, `voice-stress`, `voice-volume`, `volume`, `white-space`, `widows`, `width`, `will-change`, `word-break`, `word-spacing`, `word-wrap`, `wrap-after`, `wrap-before`, `wrap-flow`, `wrap-inside`, `wrap-through`, `writing-mode`, `z-index`, `above`, `absolute`, `always`, `armenian`, `aural`, `auto`, `avoid`, `baseline`, `behind`, `below`, `bidi-override`, `blink`, `block`, `bold`, `bolder`, `both`, `capitalize`, `center-left`, `center-right`, `center`, `circle`, `cjk-ideographic`, `close-quote`, `collapse`, `condensed`, `continuous`, `crop`, `crosshair`, `cross`, `cursive`, `dashed`, `decimal-leading-zero`, `decimal`, `default`, `digits`, `disc`, `dotted`, `double`, `e-resize`, `embed`, `extra-condensed`, `extra-expanded`, `expanded`, `fantasy`, `far-left`, `far-right`, `faster`, `fast`, `fixed`, `georgian`, `groove`, `hebrew`, `help`, `hidden`, `hide`, `higher`, `high`, `hiragana-iroha`, `hiragana`, `icon`, `inherit`, `inline-table`, `inline`, `inset`, `inside`, `invert`, `italic`, `justify`, `katakana-iroha`, `katakana`, `landscape`, `larger`, `large`, `left-side`, `leftwards`, `level`, `lighter`, `line-through`, `list-item`, `loud`, `lower-alpha`, `lower-greek`, `lower-roman`, `lowercase`, `ltr`, `lower`, `low`, `medium`, `message-box`, `middle`, `mix`, `monospace`, `n-resize`, `narrower`, `ne-resize`, `no-close-quote`, `no-open-quote`, `no-repeat`, `none`, `normal`, `nowrap`, `nw-resize`, `oblique`, `once`, `open-quote`, `outset`, `outside`, `overline`, `pointer`, `portrait`, `px`, `relative`, `repeat-x`, `repeat-y`, `repeat`, `rgb`, `ridge`, `right-side`, `rightwards`, `s-resize`, `sans-serif`, `scroll`, `se-resize`, `semi-condensed`, `semi-expanded`, `separate`, `serif`, `show`, `silent`, `slow`, `slower`, `small-caps`, `small-caption`, `smaller`, `soft`, `solid`, `spell-out`, `square`, `static`, `status-bar`, `super`, `sw-resize`, `table-caption`, `table-cell`, `table-column`, `table-column-group`, `table-footer-group`, `table-header-group`, `table-row`, `table-row-group`, `text`, `text-bottom`, `text-top`, `thick`, `thin`, `transparent`, `ultra-condensed`, `ultra-expanded`, `underline`, `upper-alpha`, `upper-latin`, `upper-roman`, `uppercase`, `url`, `visible`, `w-resize`, `wait`, `wider`, `x-fast`, `x-high`, `x-large`, `x-loud`, `x-low`, `x-small`, `x-soft`, `xx-large`, `xx-small`, `yes`), NameConstant, nil}, - {Words(``, `\b`, `aliceblue`, `antiquewhite`, `aqua`, `aquamarine`, `azure`, `beige`, `bisque`, `black`, `blanchedalmond`, `blue`, `blueviolet`, `brown`, `burlywood`, `cadetblue`, `chartreuse`, `chocolate`, `coral`, `cornflowerblue`, `cornsilk`, `crimson`, `cyan`, `darkblue`, `darkcyan`, `darkgoldenrod`, `darkgray`, `darkgreen`, `darkgrey`, `darkkhaki`, `darkmagenta`, `darkolivegreen`, `darkorange`, `darkorchid`, `darkred`, `darksalmon`, `darkseagreen`, `darkslateblue`, `darkslategray`, `darkslategrey`, `darkturquoise`, `darkviolet`, `deeppink`, `deepskyblue`, `dimgray`, `dimgrey`, `dodgerblue`, `firebrick`, `floralwhite`, `forestgreen`, `fuchsia`, `gainsboro`, `ghostwhite`, `gold`, `goldenrod`, `gray`, `green`, `greenyellow`, `grey`, `honeydew`, `hotpink`, `indianred`, `indigo`, `ivory`, `khaki`, `lavender`, `lavenderblush`, `lawngreen`, `lemonchiffon`, `lightblue`, `lightcoral`, `lightcyan`, `lightgoldenrodyellow`, `lightgray`, `lightgreen`, `lightgrey`, `lightpink`, `lightsalmon`, `lightseagreen`, `lightskyblue`, `lightslategray`, `lightslategrey`, `lightsteelblue`, `lightyellow`, `lime`, `limegreen`, `linen`, `magenta`, `maroon`, `mediumaquamarine`, `mediumblue`, `mediumorchid`, `mediumpurple`, `mediumseagreen`, `mediumslateblue`, `mediumspringgreen`, `mediumturquoise`, `mediumvioletred`, `midnightblue`, `mintcream`, `mistyrose`, `moccasin`, `navajowhite`, `navy`, `oldlace`, `olive`, `olivedrab`, `orange`, `orangered`, `orchid`, `palegoldenrod`, `palegreen`, `paleturquoise`, `palevioletred`, `papayawhip`, `peachpuff`, `peru`, `pink`, `plum`, `powderblue`, `purple`, `rebeccapurple`, `red`, `rosybrown`, `royalblue`, `saddlebrown`, `salmon`, `sandybrown`, `seagreen`, `seashell`, `sienna`, `silver`, `skyblue`, `slateblue`, `slategray`, `slategrey`, `snow`, `springgreen`, `steelblue`, `tan`, `teal`, `thistle`, `tomato`, `turquoise`, `violet`, `wheat`, `white`, `whitesmoke`, `yellow`, `yellowgreen`, `transparent`), NameEntity, nil}, - {Words(``, `\b`, `black`, `silver`, `gray`, `white`, `maroon`, `red`, `purple`, `fuchsia`, `green`, `lime`, `olive`, `yellow`, `navy`, `blue`, `teal`, `aqua`), NameBuiltin, nil}, - {`\!(important|default)`, NameException, nil}, - {`(true|false)`, NamePseudo, nil}, - {`(and|or|not)`, OperatorWord, nil}, - {`/\*`, CommentMultiline, Push("inline-comment")}, - {`//[^\n]*`, CommentSingle, nil}, - {`\#[a-z0-9]{1,6}`, LiteralNumberHex, nil}, - {`(-?\d+)(\%|[a-z]+)?`, ByGroups(LiteralNumberInteger, KeywordType), nil}, - {`(-?\d*\.\d+)(\%|[a-z]+)?`, ByGroups(LiteralNumberFloat, KeywordType), nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`[~^*!&%<>|+=@:,./?-]+`, Operator, nil}, - {`[\[\]()]+`, Punctuation, nil}, - {`"`, LiteralStringDouble, Push("string-double")}, - {`'`, LiteralStringSingle, Push("string-single")}, - {`[a-z_-][\w-]*`, Name, nil}, - {`\n`, Text, Push("root")}, - }, - "interpolation": { - {`\}`, LiteralStringInterpol, Pop(1)}, - Include("value"), - }, - "selector": { - {`[ \t]+`, Text, nil}, - {`\:`, NameDecorator, Push("pseudo-class")}, - {`\.`, NameClass, Push("class")}, - {`\#`, NameNamespace, Push("id")}, - {`[\w-]+`, NameTag, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`&`, Keyword, nil}, - {`[~^*!&\[\]()<>|+=@:;,./?-]`, Operator, nil}, - {`"`, LiteralStringDouble, Push("string-double")}, - {`'`, LiteralStringSingle, Push("string-single")}, - {`\n`, Text, Push("root")}, - }, - "string-double": { - {`(\\.|#(?=[^\n{])|[^\n"#])+`, LiteralStringDouble, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "string-single": { - {`(\\.|#(?=[^\n{])|[^\n'#])+`, LiteralStringSingle, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "string-url": { - {`(\\#|#(?=[^\n{])|[^\n#)])+`, LiteralStringOther, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`\)`, LiteralStringOther, Pop(1)}, - }, - "pseudo-class": { - {`[\w-]+`, NameDecorator, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "class": { - {`[\w-]+`, NameClass, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "id": { - {`[\w-]+`, NameNamespace, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "for": { - {`(from|to|through)`, OperatorWord, nil}, - Include("value"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/scala.go b/vendor/github.com/alecthomas/chroma/lexers/s/scala.go deleted file mode 100644 index 20932de2..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/scala.go +++ /dev/null @@ -1,112 +0,0 @@ -package s - -import ( - "fmt" - - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var ( - scalaOp = "[-~\\^\\*!%&\\\\<>\\|+=:/?@\xa6-\xa7\xa9\xac\xae\xb0-\xb1\xb6\xd7\xf7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+" - scalaUpper = "[A-Z\\$_\xc0-\xd6\xd8-\xde\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]" - scalaLetter = `[a-zA-Z\\$_ªµºÀ-ÖØ-öø-ʯͰ-ͳͶ-ͷͻ-ͽΆΈ-ϵϷ-ҁҊ-Ֆա-ևא-ײء-ؿف-يٮ-ٯٱ-ۓەۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪऄ-हऽॐक़-ॡॲ-ॿঅ-হঽৎড়-ৡৰ-ৱਅ-ਹਖ਼-ਫ਼ੲ-ੴઅ-હઽૐ-ૡଅ-ହଽଡ଼-ୡୱஃ-ஹௐఅ-ఽౘ-ౡಅ-ಹಽೞ-ೡഅ-ഽൠ-ൡൺ-ൿඅ-ෆก-ะา-ำเ-ๅກ-ະາ-ຳຽ-ໄໜ-ༀཀ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-ჺᄀ-ፚᎀ-ᎏᎠ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᛮ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝰក-ឳៜᠠ-ᡂᡄ-ᢨᢪ-ᤜᥐ-ᦩᧁ-ᧇᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᰀ-ᰣᱍ-ᱏᱚ-ᱷᴀ-ᴫᵢ-ᵷᵹ-ᶚḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⱼⲀ-ⳤⴀ-ⵥⶀ-ⷞ〆-〇〡-〩〸-〺〼ぁ-ゖゟァ-ヺヿ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-ꀔꀖ-ꒌꔀ-ꘋꘐ-ꘟꘪ-ꙮꚀ-ꚗꜢ-ꝯꝱ-ꞇꞋ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꤊ-ꤥꤰ-ꥆꨀ-ꨨꩀ-ꩂꩄ-ꩋ가-힣豈-יִײַ-ﬨשׁ-ﴽﵐ-ﷻﹰ-ﻼA-Za-zヲ-ッア-ンᅠ-ᅵ]` - scalaIDRest = fmt.Sprintf(`%s(?:%s|[0-9])*(?:(?<=_)%s)?`, scalaLetter, scalaLetter, scalaOp) -) - -// Scala lexer. -var Scala = internal.Register(MustNewLexer( - &Config{ - Name: "Scala", - Aliases: []string{"scala"}, - Filenames: []string{"*.scala"}, - MimeTypes: []string{"text/x-scala"}, - DotAll: true, - }, - Rules{ - "root": { - {`(class|trait|object)(\s+)`, ByGroups(Keyword, Text), Push("class")}, - {`[^\S\n]+`, Text, nil}, - {`//.*?\n`, CommentSingle, nil}, - {`/\*`, CommentMultiline, Push("comment")}, - {`@` + scalaIDRest, NameDecorator, nil}, - {`(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|lazy|match|new|override|pr(?:ivate|otected)|re(?:quires|turn)|s(?:ealed|uper)|t(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\b|(<[%:-]|=>|>:|[#=@_⇒←])(\b|(?=\s)|$)`, Keyword, nil}, - {`:(?!` + scalaOp + `%s)`, Keyword, Push("type")}, - {fmt.Sprintf("%s%s\\b", scalaUpper, scalaIDRest), NameClass, nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`(import|package)(\s+)`, ByGroups(Keyword, Text), Push("import")}, - {`(type)(\s+)`, ByGroups(Keyword, Text), Push("type")}, - {`""".*?"""(?!")`, LiteralString, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'`, LiteralStringChar, nil}, - {"'" + scalaIDRest, TextSymbol, nil}, - {`[fs]"""`, LiteralString, Push("interptriplestring")}, - {`[fs]"`, LiteralString, Push("interpstring")}, - {`raw"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {scalaIDRest, Name, nil}, - {"`[^`]+`", Name, nil}, - {`\[`, Operator, Push("typeparam")}, - {`[(){};,.#]`, Operator, nil}, - {scalaOp, Operator, nil}, - {`([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?`, LiteralNumberFloat, nil}, - {`0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+L?`, LiteralNumberInteger, nil}, - {`\n`, Text, nil}, - }, - "class": { - {fmt.Sprintf("(%s|%s|`[^`]+`)(\\s*)(\\[)", scalaIDRest, scalaOp), ByGroups(NameClass, Text, Operator), Push("typeparam")}, - {`\s+`, Text, nil}, - {`\{`, Operator, Pop(1)}, - {`\(`, Operator, Pop(1)}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {fmt.Sprintf("%s|%s|`[^`]+`", scalaIDRest, scalaOp), NameClass, Pop(1)}, - }, - "type": { - {`\s+`, Text, nil}, - {`<[%:]|>:|[#_]|forSome|type`, Keyword, nil}, - {`([,);}]|=>|=|⇒)(\s*)`, ByGroups(Operator, Text), Pop(1)}, - {`[({]`, Operator, Push()}, - {fmt.Sprintf("((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)", scalaIDRest, scalaOp, scalaIDRest, scalaOp), ByGroups(KeywordType, Text, Operator), Push("#pop", "typeparam")}, - {fmt.Sprintf("((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$", scalaIDRest, scalaOp, scalaIDRest, scalaOp), ByGroups(KeywordType, Text), Pop(1)}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {fmt.Sprintf("\\.|%s|%s|`[^`]+`", scalaIDRest, scalaOp), KeywordType, nil}, - }, - "typeparam": { - {`[\s,]+`, Text, nil}, - {`<[%:]|=>|>:|[#_⇒]|forSome|type`, Keyword, nil}, - {`([\])}])`, Operator, Pop(1)}, - {`[(\[{]`, Operator, Push()}, - {fmt.Sprintf("\\.|%s|%s|`[^`]+`", scalaIDRest, scalaOp), KeywordType, nil}, - }, - "comment": { - {`[^/*]+`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "import": { - {fmt.Sprintf("(%s|\\.)+", scalaIDRest), NameNamespace, Pop(1)}, - }, - "interpstringcommon": { - {`[^"$\\]+`, LiteralString, nil}, - {`\$\$`, LiteralString, nil}, - {`\$` + scalaLetter + `(?:` + scalaLetter + `|\d)*`, LiteralStringInterpol, nil}, - {`\$\{`, LiteralStringInterpol, Push("interpbrace")}, - {`\\.`, LiteralString, nil}, - }, - "interptriplestring": { - {`"""(?!")`, LiteralString, Pop(1)}, - {`"`, LiteralString, nil}, - Include("interpstringcommon"), - }, - "interpstring": { - {`"`, LiteralString, Pop(1)}, - Include("interpstringcommon"), - }, - "interpbrace": { - {`\}`, LiteralStringInterpol, Pop(1)}, - {`\{`, LiteralStringInterpol, Push()}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go b/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go deleted file mode 100644 index b721d68d..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go +++ /dev/null @@ -1,53 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// nolint - -// Scheme lexer. -var SchemeLang = internal.Register(MustNewLexer( - &Config{ - Name: "Scheme", - Aliases: []string{"scheme", "scm"}, - Filenames: []string{"*.scm", "*.ss"}, - MimeTypes: []string{"text/x-scheme", "application/x-scheme"}, - }, - Rules{ - "root": { - {`;.*$`, CommentSingle, nil}, - {`#\|`, CommentMultiline, Push("multiline-comment")}, - {`#;\s*\(`, Comment, Push("commented-form")}, - {`#!r6rs`, Comment, nil}, - {`\s+`, Text, nil}, - {`-?\d+\.\d+`, LiteralNumberFloat, nil}, - {`-?\d+`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`'[\w!$%&*+,/:<=>?@^~|-]+`, LiteralStringSymbol, nil}, - {`#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)`, LiteralStringChar, nil}, - {`(#t|#f)`, NameConstant, nil}, - {"('|#|`|,@|,|\\.)", Operator, nil}, - {`(lambda |define |if |else |cond |and |or |case |let |let\* |letrec |begin |do |delay |set\! |\=\> |quote |quasiquote |unquote |unquote\-splicing |define\-syntax |let\-syntax |letrec\-syntax |syntax\-rules )`, Keyword, nil}, - {`(?<='\()[\w!$%&*+,/:<=>?@^~|-]+`, NameVariable, nil}, - {`(?<=#\()[\w!$%&*+,/:<=>?@^~|-]+`, NameVariable, nil}, - {`(?<=\()(\* |\+ |\- |\/ |\< |\<\= |\= |\> |\>\= |abs |acos |angle |append |apply |asin |assoc |assq |assv |atan |boolean\? |caaaar |caaadr |caaar |caadar |caaddr |caadr |caar |cadaar |cadadr |cadar |caddar |cadddr |caddr |cadr |call\-with\-current\-continuation |call\-with\-input\-file |call\-with\-output\-file |call\-with\-values |call\/cc |car |cdaaar |cdaadr |cdaar |cdadar |cdaddr |cdadr |cdar |cddaar |cddadr |cddar |cdddar |cddddr |cdddr |cddr |cdr |ceiling |char\-\>integer |char\-alphabetic\? |char\-ci\<\=\? |char\-ci\<\? |char\-ci\=\? |char\-ci\>\=\? |char\-ci\>\? |char\-downcase |char\-lower\-case\? |char\-numeric\? |char\-ready\? |char\-upcase |char\-upper\-case\? |char\-whitespace\? |char\<\=\? |char\<\? |char\=\? |char\>\=\? |char\>\? |char\? |close\-input\-port |close\-output\-port |complex\? |cons |cos |current\-input\-port |current\-output\-port |denominator |display |dynamic\-wind |eof\-object\? |eq\? |equal\? |eqv\? |eval |even\? |exact\-\>inexact |exact\? |exp |expt |floor |for\-each |force |gcd |imag\-part |inexact\-\>exact |inexact\? |input\-port\? |integer\-\>char |integer\? |interaction\-environment |lcm |length |list |list\-\>string |list\-\>vector |list\-ref |list\-tail |list\? |load |log |magnitude |make\-polar |make\-rectangular |make\-string |make\-vector |map |max |member |memq |memv |min |modulo |negative\? |newline |not |null\-environment |null\? |number\-\>string |number\? |numerator |odd\? |open\-input\-file |open\-output\-file |output\-port\? |pair\? |peek\-char |port\? |positive\? |procedure\? |quotient |rational\? |rationalize |read |read\-char |real\-part |real\? |remainder |reverse |round |scheme\-report\-environment |set\-car\! |set\-cdr\! |sin |sqrt |string |string\-\>list |string\-\>number |string\-\>symbol |string\-append |string\-ci\<\=\? |string\-ci\<\? |string\-ci\=\? |string\-ci\>\=\? |string\-ci\>\? |string\-copy |string\-fill\! |string\-length |string\-ref |string\-set\! |string\<\=\? |string\<\? |string\=\? |string\>\=\? |string\>\? |string\? |substring |symbol\-\>string |symbol\? |tan |transcript\-off |transcript\-on |truncate |values |vector |vector\-\>list |vector\-fill\! |vector\-length |vector\-ref |vector\-set\! |vector\? |with\-input\-from\-file |with\-output\-to\-file |write |write\-char |zero\? )`, NameBuiltin, nil}, - {`(?<=\()[\w!$%&*+,/:<=>?@^~|-]+`, NameFunction, nil}, - {`[\w!$%&*+,/:<=>?@^~|-]+`, NameVariable, nil}, - {`(\(|\))`, Punctuation, nil}, - {`(\[|\])`, Punctuation, nil}, - }, - "multiline-comment": { - {`#\|`, CommentMultiline, Push()}, - {`\|#`, CommentMultiline, Pop(1)}, - {`[^|#]+`, CommentMultiline, nil}, - {`[|#]`, CommentMultiline, nil}, - }, - "commented-form": { - {`\(`, Comment, Push()}, - {`\)`, Comment, Pop(1)}, - {`[^()]+`, Comment, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/scilab.go b/vendor/github.com/alecthomas/chroma/lexers/s/scilab.go deleted file mode 100644 index 87fa66cc..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/scilab.go +++ /dev/null @@ -1,44 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Scilab lexer. -var Scilab = internal.Register(MustNewLexer( - &Config{ - Name: "Scilab", - Aliases: []string{"scilab"}, - Filenames: []string{"*.sci", "*.sce", "*.tst"}, - MimeTypes: []string{"text/scilab"}, - }, - Rules{ - "root": { - {`//.*?$`, CommentSingle, nil}, - {`^\s*function`, Keyword, Push("deffunc")}, - {Words(``, `\b`, `__FILE__`, `__LINE__`, `break`, `case`, `catch`, `classdef`, `continue`, `do`, `else`, `elseif`, `end`, `end_try_catch`, `end_unwind_protect`, `endclassdef`, `endevents`, `endfor`, `endfunction`, `endif`, `endmethods`, `endproperties`, `endswitch`, `endwhile`, `events`, `for`, `function`, `get`, `global`, `if`, `methods`, `otherwise`, `persistent`, `properties`, `return`, `set`, `static`, `switch`, `try`, `until`, `unwind_protect`, `unwind_protect_cleanup`, `while`), Keyword, nil}, - {Words(``, `\b`, `!!_invoke_`, `%H5Object_e`, `%H5Object_fieldnames`, `%H5Object_p`, `%XMLAttr_6`, `%XMLAttr_e`, `%XMLAttr_i_XMLElem`, `%XMLAttr_length`, `%XMLAttr_p`, `%XMLAttr_size`, `%XMLDoc_6`, `%XMLDoc_e`, `%XMLDoc_i_XMLList`, `%XMLDoc_p`, `%XMLElem_6`, `%XMLElem_e`, `%XMLElem_i_XMLDoc`, `%XMLElem_i_XMLElem`, `%XMLElem_i_XMLList`, `%XMLElem_p`, `%XMLList_6`, `%XMLList_e`, `%XMLList_i_XMLElem`, `%XMLList_i_XMLList`, `%XMLList_length`, `%XMLList_p`, `%XMLList_size`, `%XMLNs_6`, `%XMLNs_e`, `%XMLNs_i_XMLElem`, `%XMLNs_p`, `%XMLSet_6`, `%XMLSet_e`, `%XMLSet_length`, `%XMLSet_p`, `%XMLSet_size`, `%XMLValid_p`, `%_EClass_6`, `%_EClass_e`, `%_EClass_p`, `%_EObj_0`, `%_EObj_1__EObj`, `%_EObj_1_b`, `%_EObj_1_c`, `%_EObj_1_i`, `%_EObj_1_s`, `%_EObj_2__EObj`, `%_EObj_2_b`, `%_EObj_2_c`, `%_EObj_2_i`, `%_EObj_2_s`, `%_EObj_3__EObj`, `%_EObj_3_b`, `%_EObj_3_c`, `%_EObj_3_i`, `%_EObj_3_s`, `%_EObj_4__EObj`, `%_EObj_4_b`, `%_EObj_4_c`, `%_EObj_4_i`, `%_EObj_4_s`, `%_EObj_5`, `%_EObj_6`, `%_EObj_a__EObj`, `%_EObj_a_b`, `%_EObj_a_c`, `%_EObj_a_i`, `%_EObj_a_s`, `%_EObj_d__EObj`, `%_EObj_d_b`, `%_EObj_d_c`, `%_EObj_d_i`, `%_EObj_d_s`, `%_EObj_disp`, `%_EObj_e`, `%_EObj_g__EObj`, `%_EObj_g_b`, `%_EObj_g_c`, `%_EObj_g_i`, `%_EObj_g_s`, `%_EObj_h__EObj`, `%_EObj_h_b`, `%_EObj_h_c`, `%_EObj_h_i`, `%_EObj_h_s`, `%_EObj_i__EObj`, `%_EObj_j__EObj`, `%_EObj_j_b`, `%_EObj_j_c`, `%_EObj_j_i`, `%_EObj_j_s`, `%_EObj_k__EObj`, `%_EObj_k_b`, `%_EObj_k_c`, `%_EObj_k_i`, `%_EObj_k_s`, `%_EObj_l__EObj`, `%_EObj_l_b`, `%_EObj_l_c`, `%_EObj_l_i`, `%_EObj_l_s`, `%_EObj_m__EObj`, `%_EObj_m_b`, `%_EObj_m_c`, `%_EObj_m_i`, `%_EObj_m_s`, `%_EObj_n__EObj`, `%_EObj_n_b`, `%_EObj_n_c`, `%_EObj_n_i`, `%_EObj_n_s`, `%_EObj_o__EObj`, `%_EObj_o_b`, `%_EObj_o_c`, `%_EObj_o_i`, `%_EObj_o_s`, `%_EObj_p`, `%_EObj_p__EObj`, `%_EObj_p_b`, `%_EObj_p_c`, `%_EObj_p_i`, `%_EObj_p_s`, `%_EObj_q__EObj`, `%_EObj_q_b`, `%_EObj_q_c`, `%_EObj_q_i`, `%_EObj_q_s`, `%_EObj_r__EObj`, `%_EObj_r_b`, `%_EObj_r_c`, `%_EObj_r_i`, `%_EObj_r_s`, `%_EObj_s__EObj`, `%_EObj_s_b`, `%_EObj_s_c`, `%_EObj_s_i`, `%_EObj_s_s`, `%_EObj_t`, `%_EObj_x__EObj`, `%_EObj_x_b`, `%_EObj_x_c`, `%_EObj_x_i`, `%_EObj_x_s`, `%_EObj_y__EObj`, `%_EObj_y_b`, `%_EObj_y_c`, `%_EObj_y_i`, `%_EObj_y_s`, `%_EObj_z__EObj`, `%_EObj_z_b`, `%_EObj_z_c`, `%_EObj_z_i`, `%_EObj_z_s`, `%_eigs`, `%_load`, `%b_1__EObj`, `%b_2__EObj`, `%b_3__EObj`, `%b_4__EObj`, `%b_a__EObj`, `%b_d__EObj`, `%b_g__EObj`, `%b_h__EObj`, `%b_i_XMLList`, `%b_i__EObj`, `%b_j__EObj`, `%b_k__EObj`, `%b_l__EObj`, `%b_m__EObj`, `%b_n__EObj`, `%b_o__EObj`, `%b_p__EObj`, `%b_q__EObj`, `%b_r__EObj`, `%b_s__EObj`, `%b_x__EObj`, `%b_y__EObj`, `%b_z__EObj`, `%c_1__EObj`, `%c_2__EObj`, `%c_3__EObj`, `%c_4__EObj`, `%c_a__EObj`, `%c_d__EObj`, `%c_g__EObj`, `%c_h__EObj`, `%c_i_XMLAttr`, `%c_i_XMLDoc`, `%c_i_XMLElem`, `%c_i_XMLList`, `%c_i__EObj`, `%c_j__EObj`, `%c_k__EObj`, `%c_l__EObj`, `%c_m__EObj`, `%c_n__EObj`, `%c_o__EObj`, `%c_p__EObj`, `%c_q__EObj`, `%c_r__EObj`, `%c_s__EObj`, `%c_x__EObj`, `%c_y__EObj`, `%c_z__EObj`, `%ce_i_XMLList`, `%fptr_i_XMLList`, `%h_i_XMLList`, `%hm_i_XMLList`, `%i_1__EObj`, `%i_2__EObj`, `%i_3__EObj`, `%i_4__EObj`, `%i_a__EObj`, `%i_abs`, `%i_cumprod`, `%i_cumsum`, `%i_d__EObj`, `%i_diag`, `%i_g__EObj`, `%i_h__EObj`, `%i_i_XMLList`, `%i_i__EObj`, `%i_j__EObj`, `%i_k__EObj`, `%i_l__EObj`, `%i_m__EObj`, `%i_matrix`, `%i_max`, `%i_maxi`, `%i_min`, `%i_mini`, `%i_mput`, `%i_n__EObj`, `%i_o__EObj`, `%i_p`, `%i_p__EObj`, `%i_prod`, `%i_q__EObj`, `%i_r__EObj`, `%i_s__EObj`, `%i_sum`, `%i_tril`, `%i_triu`, `%i_x__EObj`, `%i_y__EObj`, `%i_z__EObj`, `%ip_i_XMLList`, `%l_i_XMLList`, `%l_i__EObj`, `%lss_i_XMLList`, `%mc_i_XMLList`, `%msp_full`, `%msp_i_XMLList`, `%msp_spget`, `%p_i_XMLList`, `%ptr_i_XMLList`, `%r_i_XMLList`, `%s_1__EObj`, `%s_2__EObj`, `%s_3__EObj`, `%s_4__EObj`, `%s_a__EObj`, `%s_d__EObj`, `%s_g__EObj`, `%s_h__EObj`, `%s_i_XMLList`, `%s_i__EObj`, `%s_j__EObj`, `%s_k__EObj`, `%s_l__EObj`, `%s_m__EObj`, `%s_n__EObj`, `%s_o__EObj`, `%s_p__EObj`, `%s_q__EObj`, `%s_r__EObj`, `%s_s__EObj`, `%s_x__EObj`, `%s_y__EObj`, `%s_z__EObj`, `%sp_i_XMLList`, `%spb_i_XMLList`, `%st_i_XMLList`, `Calendar`, `ClipBoard`, `Matplot`, `Matplot1`, `PlaySound`, `TCL_DeleteInterp`, `TCL_DoOneEvent`, `TCL_EvalFile`, `TCL_EvalStr`, `TCL_ExistArray`, `TCL_ExistInterp`, `TCL_ExistVar`, `TCL_GetVar`, `TCL_GetVersion`, `TCL_SetVar`, `TCL_UnsetVar`, `TCL_UpVar`, `_`, `_code2str`, `_d`, `_str2code`, `about`, `abs`, `acos`, `addModulePreferences`, `addcolor`, `addf`, `addhistory`, `addinter`, `addlocalizationdomain`, `amell`, `and`, `argn`, `arl2_ius`, `ascii`, `asin`, `atan`, `backslash`, `balanc`, `banner`, `base2dec`, `basename`, `bdiag`, `beep`, `besselh`, `besseli`, `besselj`, `besselk`, `bessely`, `beta`, `bezout`, `bfinit`, `blkfc1i`, `blkslvi`, `bool2s`, `browsehistory`, `browsevar`, `bsplin3val`, `buildDoc`, `buildouttb`, `bvode`, `c_link`, `call`, `callblk`, `captions`, `cd`, `cdfbet`, `cdfbin`, `cdfchi`, `cdfchn`, `cdff`, `cdffnc`, `cdfgam`, `cdfnbn`, `cdfnor`, `cdfpoi`, `cdft`, `ceil`, `champ`, `champ1`, `chdir`, `chol`, `clc`, `clean`, `clear`, `clearfun`, `clearglobal`, `closeEditor`, `closeEditvar`, `closeXcos`, `code2str`, `coeff`, `color`, `comp`, `completion`, `conj`, `contour2di`, `contr`, `conv2`, `convstr`, `copy`, `copyfile`, `corr`, `cos`, `coserror`, `createdir`, `cshep2d`, `csvDefault`, `csvIsnum`, `csvRead`, `csvStringToDouble`, `csvTextScan`, `csvWrite`, `ctree2`, `ctree3`, `ctree4`, `cumprod`, `cumsum`, `curblock`, `curblockc`, `daskr`, `dasrt`, `dassl`, `data2sig`, `datatipCreate`, `datatipManagerMode`, `datatipMove`, `datatipRemove`, `datatipSetDisplay`, `datatipSetInterp`, `datatipSetOrientation`, `datatipSetStyle`, `datatipToggle`, `dawson`, `dct`, `debug`, `dec2base`, `deff`, `definedfields`, `degree`, `delbpt`, `delete`, `deletefile`, `delip`, `delmenu`, `det`, `dgettext`, `dhinf`, `diag`, `diary`, `diffobjs`, `disp`, `dispbpt`, `displayhistory`, `disposefftwlibrary`, `dlgamma`, `dnaupd`, `dneupd`, `double`, `drawaxis`, `drawlater`, `drawnow`, `driver`, `dsaupd`, `dsearch`, `dseupd`, `dst`, `duplicate`, `editvar`, `emptystr`, `end_scicosim`, `ereduc`, `erf`, `erfc`, `erfcx`, `erfi`, `errcatch`, `errclear`, `error`, `eval_cshep2d`, `exec`, `execstr`, `exists`, `exit`, `exp`, `expm`, `exportUI`, `export_to_hdf5`, `eye`, `fadj2sp`, `fec`, `feval`, `fft`, `fftw`, `fftw_flags`, `fftw_forget_wisdom`, `fftwlibraryisloaded`, `figure`, `file`, `filebrowser`, `fileext`, `fileinfo`, `fileparts`, `filesep`, `find`, `findBD`, `findfiles`, `fire_closing_finished`, `floor`, `format`, `fort`, `fprintfMat`, `freq`, `frexp`, `fromc`, `fromjava`, `fscanfMat`, `fsolve`, `fstair`, `full`, `fullpath`, `funcprot`, `funptr`, `gamma`, `gammaln`, `geom3d`, `get`, `getURL`, `get_absolute_file_path`, `get_fftw_wisdom`, `getblocklabel`, `getcallbackobject`, `getdate`, `getdebuginfo`, `getdefaultlanguage`, `getdrives`, `getdynlibext`, `getenv`, `getfield`, `gethistory`, `gethistoryfile`, `getinstalledlookandfeels`, `getio`, `getlanguage`, `getlongpathname`, `getlookandfeel`, `getmd5`, `getmemory`, `getmodules`, `getos`, `getpid`, `getrelativefilename`, `getscicosvars`, `getscilabmode`, `getshortpathname`, `gettext`, `getvariablesonstack`, `getversion`, `glist`, `global`, `glue`, `grand`, `graphicfunction`, `grayplot`, `grep`, `gsort`, `gstacksize`, `h5attr`, `h5close`, `h5cp`, `h5dataset`, `h5dump`, `h5exists`, `h5flush`, `h5get`, `h5group`, `h5isArray`, `h5isAttr`, `h5isCompound`, `h5isFile`, `h5isGroup`, `h5isList`, `h5isRef`, `h5isSet`, `h5isSpace`, `h5isType`, `h5isVlen`, `h5label`, `h5ln`, `h5ls`, `h5mount`, `h5mv`, `h5open`, `h5read`, `h5readattr`, `h5rm`, `h5umount`, `h5write`, `h5writeattr`, `havewindow`, `helpbrowser`, `hess`, `hinf`, `historymanager`, `historysize`, `host`, `htmlDump`, `htmlRead`, `htmlReadStr`, `htmlWrite`, `iconvert`, `ieee`, `ilib_verbose`, `imag`, `impl`, `import_from_hdf5`, `imult`, `inpnvi`, `int`, `int16`, `int2d`, `int32`, `int3d`, `int8`, `interp`, `interp2d`, `interp3d`, `intg`, `intppty`, `inttype`, `inv`, `invoke_lu`, `is_handle_valid`, `is_hdf5_file`, `isalphanum`, `isascii`, `isdef`, `isdigit`, `isdir`, `isequal`, `isequalbitwise`, `iserror`, `isfile`, `isglobal`, `isletter`, `isnum`, `isreal`, `iswaitingforinput`, `jallowClassReloading`, `jarray`, `jautoTranspose`, `jautoUnwrap`, `javaclasspath`, `javalibrarypath`, `jcast`, `jcompile`, `jconvMatrixMethod`, `jcreatejar`, `jdeff`, `jdisableTrace`, `jenableTrace`, `jexists`, `jgetclassname`, `jgetfield`, `jgetfields`, `jgetinfo`, `jgetmethods`, `jimport`, `jinvoke`, `jinvoke_db`, `jnewInstance`, `jremove`, `jsetfield`, `junwrap`, `junwraprem`, `jwrap`, `jwrapinfloat`, `kron`, `lasterror`, `ldiv`, `ldivf`, `legendre`, `length`, `lib`, `librarieslist`, `libraryinfo`, `light`, `linear_interpn`, `lines`, `link`, `linmeq`, `list`, `listvar_in_hdf5`, `load`, `loadGui`, `loadScicos`, `loadXcos`, `loadfftwlibrary`, `loadhistory`, `log`, `log1p`, `lsq`, `lsq_splin`, `lsqrsolve`, `lsslist`, `lstcat`, `lstsize`, `ltitr`, `lu`, `ludel`, `lufact`, `luget`, `lusolve`, `macr2lst`, `macr2tree`, `matfile_close`, `matfile_listvar`, `matfile_open`, `matfile_varreadnext`, `matfile_varwrite`, `matrix`, `max`, `maxfiles`, `mclearerr`, `mclose`, `meof`, `merror`, `messagebox`, `mfprintf`, `mfscanf`, `mget`, `mgeti`, `mgetl`, `mgetstr`, `min`, `mlist`, `mode`, `model2blk`, `mopen`, `move`, `movefile`, `mprintf`, `mput`, `mputl`, `mputstr`, `mscanf`, `mseek`, `msprintf`, `msscanf`, `mtell`, `mtlb_mode`, `mtlb_sparse`, `mucomp`, `mulf`, `name2rgb`, `nearfloat`, `newaxes`, `newest`, `newfun`, `nnz`, `norm`, `notify`, `number_properties`, `ode`, `odedc`, `ones`, `openged`, `opentk`, `optim`, `or`, `ordmmd`, `parallel_concurrency`, `parallel_run`, `param3d`, `param3d1`, `part`, `pathconvert`, `pathsep`, `phase_simulation`, `plot2d`, `plot2d1`, `plot2d2`, `plot2d3`, `plot2d4`, `plot3d`, `plot3d1`, `plotbrowser`, `pointer_xproperty`, `poly`, `ppol`, `pppdiv`, `predef`, `preferences`, `print`, `printf`, `printfigure`, `printsetupbox`, `prod`, `progressionbar`, `prompt`, `pwd`, `qld`, `qp_solve`, `qr`, `raise_window`, `rand`, `rankqr`, `rat`, `rcond`, `rdivf`, `read`, `read4b`, `read_csv`, `readb`, `readgateway`, `readmps`, `real`, `realtime`, `realtimeinit`, `regexp`, `relocate_handle`, `remez`, `removeModulePreferences`, `removedir`, `removelinehistory`, `res_with_prec`, `resethistory`, `residu`, `resume`, `return`, `ricc`, `rlist`, `roots`, `rotate_axes`, `round`, `rpem`, `rtitr`, `rubberbox`, `save`, `saveGui`, `saveafterncommands`, `saveconsecutivecommands`, `savehistory`, `schur`, `sci_haltscicos`, `sci_tree2`, `sci_tree3`, `sci_tree4`, `sciargs`, `scicos_debug`, `scicos_debug_count`, `scicos_time`, `scicosim`, `scinotes`, `sctree`, `semidef`, `set`, `set_blockerror`, `set_fftw_wisdom`, `set_xproperty`, `setbpt`, `setdefaultlanguage`, `setenv`, `setfield`, `sethistoryfile`, `setlanguage`, `setlookandfeel`, `setmenu`, `sfact`, `sfinit`, `show_window`, `sident`, `sig2data`, `sign`, `simp`, `simp_mode`, `sin`, `size`, `slash`, `sleep`, `sorder`, `sparse`, `spchol`, `spcompack`, `spec`, `spget`, `splin`, `splin2d`, `splin3d`, `splitURL`, `spones`, `sprintf`, `sqrt`, `stacksize`, `str2code`, `strcat`, `strchr`, `strcmp`, `strcspn`, `strindex`, `string`, `stringbox`, `stripblanks`, `strncpy`, `strrchr`, `strrev`, `strsplit`, `strspn`, `strstr`, `strsubst`, `strtod`, `strtok`, `subf`, `sum`, `svd`, `swap_handles`, `symfcti`, `syredi`, `system_getproperty`, `system_setproperty`, `ta2lpd`, `tan`, `taucs_chdel`, `taucs_chfact`, `taucs_chget`, `taucs_chinfo`, `taucs_chsolve`, `tempname`, `testmatrix`, `timer`, `tlist`, `tohome`, `tokens`, `toolbar`, `toprint`, `tr_zer`, `tril`, `triu`, `type`, `typename`, `uiDisplayTree`, `uicontextmenu`, `uicontrol`, `uigetcolor`, `uigetdir`, `uigetfile`, `uigetfont`, `uimenu`, `uint16`, `uint32`, `uint8`, `uipopup`, `uiputfile`, `uiwait`, `ulink`, `umf_ludel`, `umf_lufact`, `umf_luget`, `umf_luinfo`, `umf_lusolve`, `umfpack`, `unglue`, `unix`, `unsetmenu`, `unzoom`, `updatebrowsevar`, `usecanvas`, `useeditor`, `user`, `var2vec`, `varn`, `vec2var`, `waitbar`, `warnBlockByUID`, `warning`, `what`, `where`, `whereis`, `who`, `winsid`, `with_module`, `writb`, `write`, `write4b`, `write_csv`, `x_choose`, `x_choose_modeless`, `x_dialog`, `x_mdialog`, `xarc`, `xarcs`, `xarrows`, `xchange`, `xchoicesi`, `xclick`, `xcos`, `xcosAddToolsMenu`, `xcosConfigureXmlFile`, `xcosDiagramToScilab`, `xcosPalCategoryAdd`, `xcosPalDelete`, `xcosPalDisable`, `xcosPalEnable`, `xcosPalGenerateIcon`, `xcosPalGet`, `xcosPalLoad`, `xcosPalMove`, `xcosSimulationStarted`, `xcosUpdateBlock`, `xdel`, `xend`, `xfarc`, `xfarcs`, `xfpoly`, `xfpolys`, `xfrect`, `xget`, `xgetmouse`, `xgraduate`, `xgrid`, `xinit`, `xlfont`, `xls_open`, `xls_read`, `xmlAddNs`, `xmlAppend`, `xmlAsNumber`, `xmlAsText`, `xmlDTD`, `xmlDelete`, `xmlDocument`, `xmlDump`, `xmlElement`, `xmlFormat`, `xmlGetNsByHref`, `xmlGetNsByPrefix`, `xmlGetOpenDocs`, `xmlIsValidObject`, `xmlName`, `xmlNs`, `xmlRead`, `xmlReadStr`, `xmlRelaxNG`, `xmlRemove`, `xmlSchema`, `xmlSetAttributes`, `xmlValidate`, `xmlWrite`, `xmlXPath`, `xname`, `xpause`, `xpoly`, `xpolys`, `xrect`, `xrects`, `xs2bmp`, `xs2emf`, `xs2eps`, `xs2gif`, `xs2jpg`, `xs2pdf`, `xs2png`, `xs2ppm`, `xs2ps`, `xs2svg`, `xsegs`, `xset`, `xstring`, `xstringb`, `xtitle`, `zeros`, `znaupd`, `zneupd`, `zoom_rect`, `abort`, `apropos`, `break`, `case`, `catch`, `continue`, `do`, `else`, `elseif`, `end`, `endfunction`, `for`, `function`, `help`, `if`, `pause`, `quit`, `select`, `then`, `try`, `while`, `!_deff_wrapper`, `%0_i_st`, `%3d_i_h`, `%Block_xcosUpdateBlock`, `%TNELDER_p`, `%TNELDER_string`, `%TNMPLOT_p`, `%TNMPLOT_string`, `%TOPTIM_p`, `%TOPTIM_string`, `%TSIMPLEX_p`, `%TSIMPLEX_string`, `%_EVoid_p`, `%_gsort`, `%_listvarinfile`, `%_rlist`, `%_save`, `%_sodload`, `%_strsplit`, `%_unwrap`, `%ar_p`, `%asn`, `%b_a_b`, `%b_a_s`, `%b_c_s`, `%b_c_spb`, `%b_cumprod`, `%b_cumsum`, `%b_d_s`, `%b_diag`, `%b_e`, `%b_f_s`, `%b_f_spb`, `%b_g_s`, `%b_g_spb`, `%b_grand`, `%b_h_s`, `%b_h_spb`, `%b_i_b`, `%b_i_ce`, `%b_i_h`, `%b_i_hm`, `%b_i_s`, `%b_i_sp`, `%b_i_spb`, `%b_i_st`, `%b_iconvert`, `%b_l_b`, `%b_l_s`, `%b_m_b`, `%b_m_s`, `%b_matrix`, `%b_n_hm`, `%b_o_hm`, `%b_p_s`, `%b_prod`, `%b_r_b`, `%b_r_s`, `%b_s_b`, `%b_s_s`, `%b_string`, `%b_sum`, `%b_tril`, `%b_triu`, `%b_x_b`, `%b_x_s`, `%bicg`, `%bicgstab`, `%c_a_c`, `%c_b_c`, `%c_b_s`, `%c_diag`, `%c_dsearch`, `%c_e`, `%c_eye`, `%c_f_s`, `%c_grand`, `%c_i_c`, `%c_i_ce`, `%c_i_h`, `%c_i_hm`, `%c_i_lss`, `%c_i_r`, `%c_i_s`, `%c_i_st`, `%c_matrix`, `%c_n_l`, `%c_n_st`, `%c_o_l`, `%c_o_st`, `%c_ones`, `%c_rand`, `%c_tril`, `%c_triu`, `%cblock_c_cblock`, `%cblock_c_s`, `%cblock_e`, `%cblock_f_cblock`, `%cblock_p`, `%cblock_size`, `%ce_6`, `%ce_c_ce`, `%ce_e`, `%ce_f_ce`, `%ce_i_ce`, `%ce_i_s`, `%ce_i_st`, `%ce_matrix`, `%ce_p`, `%ce_size`, `%ce_string`, `%ce_t`, `%cgs`, `%champdat_i_h`, `%choose`, `%diagram_xcos`, `%dir_p`, `%fptr_i_st`, `%grand_perm`, `%grayplot_i_h`, `%h_i_st`, `%hmS_k_hmS_generic`, `%hm_1_hm`, `%hm_1_s`, `%hm_2_hm`, `%hm_2_s`, `%hm_3_hm`, `%hm_3_s`, `%hm_4_hm`, `%hm_4_s`, `%hm_5`, `%hm_a_hm`, `%hm_a_r`, `%hm_a_s`, `%hm_abs`, `%hm_and`, `%hm_bool2s`, `%hm_c_hm`, `%hm_ceil`, `%hm_conj`, `%hm_cos`, `%hm_cumprod`, `%hm_cumsum`, `%hm_d_hm`, `%hm_d_s`, `%hm_degree`, `%hm_dsearch`, `%hm_e`, `%hm_exp`, `%hm_eye`, `%hm_f_hm`, `%hm_find`, `%hm_floor`, `%hm_g_hm`, `%hm_grand`, `%hm_gsort`, `%hm_h_hm`, `%hm_i_b`, `%hm_i_ce`, `%hm_i_h`, `%hm_i_hm`, `%hm_i_i`, `%hm_i_p`, `%hm_i_r`, `%hm_i_s`, `%hm_i_st`, `%hm_iconvert`, `%hm_imag`, `%hm_int`, `%hm_isnan`, `%hm_isreal`, `%hm_j_hm`, `%hm_j_s`, `%hm_k_hm`, `%hm_k_s`, `%hm_log`, `%hm_m_p`, `%hm_m_r`, `%hm_m_s`, `%hm_matrix`, `%hm_max`, `%hm_mean`, `%hm_median`, `%hm_min`, `%hm_n_b`, `%hm_n_c`, `%hm_n_hm`, `%hm_n_i`, `%hm_n_p`, `%hm_n_s`, `%hm_o_b`, `%hm_o_c`, `%hm_o_hm`, `%hm_o_i`, `%hm_o_p`, `%hm_o_s`, `%hm_ones`, `%hm_or`, `%hm_p`, `%hm_prod`, `%hm_q_hm`, `%hm_r_s`, `%hm_rand`, `%hm_real`, `%hm_round`, `%hm_s`, `%hm_s_hm`, `%hm_s_r`, `%hm_s_s`, `%hm_sign`, `%hm_sin`, `%hm_size`, `%hm_sqrt`, `%hm_stdev`, `%hm_string`, `%hm_sum`, `%hm_x_hm`, `%hm_x_p`, `%hm_x_s`, `%hm_zeros`, `%i_1_s`, `%i_2_s`, `%i_3_s`, `%i_4_s`, `%i_Matplot`, `%i_a_i`, `%i_a_s`, `%i_and`, `%i_ascii`, `%i_b_s`, `%i_bezout`, `%i_champ`, `%i_champ1`, `%i_contour`, `%i_contour2d`, `%i_d_i`, `%i_d_s`, `%i_dsearch`, `%i_e`, `%i_fft`, `%i_g_i`, `%i_gcd`, `%i_grand`, `%i_h_i`, `%i_i_ce`, `%i_i_h`, `%i_i_hm`, `%i_i_i`, `%i_i_s`, `%i_i_st`, `%i_j_i`, `%i_j_s`, `%i_l_s`, `%i_lcm`, `%i_length`, `%i_m_i`, `%i_m_s`, `%i_mfprintf`, `%i_mprintf`, `%i_msprintf`, `%i_n_s`, `%i_o_s`, `%i_or`, `%i_p_i`, `%i_p_s`, `%i_plot2d`, `%i_plot2d1`, `%i_plot2d2`, `%i_q_s`, `%i_r_i`, `%i_r_s`, `%i_round`, `%i_s_i`, `%i_s_s`, `%i_sign`, `%i_string`, `%i_x_i`, `%i_x_s`, `%ip_a_s`, `%ip_i_st`, `%ip_m_s`, `%ip_n_ip`, `%ip_o_ip`, `%ip_p`, `%ip_part`, `%ip_s_s`, `%ip_string`, `%k`, `%l_i_h`, `%l_i_s`, `%l_i_st`, `%l_isequal`, `%l_n_c`, `%l_n_l`, `%l_n_m`, `%l_n_p`, `%l_n_s`, `%l_n_st`, `%l_o_c`, `%l_o_l`, `%l_o_m`, `%l_o_p`, `%l_o_s`, `%l_o_st`, `%lss_a_lss`, `%lss_a_p`, `%lss_a_r`, `%lss_a_s`, `%lss_c_lss`, `%lss_c_p`, `%lss_c_r`, `%lss_c_s`, `%lss_e`, `%lss_eye`, `%lss_f_lss`, `%lss_f_p`, `%lss_f_r`, `%lss_f_s`, `%lss_i_ce`, `%lss_i_lss`, `%lss_i_p`, `%lss_i_r`, `%lss_i_s`, `%lss_i_st`, `%lss_inv`, `%lss_l_lss`, `%lss_l_p`, `%lss_l_r`, `%lss_l_s`, `%lss_m_lss`, `%lss_m_p`, `%lss_m_r`, `%lss_m_s`, `%lss_n_lss`, `%lss_n_p`, `%lss_n_r`, `%lss_n_s`, `%lss_norm`, `%lss_o_lss`, `%lss_o_p`, `%lss_o_r`, `%lss_o_s`, `%lss_ones`, `%lss_r_lss`, `%lss_r_p`, `%lss_r_r`, `%lss_r_s`, `%lss_rand`, `%lss_s`, `%lss_s_lss`, `%lss_s_p`, `%lss_s_r`, `%lss_s_s`, `%lss_size`, `%lss_t`, `%lss_v_lss`, `%lss_v_p`, `%lss_v_r`, `%lss_v_s`, `%lt_i_s`, `%m_n_l`, `%m_o_l`, `%mc_i_h`, `%mc_i_s`, `%mc_i_st`, `%mc_n_st`, `%mc_o_st`, `%mc_string`, `%mps_p`, `%mps_string`, `%msp_a_s`, `%msp_abs`, `%msp_e`, `%msp_find`, `%msp_i_s`, `%msp_i_st`, `%msp_length`, `%msp_m_s`, `%msp_maxi`, `%msp_n_msp`, `%msp_nnz`, `%msp_o_msp`, `%msp_p`, `%msp_sparse`, `%msp_spones`, `%msp_t`, `%p_a_lss`, `%p_a_r`, `%p_c_lss`, `%p_c_r`, `%p_cumprod`, `%p_cumsum`, `%p_d_p`, `%p_d_r`, `%p_d_s`, `%p_det`, `%p_e`, `%p_f_lss`, `%p_f_r`, `%p_grand`, `%p_i_ce`, `%p_i_h`, `%p_i_hm`, `%p_i_lss`, `%p_i_p`, `%p_i_r`, `%p_i_s`, `%p_i_st`, `%p_inv`, `%p_j_s`, `%p_k_p`, `%p_k_r`, `%p_k_s`, `%p_l_lss`, `%p_l_p`, `%p_l_r`, `%p_l_s`, `%p_m_hm`, `%p_m_lss`, `%p_m_r`, `%p_matrix`, `%p_n_l`, `%p_n_lss`, `%p_n_r`, `%p_o_l`, `%p_o_lss`, `%p_o_r`, `%p_o_sp`, `%p_p_s`, `%p_part`, `%p_prod`, `%p_q_p`, `%p_q_r`, `%p_q_s`, `%p_r_lss`, `%p_r_p`, `%p_r_r`, `%p_r_s`, `%p_s_lss`, `%p_s_r`, `%p_simp`, `%p_string`, `%p_sum`, `%p_v_lss`, `%p_v_p`, `%p_v_r`, `%p_v_s`, `%p_x_hm`, `%p_x_r`, `%p_y_p`, `%p_y_r`, `%p_y_s`, `%p_z_p`, `%p_z_r`, `%p_z_s`, `%pcg`, `%plist_p`, `%plist_string`, `%r_0`, `%r_a_hm`, `%r_a_lss`, `%r_a_p`, `%r_a_r`, `%r_a_s`, `%r_c_lss`, `%r_c_p`, `%r_c_r`, `%r_c_s`, `%r_clean`, `%r_cumprod`, `%r_cumsum`, `%r_d_p`, `%r_d_r`, `%r_d_s`, `%r_det`, `%r_diag`, `%r_e`, `%r_eye`, `%r_f_lss`, `%r_f_p`, `%r_f_r`, `%r_f_s`, `%r_i_ce`, `%r_i_hm`, `%r_i_lss`, `%r_i_p`, `%r_i_r`, `%r_i_s`, `%r_i_st`, `%r_inv`, `%r_j_s`, `%r_k_p`, `%r_k_r`, `%r_k_s`, `%r_l_lss`, `%r_l_p`, `%r_l_r`, `%r_l_s`, `%r_m_hm`, `%r_m_lss`, `%r_m_p`, `%r_m_r`, `%r_m_s`, `%r_matrix`, `%r_n_lss`, `%r_n_p`, `%r_n_r`, `%r_n_s`, `%r_norm`, `%r_o_lss`, `%r_o_p`, `%r_o_r`, `%r_o_s`, `%r_ones`, `%r_p`, `%r_p_s`, `%r_prod`, `%r_q_p`, `%r_q_r`, `%r_q_s`, `%r_r_lss`, `%r_r_p`, `%r_r_r`, `%r_r_s`, `%r_rand`, `%r_s`, `%r_s_hm`, `%r_s_lss`, `%r_s_p`, `%r_s_r`, `%r_s_s`, `%r_simp`, `%r_size`, `%r_string`, `%r_sum`, `%r_t`, `%r_tril`, `%r_triu`, `%r_v_lss`, `%r_v_p`, `%r_v_r`, `%r_v_s`, `%r_varn`, `%r_x_p`, `%r_x_r`, `%r_x_s`, `%r_y_p`, `%r_y_r`, `%r_y_s`, `%r_z_p`, `%r_z_r`, `%r_z_s`, `%s_1_hm`, `%s_1_i`, `%s_2_hm`, `%s_2_i`, `%s_3_hm`, `%s_3_i`, `%s_4_hm`, `%s_4_i`, `%s_5`, `%s_a_b`, `%s_a_hm`, `%s_a_i`, `%s_a_ip`, `%s_a_lss`, `%s_a_msp`, `%s_a_r`, `%s_a_sp`, `%s_and`, `%s_b_i`, `%s_b_s`, `%s_bezout`, `%s_c_b`, `%s_c_cblock`, `%s_c_lss`, `%s_c_r`, `%s_c_sp`, `%s_d_b`, `%s_d_i`, `%s_d_p`, `%s_d_r`, `%s_d_sp`, `%s_e`, `%s_f_b`, `%s_f_cblock`, `%s_f_lss`, `%s_f_r`, `%s_f_sp`, `%s_g_b`, `%s_g_s`, `%s_gcd`, `%s_grand`, `%s_h_b`, `%s_h_s`, `%s_i_b`, `%s_i_c`, `%s_i_ce`, `%s_i_h`, `%s_i_hm`, `%s_i_i`, `%s_i_lss`, `%s_i_p`, `%s_i_r`, `%s_i_s`, `%s_i_sp`, `%s_i_spb`, `%s_i_st`, `%s_j_i`, `%s_k_hm`, `%s_k_p`, `%s_k_r`, `%s_k_sp`, `%s_l_b`, `%s_l_hm`, `%s_l_i`, `%s_l_lss`, `%s_l_p`, `%s_l_r`, `%s_l_s`, `%s_l_sp`, `%s_lcm`, `%s_m_b`, `%s_m_hm`, `%s_m_i`, `%s_m_ip`, `%s_m_lss`, `%s_m_msp`, `%s_m_r`, `%s_matrix`, `%s_n_hm`, `%s_n_i`, `%s_n_l`, `%s_n_lss`, `%s_n_r`, `%s_n_st`, `%s_o_hm`, `%s_o_i`, `%s_o_l`, `%s_o_lss`, `%s_o_r`, `%s_o_st`, `%s_or`, `%s_p_b`, `%s_p_i`, `%s_pow`, `%s_q_hm`, `%s_q_i`, `%s_q_p`, `%s_q_r`, `%s_q_sp`, `%s_r_b`, `%s_r_i`, `%s_r_lss`, `%s_r_p`, `%s_r_r`, `%s_r_s`, `%s_r_sp`, `%s_s_b`, `%s_s_hm`, `%s_s_i`, `%s_s_ip`, `%s_s_lss`, `%s_s_r`, `%s_s_sp`, `%s_simp`, `%s_v_lss`, `%s_v_p`, `%s_v_r`, `%s_v_s`, `%s_x_b`, `%s_x_hm`, `%s_x_i`, `%s_x_r`, `%s_y_p`, `%s_y_r`, `%s_y_sp`, `%s_z_p`, `%s_z_r`, `%s_z_sp`, `%sn`, `%sp_a_s`, `%sp_a_sp`, `%sp_and`, `%sp_c_s`, `%sp_ceil`, `%sp_conj`, `%sp_cos`, `%sp_cumprod`, `%sp_cumsum`, `%sp_d_s`, `%sp_d_sp`, `%sp_det`, `%sp_diag`, `%sp_e`, `%sp_exp`, `%sp_f_s`, `%sp_floor`, `%sp_grand`, `%sp_gsort`, `%sp_i_ce`, `%sp_i_h`, `%sp_i_s`, `%sp_i_sp`, `%sp_i_st`, `%sp_int`, `%sp_inv`, `%sp_k_s`, `%sp_k_sp`, `%sp_l_s`, `%sp_l_sp`, `%sp_length`, `%sp_max`, `%sp_min`, `%sp_norm`, `%sp_or`, `%sp_p_s`, `%sp_prod`, `%sp_q_s`, `%sp_q_sp`, `%sp_r_s`, `%sp_r_sp`, `%sp_round`, `%sp_s_s`, `%sp_s_sp`, `%sp_sin`, `%sp_sqrt`, `%sp_string`, `%sp_sum`, `%sp_tril`, `%sp_triu`, `%sp_y_s`, `%sp_y_sp`, `%sp_z_s`, `%sp_z_sp`, `%spb_and`, `%spb_c_b`, `%spb_cumprod`, `%spb_cumsum`, `%spb_diag`, `%spb_e`, `%spb_f_b`, `%spb_g_b`, `%spb_g_spb`, `%spb_h_b`, `%spb_h_spb`, `%spb_i_b`, `%spb_i_ce`, `%spb_i_h`, `%spb_i_st`, `%spb_or`, `%spb_prod`, `%spb_sum`, `%spb_tril`, `%spb_triu`, `%st_6`, `%st_c_st`, `%st_e`, `%st_f_st`, `%st_i_b`, `%st_i_c`, `%st_i_fptr`, `%st_i_h`, `%st_i_i`, `%st_i_ip`, `%st_i_lss`, `%st_i_msp`, `%st_i_p`, `%st_i_r`, `%st_i_s`, `%st_i_sp`, `%st_i_spb`, `%st_i_st`, `%st_matrix`, `%st_n_c`, `%st_n_l`, `%st_n_mc`, `%st_n_p`, `%st_n_s`, `%st_o_c`, `%st_o_l`, `%st_o_mc`, `%st_o_p`, `%st_o_s`, `%st_o_tl`, `%st_p`, `%st_size`, `%st_string`, `%st_t`, `%ticks_i_h`, `%xls_e`, `%xls_p`, `%xlssheet_e`, `%xlssheet_p`, `%xlssheet_size`, `%xlssheet_string`, `DominationRank`, `G_make`, `IsAScalar`, `NDcost`, `OS_Version`, `PlotSparse`, `ReadHBSparse`, `TCL_CreateSlave`, `abcd`, `abinv`, `accept_func_default`, `accept_func_vfsa`, `acf`, `acosd`, `acosh`, `acoshm`, `acosm`, `acot`, `acotd`, `acoth`, `acsc`, `acscd`, `acsch`, `add_demo`, `add_help_chapter`, `add_module_help_chapter`, `add_param`, `add_profiling`, `adj2sp`, `aff2ab`, `ana_style`, `analpf`, `analyze`, `aplat`, `arhnk`, `arl2`, `arma2p`, `arma2ss`, `armac`, `armax`, `armax1`, `arobasestring2strings`, `arsimul`, `ascii2string`, `asciimat`, `asec`, `asecd`, `asech`, `asind`, `asinh`, `asinhm`, `asinm`, `assert_checkalmostequal`, `assert_checkequal`, `assert_checkerror`, `assert_checkfalse`, `assert_checkfilesequal`, `assert_checktrue`, `assert_comparecomplex`, `assert_computedigits`, `assert_cond2reltol`, `assert_cond2reqdigits`, `assert_generror`, `atand`, `atanh`, `atanhm`, `atanm`, `atomsAutoload`, `atomsAutoloadAdd`, `atomsAutoloadDel`, `atomsAutoloadList`, `atomsCategoryList`, `atomsCheckModule`, `atomsDepTreeShow`, `atomsGetConfig`, `atomsGetInstalled`, `atomsGetInstalledPath`, `atomsGetLoaded`, `atomsGetLoadedPath`, `atomsInstall`, `atomsIsInstalled`, `atomsIsLoaded`, `atomsList`, `atomsLoad`, `atomsQuit`, `atomsRemove`, `atomsRepositoryAdd`, `atomsRepositoryDel`, `atomsRepositoryList`, `atomsRestoreConfig`, `atomsSaveConfig`, `atomsSearch`, `atomsSetConfig`, `atomsShow`, `atomsSystemInit`, `atomsSystemUpdate`, `atomsTest`, `atomsUpdate`, `atomsVersion`, `augment`, `auread`, `auwrite`, `balreal`, `bench_run`, `bilin`, `bilt`, `bin2dec`, `binomial`, `bitand`, `bitcmp`, `bitget`, `bitor`, `bitset`, `bitxor`, `black`, `blanks`, `bloc2exp`, `bloc2ss`, `block_parameter_error`, `bode`, `bode_asymp`, `bstap`, `buttmag`, `bvodeS`, `bytecode`, `bytecodewalk`, `cainv`, `calendar`, `calerf`, `calfrq`, `canon`, `casc`, `cat`, `cat_code`, `cb_m2sci_gui`, `ccontrg`, `cell`, `cell2mat`, `cellstr`, `center`, `cepstrum`, `cfspec`, `char`, `chart`, `cheb1mag`, `cheb2mag`, `check_gateways`, `check_modules_xml`, `check_versions`, `chepol`, `chfact`, `chsolve`, `classmarkov`, `clean_help`, `clock`, `cls2dls`, `cmb_lin`, `cmndred`, `cmoment`, `coding_ga_binary`, `coding_ga_identity`, `coff`, `coffg`, `colcomp`, `colcompr`, `colinout`, `colregul`, `companion`, `complex`, `compute_initial_temp`, `cond`, `cond2sp`, `condestsp`, `configure_msifort`, `configure_msvc`, `conjgrad`, `cont_frm`, `cont_mat`, `contrss`, `conv`, `convert_to_float`, `convertindex`, `convol`, `convol2d`, `copfac`, `correl`, `cosd`, `cosh`, `coshm`, `cosm`, `cotd`, `cotg`, `coth`, `cothm`, `cov`, `covar`, `createXConfiguration`, `createfun`, `createstruct`, `cross`, `crossover_ga_binary`, `crossover_ga_default`, `csc`, `cscd`, `csch`, `csgn`, `csim`, `cspect`, `ctr_gram`, `czt`, `dae`, `daeoptions`, `damp`, `datafit`, `date`, `datenum`, `datevec`, `dbphi`, `dcf`, `ddp`, `dec2bin`, `dec2hex`, `dec2oct`, `del_help_chapter`, `del_module_help_chapter`, `demo_begin`, `demo_choose`, `demo_compiler`, `demo_end`, `demo_file_choice`, `demo_folder_choice`, `demo_function_choice`, `demo_gui`, `demo_run`, `demo_viewCode`, `denom`, `derivat`, `derivative`, `des2ss`, `des2tf`, `detectmsifort64tools`, `detectmsvc64tools`, `determ`, `detr`, `detrend`, `devtools_run_builder`, `dhnorm`, `diff`, `diophant`, `dir`, `dirname`, `dispfiles`, `dllinfo`, `dscr`, `dsimul`, `dt_ility`, `dtsi`, `edit`, `edit_error`, `editor`, `eigenmarkov`, `eigs`, `ell1mag`, `enlarge_shape`, `entropy`, `eomday`, `epred`, `eqfir`, `eqiir`, `equil`, `equil1`, `erfinv`, `etime`, `eval`, `evans`, `evstr`, `example_run`, `expression2code`, `extract_help_examples`, `factor`, `factorial`, `factors`, `faurre`, `ffilt`, `fft2`, `fftshift`, `fieldnames`, `filt_sinc`, `filter`, `findABCD`, `findAC`, `findBDK`, `findR`, `find_freq`, `find_links`, `find_scicos_version`, `findm`, `findmsifortcompiler`, `findmsvccompiler`, `findx0BD`, `firstnonsingleton`, `fix`, `fixedpointgcd`, `flipdim`, `flts`, `fminsearch`, `formatBlackTip`, `formatBodeMagTip`, `formatBodePhaseTip`, `formatGainplotTip`, `formatHallModuleTip`, `formatHallPhaseTip`, `formatNicholsGainTip`, `formatNicholsPhaseTip`, `formatNyquistTip`, `formatPhaseplotTip`, `formatSgridDampingTip`, `formatSgridFreqTip`, `formatZgridDampingTip`, `formatZgridFreqTip`, `format_txt`, `fourplan`, `frep2tf`, `freson`, `frfit`, `frmag`, `fseek_origin`, `fsfirlin`, `fspec`, `fspecg`, `fstabst`, `ftest`, `ftuneq`, `fullfile`, `fullrf`, `fullrfk`, `fun2string`, `g_margin`, `gainplot`, `gamitg`, `gcare`, `gcd`, `gencompilationflags_unix`, `generateBlockImage`, `generateBlockImages`, `generic_i_ce`, `generic_i_h`, `generic_i_hm`, `generic_i_s`, `generic_i_st`, `genlib`, `genmarkov`, `geomean`, `getDiagramVersion`, `getModelicaPath`, `getPreferencesValue`, `get_file_path`, `get_function_path`, `get_param`, `get_profile`, `get_scicos_version`, `getd`, `getscilabkeywords`, `getshell`, `gettklib`, `gfare`, `gfrancis`, `givens`, `glever`, `gmres`, `group`, `gschur`, `gspec`, `gtild`, `h2norm`, `h_cl`, `h_inf`, `h_inf_st`, `h_norm`, `hallchart`, `halt`, `hank`, `hankelsv`, `harmean`, `haveacompiler`, `head_comments`, `help_from_sci`, `help_skeleton`, `hermit`, `hex2dec`, `hilb`, `hilbert`, `histc`, `horner`, `householder`, `hrmt`, `htrianr`, `hypermat`, `idct`, `idst`, `ifft`, `ifftshift`, `iir`, `iirgroup`, `iirlp`, `iirmod`, `ilib_build`, `ilib_build_jar`, `ilib_compile`, `ilib_for_link`, `ilib_gen_Make`, `ilib_gen_Make_unix`, `ilib_gen_cleaner`, `ilib_gen_gateway`, `ilib_gen_loader`, `ilib_include_flag`, `ilib_mex_build`, `im_inv`, `importScicosDiagram`, `importScicosPal`, `importXcosDiagram`, `imrep2ss`, `ind2sub`, `inistate`, `init_ga_default`, `init_param`, `initial_scicos_tables`, `input`, `instruction2code`, `intc`, `intdec`, `integrate`, `interp1`, `interpln`, `intersect`, `intl`, `intsplin`, `inttrap`, `inv_coeff`, `invr`, `invrs`, `invsyslin`, `iqr`, `isLeapYear`, `is_absolute_path`, `is_param`, `iscell`, `iscellstr`, `iscolumn`, `isempty`, `isfield`, `isinf`, `ismatrix`, `isnan`, `isrow`, `isscalar`, `issparse`, `issquare`, `isstruct`, `isvector`, `jmat`, `justify`, `kalm`, `karmarkar`, `kernel`, `kpure`, `krac2`, `kroneck`, `lattn`, `lattp`, `launchtest`, `lcf`, `lcm`, `lcmdiag`, `leastsq`, `leqe`, `leqr`, `lev`, `levin`, `lex_sort`, `lft`, `lin`, `lin2mu`, `lincos`, `lindquist`, `linf`, `linfn`, `linsolve`, `linspace`, `list2vec`, `list_param`, `listfiles`, `listfunctions`, `listvarinfile`, `lmisolver`, `lmitool`, `loadXcosLibs`, `loadmatfile`, `loadwave`, `log10`, `log2`, `logm`, `logspace`, `lqe`, `lqg`, `lqg2stan`, `lqg_ltr`, `lqr`, `ls`, `lyap`, `m2sci_gui`, `m_circle`, `macglov`, `macrovar`, `mad`, `makecell`, `manedit`, `mapsound`, `markp2ss`, `matfile2sci`, `mdelete`, `mean`, `meanf`, `median`, `members`, `mese`, `meshgrid`, `mfft`, `mfile2sci`, `minreal`, `minss`, `mkdir`, `modulo`, `moment`, `mrfit`, `msd`, `mstr2sci`, `mtlb`, `mtlb_0`, `mtlb_a`, `mtlb_all`, `mtlb_any`, `mtlb_axes`, `mtlb_axis`, `mtlb_beta`, `mtlb_box`, `mtlb_choices`, `mtlb_close`, `mtlb_colordef`, `mtlb_cond`, `mtlb_cov`, `mtlb_cumprod`, `mtlb_cumsum`, `mtlb_dec2hex`, `mtlb_delete`, `mtlb_diag`, `mtlb_diff`, `mtlb_dir`, `mtlb_double`, `mtlb_e`, `mtlb_echo`, `mtlb_error`, `mtlb_eval`, `mtlb_exist`, `mtlb_eye`, `mtlb_false`, `mtlb_fft`, `mtlb_fftshift`, `mtlb_filter`, `mtlb_find`, `mtlb_findstr`, `mtlb_fliplr`, `mtlb_fopen`, `mtlb_format`, `mtlb_fprintf`, `mtlb_fread`, `mtlb_fscanf`, `mtlb_full`, `mtlb_fwrite`, `mtlb_get`, `mtlb_grid`, `mtlb_hold`, `mtlb_i`, `mtlb_ifft`, `mtlb_image`, `mtlb_imp`, `mtlb_int16`, `mtlb_int32`, `mtlb_int8`, `mtlb_is`, `mtlb_isa`, `mtlb_isfield`, `mtlb_isletter`, `mtlb_isspace`, `mtlb_l`, `mtlb_legendre`, `mtlb_linspace`, `mtlb_logic`, `mtlb_logical`, `mtlb_loglog`, `mtlb_lower`, `mtlb_max`, `mtlb_mean`, `mtlb_median`, `mtlb_mesh`, `mtlb_meshdom`, `mtlb_min`, `mtlb_more`, `mtlb_num2str`, `mtlb_ones`, `mtlb_pcolor`, `mtlb_plot`, `mtlb_prod`, `mtlb_qr`, `mtlb_qz`, `mtlb_rand`, `mtlb_randn`, `mtlb_rcond`, `mtlb_realmax`, `mtlb_realmin`, `mtlb_s`, `mtlb_semilogx`, `mtlb_semilogy`, `mtlb_setstr`, `mtlb_size`, `mtlb_sort`, `mtlb_sortrows`, `mtlb_sprintf`, `mtlb_sscanf`, `mtlb_std`, `mtlb_strcmp`, `mtlb_strcmpi`, `mtlb_strfind`, `mtlb_strrep`, `mtlb_subplot`, `mtlb_sum`, `mtlb_t`, `mtlb_toeplitz`, `mtlb_tril`, `mtlb_triu`, `mtlb_true`, `mtlb_type`, `mtlb_uint16`, `mtlb_uint32`, `mtlb_uint8`, `mtlb_upper`, `mtlb_var`, `mtlb_zeros`, `mu2lin`, `mutation_ga_binary`, `mutation_ga_default`, `mvcorrel`, `mvvacov`, `nancumsum`, `nand2mean`, `nanmax`, `nanmean`, `nanmeanf`, `nanmedian`, `nanmin`, `nanreglin`, `nanstdev`, `nansum`, `narsimul`, `ndgrid`, `ndims`, `nehari`, `neigh_func_csa`, `neigh_func_default`, `neigh_func_fsa`, `neigh_func_vfsa`, `neldermead_cget`, `neldermead_configure`, `neldermead_costf`, `neldermead_defaultoutput`, `neldermead_destroy`, `neldermead_function`, `neldermead_get`, `neldermead_log`, `neldermead_new`, `neldermead_restart`, `neldermead_search`, `neldermead_updatesimp`, `nextpow2`, `nfreq`, `nicholschart`, `nlev`, `nmplot_cget`, `nmplot_configure`, `nmplot_contour`, `nmplot_destroy`, `nmplot_function`, `nmplot_get`, `nmplot_historyplot`, `nmplot_log`, `nmplot_new`, `nmplot_outputcmd`, `nmplot_restart`, `nmplot_search`, `nmplot_simplexhistory`, `noisegen`, `nonreg_test_run`, `now`, `nthroot`, `null`, `num2cell`, `numderivative`, `numdiff`, `numer`, `nyquist`, `nyquistfrequencybounds`, `obs_gram`, `obscont`, `observer`, `obsv_mat`, `obsvss`, `oct2dec`, `odeoptions`, `optim_ga`, `optim_moga`, `optim_nsga`, `optim_nsga2`, `optim_sa`, `optimbase_cget`, `optimbase_checkbounds`, `optimbase_checkcostfun`, `optimbase_checkx0`, `optimbase_configure`, `optimbase_destroy`, `optimbase_function`, `optimbase_get`, `optimbase_hasbounds`, `optimbase_hasconstraints`, `optimbase_hasnlcons`, `optimbase_histget`, `optimbase_histset`, `optimbase_incriter`, `optimbase_isfeasible`, `optimbase_isinbounds`, `optimbase_isinnonlincons`, `optimbase_log`, `optimbase_logshutdown`, `optimbase_logstartup`, `optimbase_new`, `optimbase_outputcmd`, `optimbase_outstruct`, `optimbase_proj2bnds`, `optimbase_set`, `optimbase_stoplog`, `optimbase_terminate`, `optimget`, `optimplotfunccount`, `optimplotfval`, `optimplotx`, `optimset`, `optimsimplex_center`, `optimsimplex_check`, `optimsimplex_compsomefv`, `optimsimplex_computefv`, `optimsimplex_deltafv`, `optimsimplex_deltafvmax`, `optimsimplex_destroy`, `optimsimplex_dirmat`, `optimsimplex_fvmean`, `optimsimplex_fvstdev`, `optimsimplex_fvvariance`, `optimsimplex_getall`, `optimsimplex_getallfv`, `optimsimplex_getallx`, `optimsimplex_getfv`, `optimsimplex_getn`, `optimsimplex_getnbve`, `optimsimplex_getve`, `optimsimplex_getx`, `optimsimplex_gradientfv`, `optimsimplex_log`, `optimsimplex_new`, `optimsimplex_reflect`, `optimsimplex_setall`, `optimsimplex_setallfv`, `optimsimplex_setallx`, `optimsimplex_setfv`, `optimsimplex_setn`, `optimsimplex_setnbve`, `optimsimplex_setve`, `optimsimplex_setx`, `optimsimplex_shrink`, `optimsimplex_size`, `optimsimplex_sort`, `optimsimplex_xbar`, `orth`, `output_ga_default`, `output_moga_default`, `output_nsga2_default`, `output_nsga_default`, `p_margin`, `pack`, `pareto_filter`, `parrot`, `pbig`, `pca`, `pcg`, `pdiv`, `pen2ea`, `pencan`, `pencost`, `penlaur`, `perctl`, `perl`, `perms`, `permute`, `pertrans`, `pfactors`, `pfss`, `phasemag`, `phaseplot`, `phc`, `pinv`, `playsnd`, `plotprofile`, `plzr`, `pmodulo`, `pol2des`, `pol2str`, `polar`, `polfact`, `prbs_a`, `prettyprint`, `primes`, `princomp`, `profile`, `proj`, `projsl`, `projspec`, `psmall`, `pspect`, `qmr`, `qpsolve`, `quart`, `quaskro`, `rafiter`, `randpencil`, `range`, `rank`, `readxls`, `recompilefunction`, `recons`, `reglin`, `regress`, `remezb`, `remove_param`, `remove_profiling`, `repfreq`, `replace_Ix_by_Fx`, `repmat`, `reset_profiling`, `resize_matrix`, `returntoscilab`, `rhs2code`, `ric_desc`, `riccati`, `rmdir`, `routh_t`, `rowcomp`, `rowcompr`, `rowinout`, `rowregul`, `rowshuff`, `rref`, `sample`, `samplef`, `samwr`, `savematfile`, `savewave`, `scanf`, `sci2exp`, `sciGUI_init`, `sci_sparse`, `scicos_getvalue`, `scicos_simulate`, `scicos_workspace_init`, `scisptdemo`, `scitest`, `sdiff`, `sec`, `secd`, `sech`, `selection_ga_elitist`, `selection_ga_random`, `sensi`, `setPreferencesValue`, `set_param`, `setdiff`, `sgrid`, `show_margins`, `show_pca`, `showprofile`, `signm`, `sinc`, `sincd`, `sind`, `sinh`, `sinhm`, `sinm`, `sm2des`, `sm2ss`, `smga`, `smooth`, `solve`, `sound`, `soundsec`, `sp2adj`, `spaninter`, `spanplus`, `spantwo`, `specfact`, `speye`, `sprand`, `spzeros`, `sqroot`, `sqrtm`, `squarewave`, `squeeze`, `srfaur`, `srkf`, `ss2des`, `ss2ss`, `ss2tf`, `sskf`, `ssprint`, `ssrand`, `st_deviation`, `st_i_generic`, `st_ility`, `stabil`, `statgain`, `stdev`, `stdevf`, `steadycos`, `strange`, `strcmpi`, `struct`, `sub2ind`, `sva`, `svplot`, `sylm`, `sylv`, `sysconv`, `sysdiag`, `sysfact`, `syslin`, `syssize`, `system`, `systmat`, `tabul`, `tand`, `tanh`, `tanhm`, `tanm`, `tbx_build_blocks`, `tbx_build_cleaner`, `tbx_build_gateway`, `tbx_build_gateway_clean`, `tbx_build_gateway_loader`, `tbx_build_help`, `tbx_build_help_loader`, `tbx_build_loader`, `tbx_build_localization`, `tbx_build_macros`, `tbx_build_pal_loader`, `tbx_build_src`, `tbx_builder`, `tbx_builder_gateway`, `tbx_builder_gateway_lang`, `tbx_builder_help`, `tbx_builder_help_lang`, `tbx_builder_macros`, `tbx_builder_src`, `tbx_builder_src_lang`, `tbx_generate_pofile`, `temp_law_csa`, `temp_law_default`, `temp_law_fsa`, `temp_law_huang`, `temp_law_vfsa`, `test_clean`, `test_on_columns`, `test_run`, `test_run_level`, `testexamples`, `tf2des`, `tf2ss`, `thrownan`, `tic`, `time_id`, `toc`, `toeplitz`, `tokenpos`, `toolboxes`, `trace`, `trans`, `translatepaths`, `tree2code`, `trfmod`, `trianfml`, `trimmean`, `trisolve`, `trzeros`, `typeof`, `ui_observer`, `union`, `unique`, `unit_test_run`, `unix_g`, `unix_s`, `unix_w`, `unix_x`, `unobs`, `unpack`, `unwrap`, `variance`, `variancef`, `vec2list`, `vectorfind`, `ver`, `warnobsolete`, `wavread`, `wavwrite`, `wcenter`, `weekday`, `wfir`, `wfir_gui`, `whereami`, `who_user`, `whos`, `wiener`, `wigner`, `window`, `winlist`, `with_javasci`, `with_macros_source`, `with_modelica_compiler`, `with_tk`, `xcorr`, `xcosBlockEval`, `xcosBlockInterface`, `xcosCodeGeneration`, `xcosConfigureModelica`, `xcosPal`, `xcosPalAdd`, `xcosPalAddBlock`, `xcosPalExport`, `xcosPalGenerateAllIcons`, `xcosShowBlockWarning`, `xcosValidateBlockSet`, `xcosValidateCompareBlock`, `xcos_compile`, `xcos_debug_gui`, `xcos_run`, `xcos_simulate`, `xcov`, `xmltochm`, `xmltoformat`, `xmltohtml`, `xmltojar`, `xmltopdf`, `xmltops`, `xmltoweb`, `yulewalk`, `zeropen`, `zgrid`, `zpbutt`, `zpch1`, `zpch2`, `zpell`), NameBuiltin, nil}, - {Words(``, `\b`, `$`, `%F`, `%T`, `%e`, `%eps`, `%f`, `%fftw`, `%gui`, `%i`, `%inf`, `%io`, `%modalWarning`, `%nan`, `%pi`, `%s`, `%t`, `%tk`, `%toolboxes`, `%toolboxes_dir`, `%z`, `PWD`, `SCI`, `SCIHOME`, `TMPDIR`, `arnoldilib`, `assertlib`, `atomslib`, `cacsdlib`, `compatibility_functilib`, `corelib`, `data_structureslib`, `demo_toolslib`, `development_toolslib`, `differential_equationlib`, `dynamic_linklib`, `elementary_functionslib`, `enull`, `evoid`, `external_objectslib`, `fd`, `fileiolib`, `functionslib`, `genetic_algorithmslib`, `helptoolslib`, `home`, `integerlib`, `interpolationlib`, `iolib`, `jnull`, `jvoid`, `linear_algebralib`, `m2scilib`, `matiolib`, `modules_managerlib`, `neldermeadlib`, `optimbaselib`, `optimizationlib`, `optimsimplexlib`, `output_streamlib`, `overloadinglib`, `parameterslib`, `polynomialslib`, `preferenceslib`, `randliblib`, `scicos_autolib`, `scicos_utilslib`, `scinoteslib`, `signal_processinglib`, `simulated_annealinglib`, `soundlib`, `sparselib`, `special_functionslib`, `spreadsheetlib`, `statisticslib`, `stringlib`, `tclscilib`, `timelib`, `umfpacklib`, `xcoslib`), NameConstant, nil}, - {`-|==|~=|<|>|<=|>=|&&|&|~|\|\|?`, Operator, nil}, - {`\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\`, Operator, nil}, - {`[\[\](){}@.,=:;]`, Punctuation, nil}, - {`"[^"]*"`, LiteralString, nil}, - {`(?<=[\w)\].])\'+`, Operator, nil}, - {`(?|+=@:,./?-]+`, Operator, nil}, - {`[\[\]()]+`, Punctuation, nil}, - {`"`, LiteralStringDouble, Push("string-double")}, - {`'`, LiteralStringSingle, Push("string-single")}, - {`[a-z_-][\w-]*`, Name, nil}, - {`\n`, Text, nil}, - {`[;{}]`, Punctuation, Pop(1)}, - }, - "interpolation": { - {`\}`, LiteralStringInterpol, Pop(1)}, - Include("value"), - }, - "selector": { - {`[ \t]+`, Text, nil}, - {`\:`, NameDecorator, Push("pseudo-class")}, - {`\.`, NameClass, Push("class")}, - {`\#`, NameNamespace, Push("id")}, - {`[\w-]+`, NameTag, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`&`, Keyword, nil}, - {`[~^*!&\[\]()<>|+=@:,./?-]`, Operator, nil}, - {`"`, LiteralStringDouble, Push("string-double")}, - {`'`, LiteralStringSingle, Push("string-single")}, - {`\n`, Text, nil}, - {`[;{}]`, Punctuation, Pop(1)}, - }, - "string-double": { - {`(\\.|#(?=[^\n{])|[^\n"#])+`, LiteralStringDouble, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "string-single": { - {`(\\.|#(?=[^\n{])|[^\n'#])+`, LiteralStringSingle, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "string-url": { - {`(\\#|#(?=[^\n{])|[^\n#)])+`, LiteralStringOther, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - {`\)`, LiteralStringOther, Pop(1)}, - }, - "pseudo-class": { - {`[\w-]+`, NameDecorator, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "class": { - {`[\w-]+`, NameClass, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "id": { - {`[\w-]+`, NameNamespace, nil}, - {`#\{`, LiteralStringInterpol, Push("interpolation")}, - Default(Pop(1)), - }, - "for": { - {`(from|to|through)`, OperatorWord, nil}, - Include("value"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/smalltalk.go b/vendor/github.com/alecthomas/chroma/lexers/s/smalltalk.go deleted file mode 100644 index db64707f..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/smalltalk.go +++ /dev/null @@ -1,99 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Smalltalk lexer. -var Smalltalk = internal.Register(MustNewLexer( - &Config{ - Name: "Smalltalk", - Aliases: []string{"smalltalk", "squeak", "st"}, - Filenames: []string{"*.st"}, - MimeTypes: []string{"text/x-smalltalk"}, - }, - Rules{ - "root": { - {`(<)(\w+:)(.*?)(>)`, ByGroups(Text, Keyword, Text, Text), nil}, - Include("squeak fileout"), - Include("whitespaces"), - Include("method definition"), - {`(\|)([\w\s]*)(\|)`, ByGroups(Operator, NameVariable, Operator), nil}, - Include("objects"), - {`\^|:=|_`, Operator, nil}, - {`[\]({}.;!]`, Text, nil}, - }, - "method definition": { - {`([a-zA-Z]+\w*:)(\s*)(\w+)`, ByGroups(NameFunction, Text, NameVariable), nil}, - {`^(\b[a-zA-Z]+\w*\b)(\s*)$`, ByGroups(NameFunction, Text), nil}, - {`^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$`, ByGroups(NameFunction, Text, NameVariable, Text), nil}, - }, - "blockvariables": { - Include("whitespaces"), - {`(:)(\s*)(\w+)`, ByGroups(Operator, Text, NameVariable), nil}, - {`\|`, Operator, Pop(1)}, - Default(Pop(1)), - }, - "literals": { - {`'(''|[^'])*'`, LiteralString, Push("afterobject")}, - {`\$.`, LiteralStringChar, Push("afterobject")}, - {`#\(`, LiteralStringSymbol, Push("parenth")}, - {`\)`, Text, Push("afterobject")}, - {`(\d+r)?-?\d+(\.\d+)?(e-?\d+)?`, LiteralNumber, Push("afterobject")}, - }, - "_parenth_helper": { - Include("whitespaces"), - {`(\d+r)?-?\d+(\.\d+)?(e-?\d+)?`, LiteralNumber, nil}, - {`[-+*/\\~<>=|&#!?,@%\w:]+`, LiteralStringSymbol, nil}, - {`'(''|[^'])*'`, LiteralString, nil}, - {`\$.`, LiteralStringChar, nil}, - {`#*\(`, LiteralStringSymbol, Push("inner_parenth")}, - }, - "parenth": { - {`\)`, LiteralStringSymbol, Push("root", "afterobject")}, - Include("_parenth_helper"), - }, - "inner_parenth": { - {`\)`, LiteralStringSymbol, Pop(1)}, - Include("_parenth_helper"), - }, - "whitespaces": { - {`\s+`, Text, nil}, - {`"(""|[^"])*"`, Comment, nil}, - }, - "objects": { - {`\[`, Text, Push("blockvariables")}, - {`\]`, Text, Push("afterobject")}, - {`\b(self|super|true|false|nil|thisContext)\b`, NameBuiltinPseudo, Push("afterobject")}, - {`\b[A-Z]\w*(?!:)\b`, NameClass, Push("afterobject")}, - {`\b[a-z]\w*(?!:)\b`, NameVariable, Push("afterobject")}, - {`#("(""|[^"])*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)`, LiteralStringSymbol, Push("afterobject")}, - Include("literals"), - }, - "afterobject": { - {`! !$`, Keyword, Pop(1)}, - Include("whitespaces"), - {`\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)`, NameBuiltin, Pop(1)}, - {`\b(new\b(?!:))`, NameBuiltin, nil}, - {`:=|_`, Operator, Pop(1)}, - {`\b[a-zA-Z]+\w*:`, NameFunction, Pop(1)}, - {`\b[a-zA-Z]+\w*`, NameFunction, nil}, - {`\w+:?|[-+*/\\~<>=|&!?,@%]+`, NameFunction, Pop(1)}, - {`\.`, Punctuation, Pop(1)}, - {`;`, Punctuation, nil}, - {`[\])}]`, Text, nil}, - {`[\[({]`, Text, Pop(1)}, - }, - "squeak fileout": { - {`^"(""|[^"])*"!`, Keyword, nil}, - {`^'(''|[^'])*'!`, Keyword, nil}, - {`^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)`, ByGroups(Keyword, NameClass, Keyword, LiteralString, Keyword, Text, Keyword), nil}, - {`^(!)(\w+(?: class)?)( methodsFor: )('(?:''|[^'])*')(.*?!)`, ByGroups(Keyword, NameClass, Keyword, LiteralString, Keyword), nil}, - {`^(\w+)( subclass: )(#\w+)(\s+instanceVariableNames: )(.*?)(\s+classVariableNames: )(.*?)(\s+poolDictionaries: )(.*?)(\s+category: )(.*?)(!)`, ByGroups(NameClass, Keyword, LiteralStringSymbol, Keyword, LiteralString, Keyword, LiteralString, Keyword, LiteralString, Keyword, LiteralString, Keyword), nil}, - {`^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)`, ByGroups(NameClass, Keyword, LiteralString, Keyword), nil}, - {`(!\n)(\].*)(! !)$`, ByGroups(Keyword, Text, Keyword), nil}, - {`! !$`, Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/smarty.go b/vendor/github.com/alecthomas/chroma/lexers/s/smarty.go deleted file mode 100644 index c364ffa5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/smarty.go +++ /dev/null @@ -1,40 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - . "github.com/alecthomas/chroma/lexers/circular" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Smarty lexer. -var Smarty = internal.Register(MustNewLexer( - &Config{ - Name: "Smarty", - Aliases: []string{"smarty"}, - Filenames: []string{"*.tpl"}, - MimeTypes: []string{"application/x-smarty"}, - DotAll: true, - }, - Rules{ - "root": { - {`[^{]+`, Other, nil}, - {`(\{)(\*.*?\*)(\})`, ByGroups(CommentPreproc, Comment, CommentPreproc), nil}, - {`(\{php\})(.*?)(\{/php\})`, ByGroups(CommentPreproc, Using(PHP), CommentPreproc), nil}, - {`(\{)(/?[a-zA-Z_]\w*)(\s*)`, ByGroups(CommentPreproc, NameFunction, Text), Push("smarty")}, - {`\{`, CommentPreproc, Push("smarty")}, - }, - "smarty": { - {`\s+`, Text, nil}, - {`\{`, CommentPreproc, Push()}, - {`\}`, CommentPreproc, Pop(1)}, - {`#[a-zA-Z_]\w*#`, NameVariable, nil}, - {`\$[a-zA-Z_]\w*(\.\w+)*`, NameVariable, nil}, - {`[~!%^&*()+=|\[\]:;,.<>/?@-]`, Operator, nil}, - {`(true|false|null)\b`, KeywordConstant, nil}, - {`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`[a-zA-Z_]\w*`, NameAttribute, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/sml.go b/vendor/github.com/alecthomas/chroma/lexers/s/sml.go deleted file mode 100644 index f716d92b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/sml.go +++ /dev/null @@ -1,200 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Standard ML lexer. -var StandardML = internal.Register(MustNewLexer( - &Config{ - Name: "Standard ML", - Aliases: []string{"sml"}, - Filenames: []string{"*.sml", "*.sig", "*.fun"}, - MimeTypes: []string{"text/x-standardml", "application/x-standardml"}, - }, - Rules{ - "whitespace": { - {`\s+`, Text, nil}, - {`\(\*`, CommentMultiline, Push("comment")}, - }, - "delimiters": { - {`\(|\[|\{`, Punctuation, Push("main")}, - {`\)|\]|\}`, Punctuation, Pop(1)}, - {`\b(let|if|local)\b(?!\')`, KeywordReserved, Push("main", "main")}, - {`\b(struct|sig|while)\b(?!\')`, KeywordReserved, Push("main")}, - {`\b(do|else|end|in|then)\b(?!\')`, KeywordReserved, Pop(1)}, - }, - "core": { - {`(_|\}|\{|\)|;|,|\[|\(|\]|\.\.\.)`, Punctuation, nil}, - {`#"`, LiteralStringChar, Push("char")}, - {`"`, LiteralStringDouble, Push("string")}, - {`~?0x[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`0wx[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`0w\d+`, LiteralNumberInteger, nil}, - {`~?\d+\.\d+[eE]~?\d+`, LiteralNumberFloat, nil}, - {`~?\d+\.\d+`, LiteralNumberFloat, nil}, - {`~?\d+[eE]~?\d+`, LiteralNumberFloat, nil}, - {`~?\d+`, LiteralNumberInteger, nil}, - {`#\s*[1-9][0-9]*`, NameLabel, nil}, - {`#\s*([a-zA-Z][\w']*)`, NameLabel, nil}, - {"#\\s+([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", NameLabel, nil}, - {`\b(datatype|abstype)\b(?!\')`, KeywordReserved, Push("dname")}, - {`(?=\b(exception)\b(?!\'))`, Text, Push("ename")}, - {`\b(functor|include|open|signature|structure)\b(?!\')`, KeywordReserved, Push("sname")}, - {`\b(type|eqtype)\b(?!\')`, KeywordReserved, Push("tname")}, - {`\'[\w\']*`, NameDecorator, nil}, - {`([a-zA-Z][\w']*)(\.)`, NameNamespace, Push("dotted")}, - {`\b(abstype|and|andalso|as|case|datatype|do|else|end|exception|fn|fun|handle|if|in|infix|infixr|let|local|nonfix|of|op|open|orelse|raise|rec|then|type|val|with|withtype|while|eqtype|functor|include|sharing|sig|signature|struct|structure|where)\b`, KeywordReserved, nil}, - {`([a-zA-Z][\w']*)`, Name, nil}, - {`\b(:|\|,=|=>|->|#|:>)\b`, KeywordReserved, nil}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", Name, nil}, - }, - "dotted": { - {`([a-zA-Z][\w']*)(\.)`, NameNamespace, nil}, - // ignoring reserved words - {`([a-zA-Z][\w']*)`, Name, Pop(1)}, - // ignoring reserved words - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", Name, Pop(1)}, - {`\s+`, Error, nil}, - {`\S+`, Error, nil}, - }, - "root": { - Default(Push("main")), - }, - "main": { - Include("whitespace"), - {`\b(val|and)\b(?!\')`, KeywordReserved, Push("vname")}, - {`\b(fun)\b(?!\')`, KeywordReserved, Push("#pop", "main-fun", "fname")}, - Include("delimiters"), - Include("core"), - {`\S+`, Error, nil}, - }, - "main-fun": { - Include("whitespace"), - {`\s`, Text, nil}, - {`\(\*`, CommentMultiline, Push("comment")}, - {`\b(fun|and)\b(?!\')`, KeywordReserved, Push("fname")}, - {`\b(val)\b(?!\')`, KeywordReserved, Push("#pop", "main", "vname")}, - {`\|`, Punctuation, Push("fname")}, - {`\b(case|handle)\b(?!\')`, KeywordReserved, Push("#pop", "main")}, - Include("delimiters"), - Include("core"), - {`\S+`, Error, nil}, - }, - "char": { - {`[^"\\]`, LiteralStringChar, nil}, - {`\\[\\"abtnvfr]`, LiteralStringEscape, nil}, - {`\\\^[\x40-\x5e]`, LiteralStringEscape, nil}, - {`\\[0-9]{3}`, LiteralStringEscape, nil}, - {`\\u[0-9a-fA-F]{4}`, LiteralStringEscape, nil}, - {`\\\s+\\`, LiteralStringInterpol, nil}, - {`"`, LiteralStringChar, Pop(1)}, - }, - "string": { - {`[^"\\]`, LiteralStringDouble, nil}, - {`\\[\\"abtnvfr]`, LiteralStringEscape, nil}, - {`\\\^[\x40-\x5e]`, LiteralStringEscape, nil}, - {`\\[0-9]{3}`, LiteralStringEscape, nil}, - {`\\u[0-9a-fA-F]{4}`, LiteralStringEscape, nil}, - {`\\\s+\\`, LiteralStringInterpol, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "breakout": { - {`(?=\b(where|do|handle|if|sig|op|while|case|as|else|signature|andalso|struct|infixr|functor|in|structure|then|local|rec|end|fun|of|orelse|val|include|fn|with|exception|let|and|infix|sharing|datatype|type|abstype|withtype|eqtype|nonfix|raise|open)\b(?!\'))`, Text, Pop(1)}, - }, - "sname": { - Include("whitespace"), - Include("breakout"), - {`([a-zA-Z][\w']*)`, NameNamespace, nil}, - Default(Pop(1)), - }, - "fname": { - Include("whitespace"), - {`\'[\w\']*`, NameDecorator, nil}, - {`\(`, Punctuation, Push("tyvarseq")}, - {`([a-zA-Z][\w']*)`, NameFunction, Pop(1)}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", NameFunction, Pop(1)}, - Default(Pop(1)), - }, - "vname": { - Include("whitespace"), - {`\'[\w\']*`, NameDecorator, nil}, - {`\(`, Punctuation, Push("tyvarseq")}, - {"([a-zA-Z][\\w']*)(\\s*)(=(?![!%&$#+\\-/:<=>?@\\\\~`^|*]+))", ByGroups(NameVariable, Text, Punctuation), Pop(1)}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)(\\s*)(=(?![!%&$#+\\-/:<=>?@\\\\~`^|*]+))", ByGroups(NameVariable, Text, Punctuation), Pop(1)}, - {`([a-zA-Z][\w']*)`, NameVariable, Pop(1)}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", NameVariable, Pop(1)}, - Default(Pop(1)), - }, - "tname": { - Include("whitespace"), - Include("breakout"), - {`\'[\w\']*`, NameDecorator, nil}, - {`\(`, Punctuation, Push("tyvarseq")}, - {"=(?![!%&$#+\\-/:<=>?@\\\\~`^|*]+)", Punctuation, Push("#pop", "typbind")}, - {`([a-zA-Z][\w']*)`, KeywordType, nil}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", KeywordType, nil}, - {`\S+`, Error, Pop(1)}, - }, - "typbind": { - Include("whitespace"), - {`\b(and)\b(?!\')`, KeywordReserved, Push("#pop", "tname")}, - Include("breakout"), - Include("core"), - {`\S+`, Error, Pop(1)}, - }, - "dname": { - Include("whitespace"), - Include("breakout"), - {`\'[\w\']*`, NameDecorator, nil}, - {`\(`, Punctuation, Push("tyvarseq")}, - {`(=)(\s*)(datatype)`, ByGroups(Punctuation, Text, KeywordReserved), Pop(1)}, - {"=(?![!%&$#+\\-/:<=>?@\\\\~`^|*]+)", Punctuation, Push("#pop", "datbind", "datcon")}, - {`([a-zA-Z][\w']*)`, KeywordType, nil}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", KeywordType, nil}, - {`\S+`, Error, Pop(1)}, - }, - "datbind": { - Include("whitespace"), - {`\b(and)\b(?!\')`, KeywordReserved, Push("#pop", "dname")}, - {`\b(withtype)\b(?!\')`, KeywordReserved, Push("#pop", "tname")}, - {`\b(of)\b(?!\')`, KeywordReserved, nil}, - {`(\|)(\s*)([a-zA-Z][\w']*)`, ByGroups(Punctuation, Text, NameClass), nil}, - {"(\\|)(\\s+)([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", ByGroups(Punctuation, Text, NameClass), nil}, - Include("breakout"), - Include("core"), - {`\S+`, Error, nil}, - }, - "ename": { - Include("whitespace"), - {`(exception|and)\b(\s+)([a-zA-Z][\w']*)`, ByGroups(KeywordReserved, Text, NameClass), nil}, - {"(exception|and)\\b(\\s*)([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", ByGroups(KeywordReserved, Text, NameClass), nil}, - {`\b(of)\b(?!\')`, KeywordReserved, nil}, - Include("breakout"), - Include("core"), - {`\S+`, Error, nil}, - }, - "datcon": { - Include("whitespace"), - {`([a-zA-Z][\w']*)`, NameClass, Pop(1)}, - {"([!%&$#+\\-/:<=>?@\\\\~`^|*]+)", NameClass, Pop(1)}, - {`\S+`, Error, Pop(1)}, - }, - "tyvarseq": { - {`\s`, Text, nil}, - {`\(\*`, CommentMultiline, Push("comment")}, - {`\'[\w\']*`, NameDecorator, nil}, - {`[a-zA-Z][\w']*`, Name, nil}, - {`,`, Punctuation, nil}, - {`\)`, Punctuation, Pop(1)}, - {"[!%&$#+\\-/:<=>?@\\\\~`^|*]+", Name, nil}, - }, - "comment": { - {`[^(*)]`, CommentMultiline, nil}, - {`\(\*`, CommentMultiline, Push()}, - {`\*\)`, CommentMultiline, Pop(1)}, - {`[(*)]`, CommentMultiline, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/snobol.go b/vendor/github.com/alecthomas/chroma/lexers/s/snobol.go deleted file mode 100644 index c999b50f..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/snobol.go +++ /dev/null @@ -1,48 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Snobol lexer. -var Snobol = internal.Register(MustNewLexer( - &Config{ - Name: "Snobol", - Aliases: []string{"snobol"}, - Filenames: []string{"*.snobol"}, - MimeTypes: []string{"text/x-snobol"}, - }, - Rules{ - "root": { - {`\*.*\n`, Comment, nil}, - {`[+.] `, Punctuation, Push("statement")}, - {`-.*\n`, Comment, nil}, - {`END\s*\n`, NameLabel, Push("heredoc")}, - {`[A-Za-z$][\w$]*`, NameLabel, Push("statement")}, - {`\s+`, Text, Push("statement")}, - }, - "statement": { - {`\s*\n`, Text, Pop(1)}, - {`\s+`, Text, nil}, - {`(?<=[^\w.])(LT|LE|EQ|NE|GE|GT|INTEGER|IDENT|DIFFER|LGT|SIZE|REPLACE|TRIM|DUPL|REMDR|DATE|TIME|EVAL|APPLY|OPSYN|LOAD|UNLOAD|LEN|SPAN|BREAK|ANY|NOTANY|TAB|RTAB|REM|POS|RPOS|FAIL|FENCE|ABORT|ARB|ARBNO|BAL|SUCCEED|INPUT|OUTPUT|TERMINAL)(?=[^\w.])`, NameBuiltin, nil}, - {`[A-Za-z][\w.]*`, Name, nil}, - {`\*\*|[?$.!%*/#+\-@|&\\=]`, Operator, nil}, - {`"[^"]*"`, LiteralString, nil}, - {`'[^']*'`, LiteralString, nil}, - {`[0-9]+(?=[^.EeDd])`, LiteralNumberInteger, nil}, - {`[0-9]+(\.[0-9]*)?([EDed][-+]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`:`, Punctuation, Push("goto")}, - {`[()<>,;]`, Punctuation, nil}, - }, - "goto": { - {`\s*\n`, Text, Pop(2)}, - {`\s+`, Text, nil}, - {`F|S`, Keyword, nil}, - {`(\()([A-Za-z][\w.]*)(\))`, ByGroups(Punctuation, NameLabel, Punctuation), nil}, - }, - "heredoc": { - {`.*\n`, LiteralStringHeredoc, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/solidity.go b/vendor/github.com/alecthomas/chroma/lexers/s/solidity.go deleted file mode 100644 index d7cf0f97..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/solidity.go +++ /dev/null @@ -1,110 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Solidity lexer. -var Solidity = internal.Register(MustNewLexer( - &Config{ - Name: "Solidity", - Aliases: []string{"sol", "solidity"}, - Filenames: []string{"*.sol"}, - MimeTypes: []string{}, - DotAll: true, - }, - Rules{ - "assembly": { - Include("comments"), - Include("numbers"), - Include("strings"), - Include("whitespace"), - {`\{`, Punctuation, Push()}, - {`\}`, Punctuation, Pop(1)}, - {`[(),]`, Punctuation, nil}, - {`:=|=:`, Operator, nil}, - {`(let)(\s*)(\w*\b)`, ByGroups(OperatorWord, Text, NameVariable), nil}, - {`(\w*\b)(\:[^=])`, ByGroups(NameLabel, Punctuation), nil}, - {`(stop|add|mul|sub|div|sdiv|mod|smod|addmod|mulmod|exp|signextend|lt|gt|slt|sgt|eq|iszero|and|or|xor|not|byte|keccak256|sha3|address|balance|origin|caller|callvalue|calldataload|calldatasize|calldatacopy|codesize|codecopy|gasprice|extcodesize|extcodecopy|blockhash|coinbase|timestamp|number|difficulty|gaslimit|pop|mload|mstore|mstore8|sload|sstore|for|switch|jump|jumpi|pc|msize|gas|jumpdest|push1|push2|push32|dup1|dup2|dup16|swap1|swap2|swap16|log0|log1|log4|create|call|callcode|return|delegatecall|suicide|returndatasize|returndatacopy|staticcall|revert|invalid)\b`, NameFunction, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "comments": { - {`//([\w\W]*?\n)`, CommentSingle, nil}, - {`/[*][\w\W]*?[*]/`, CommentMultiline, nil}, - {`/[*][\w\W]*`, CommentMultiline, nil}, - }, - "keywords-other": { - {Words(``, `\b`, `for`, `in`, `while`, `do`, `break`, `return`, `returns`, `continue`, `if`, `else`, `throw`, `new`, `delete`), Keyword, nil}, - {`assembly\b`, Keyword, Push("assembly")}, - {Words(``, `\b`, `contract`, `interface`, `enum`, `event`, `function`, `library`, `mapping`, `modifier`, `struct`, `var`), KeywordDeclaration, nil}, - {`(import|using)\b`, KeywordNamespace, nil}, - {`pragma (solidity|experimental)\b`, KeywordReserved, nil}, - {`(_|as|constant|default|from|is)\b`, KeywordReserved, nil}, - {`payable\b`, KeywordReserved, nil}, - {`(memory|storage)\b`, KeywordReserved, nil}, - {`(external|internal|private|public)\b`, KeywordReserved, nil}, - {`(anonymous|indexed)\b`, KeywordReserved, nil}, - {`(abstract|pure|static|view)\b`, KeywordReserved, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`(wei|finney|szabo|ether)\b`, KeywordConstant, nil}, - {`(seconds|minutes|hours|days|weeks|years)\b`, KeywordConstant, nil}, - }, - "keywords-types": { - {Words(``, `\b`, `address`, `bool`, `byte`, `bytes`, `int`, `fixed`, `string`, `ufixed`, `uint`), KeywordType, nil}, - {Words(``, `\b`, `int8`, `int16`, `int24`, `int32`, `int40`, `int48`, `int56`, `int64`, `int72`, `int80`, `int88`, `int96`, `int104`, `int112`, `int120`, `int128`, `int136`, `int144`, `int152`, `int160`, `int168`, `int176`, `int184`, `int192`, `int200`, `int208`, `int216`, `int224`, `int232`, `int240`, `int248`, `int256`), KeywordType, nil}, - {Words(``, `\b`, `uint8`, `uint16`, `uint24`, `uint32`, `uint40`, `uint48`, `uint56`, `uint64`, `uint72`, `uint80`, `uint88`, `uint96`, `uint104`, `uint112`, `uint120`, `uint128`, `uint136`, `uint144`, `uint152`, `uint160`, `uint168`, `uint176`, `uint184`, `uint192`, `uint200`, `uint208`, `uint216`, `uint224`, `uint232`, `uint240`, `uint248`, `uint256`), KeywordType, nil}, - {Words(``, `\b`, `bytes1`, `bytes2`, `bytes3`, `bytes4`, `bytes5`, `bytes6`, `bytes7`, `bytes8`, `bytes9`, `bytes10`, `bytes11`, `bytes12`, `bytes13`, `bytes14`, `bytes15`, `bytes16`, `bytes17`, `bytes18`, `bytes19`, `bytes20`, `bytes21`, `bytes22`, `bytes23`, `bytes24`, `bytes25`, `bytes26`, `bytes27`, `bytes28`, `bytes29`, `bytes30`, `bytes31`, `bytes32`), KeywordType, nil}, - {Words(``, `\b`, `fixed8x0`, `fixed8x1`, `fixed8x2`, `fixed8x3`, `fixed8x4`, `fixed8x5`, `fixed8x6`, `fixed8x7`, `fixed8x8`, `fixed8x9`, `fixed8x10`, `fixed8x11`, `fixed8x12`, `fixed8x13`, `fixed8x14`, `fixed8x15`, `fixed8x16`, `fixed8x17`, `fixed8x18`, `fixed8x19`, `fixed8x20`, `fixed8x21`, `fixed8x22`, `fixed8x23`, `fixed8x24`, `fixed8x25`, `fixed8x26`, `fixed8x27`, `fixed8x28`, `fixed8x29`, `fixed8x30`, `fixed8x31`, `fixed8x32`, `fixed8x33`, `fixed8x34`, `fixed8x35`, `fixed8x36`, `fixed8x37`, `fixed8x38`, `fixed8x39`, `fixed8x40`, `fixed8x41`, `fixed8x42`, `fixed8x43`, `fixed8x44`, `fixed8x45`, `fixed8x46`, `fixed8x47`, `fixed8x48`, `fixed8x49`, `fixed8x50`, `fixed8x51`, `fixed8x52`, `fixed8x53`, `fixed8x54`, `fixed8x55`, `fixed8x56`, `fixed8x57`, `fixed8x58`, `fixed8x59`, `fixed8x60`, `fixed8x61`, `fixed8x62`, `fixed8x63`, `fixed8x64`, `fixed8x65`, `fixed8x66`, `fixed8x67`, `fixed8x68`, `fixed8x69`, `fixed8x70`, `fixed8x71`, `fixed8x72`, `fixed8x73`, `fixed8x74`, `fixed8x75`, `fixed8x76`, `fixed8x77`, `fixed8x78`, `fixed8x79`, `fixed8x80`, `fixed16x0`, `fixed16x1`, `fixed16x2`, `fixed16x3`, `fixed16x4`, `fixed16x5`, `fixed16x6`, `fixed16x7`, `fixed16x8`, `fixed16x9`, `fixed16x10`, `fixed16x11`, `fixed16x12`, `fixed16x13`, `fixed16x14`, `fixed16x15`, `fixed16x16`, `fixed16x17`, `fixed16x18`, `fixed16x19`, `fixed16x20`, `fixed16x21`, `fixed16x22`, `fixed16x23`, `fixed16x24`, `fixed16x25`, `fixed16x26`, `fixed16x27`, `fixed16x28`, `fixed16x29`, `fixed16x30`, `fixed16x31`, `fixed16x32`, `fixed16x33`, `fixed16x34`, `fixed16x35`, `fixed16x36`, `fixed16x37`, `fixed16x38`, `fixed16x39`, `fixed16x40`, `fixed16x41`, `fixed16x42`, `fixed16x43`, `fixed16x44`, `fixed16x45`, `fixed16x46`, `fixed16x47`, `fixed16x48`, `fixed16x49`, `fixed16x50`, `fixed16x51`, `fixed16x52`, `fixed16x53`, `fixed16x54`, `fixed16x55`, `fixed16x56`, `fixed16x57`, `fixed16x58`, `fixed16x59`, `fixed16x60`, `fixed16x61`, `fixed16x62`, `fixed16x63`, `fixed16x64`, `fixed16x65`, `fixed16x66`, `fixed16x67`, `fixed16x68`, `fixed16x69`, `fixed16x70`, `fixed16x71`, `fixed16x72`, `fixed16x73`, `fixed16x74`, `fixed16x75`, `fixed16x76`, `fixed16x77`, `fixed16x78`, `fixed16x79`, `fixed16x80`, `fixed24x0`, `fixed24x1`, `fixed24x2`, `fixed24x3`, `fixed24x4`, `fixed24x5`, `fixed24x6`, `fixed24x7`, `fixed24x8`, `fixed24x9`, `fixed24x10`, `fixed24x11`, `fixed24x12`, `fixed24x13`, `fixed24x14`, `fixed24x15`, `fixed24x16`, `fixed24x17`, `fixed24x18`, `fixed24x19`, `fixed24x20`, `fixed24x21`, `fixed24x22`, `fixed24x23`, `fixed24x24`, `fixed24x25`, `fixed24x26`, `fixed24x27`, `fixed24x28`, `fixed24x29`, `fixed24x30`, `fixed24x31`, `fixed24x32`, `fixed24x33`, `fixed24x34`, `fixed24x35`, `fixed24x36`, `fixed24x37`, `fixed24x38`, `fixed24x39`, `fixed24x40`, `fixed24x41`, `fixed24x42`, `fixed24x43`, `fixed24x44`, `fixed24x45`, `fixed24x46`, `fixed24x47`, `fixed24x48`, `fixed24x49`, `fixed24x50`, `fixed24x51`, `fixed24x52`, `fixed24x53`, `fixed24x54`, `fixed24x55`, `fixed24x56`, `fixed24x57`, `fixed24x58`, `fixed24x59`, `fixed24x60`, `fixed24x61`, `fixed24x62`, `fixed24x63`, `fixed24x64`, `fixed24x65`, `fixed24x66`, `fixed24x67`, `fixed24x68`, `fixed24x69`, `fixed24x70`, `fixed24x71`, `fixed24x72`, `fixed24x73`, `fixed24x74`, `fixed24x75`, `fixed24x76`, `fixed24x77`, `fixed24x78`, `fixed24x79`, `fixed24x80`, `fixed32x0`, `fixed32x1`, `fixed32x2`, `fixed32x3`, `fixed32x4`, `fixed32x5`, `fixed32x6`, `fixed32x7`, `fixed32x8`, `fixed32x9`, `fixed32x10`, `fixed32x11`, `fixed32x12`, `fixed32x13`, `fixed32x14`, `fixed32x15`, `fixed32x16`, `fixed32x17`, `fixed32x18`, `fixed32x19`, `fixed32x20`, `fixed32x21`, `fixed32x22`, `fixed32x23`, `fixed32x24`, `fixed32x25`, `fixed32x26`, `fixed32x27`, `fixed32x28`, `fixed32x29`, `fixed32x30`, `fixed32x31`, `fixed32x32`, `fixed32x33`, `fixed32x34`, `fixed32x35`, `fixed32x36`, `fixed32x37`, `fixed32x38`, `fixed32x39`, `fixed32x40`, `fixed32x41`, `fixed32x42`, `fixed32x43`, `fixed32x44`, `fixed32x45`, `fixed32x46`, `fixed32x47`, `fixed32x48`, `fixed32x49`, `fixed32x50`, `fixed32x51`, `fixed32x52`, `fixed32x53`, `fixed32x54`, `fixed32x55`, `fixed32x56`, `fixed32x57`, `fixed32x58`, `fixed32x59`, `fixed32x60`, `fixed32x61`, `fixed32x62`, `fixed32x63`, `fixed32x64`, `fixed32x65`, `fixed32x66`, `fixed32x67`, `fixed32x68`, `fixed32x69`, `fixed32x70`, `fixed32x71`, `fixed32x72`, `fixed32x73`, `fixed32x74`, `fixed32x75`, `fixed32x76`, `fixed32x77`, `fixed32x78`, `fixed32x79`, `fixed32x80`, `fixed40x0`, `fixed40x1`, `fixed40x2`, `fixed40x3`, `fixed40x4`, `fixed40x5`, `fixed40x6`, `fixed40x7`, `fixed40x8`, `fixed40x9`, `fixed40x10`, `fixed40x11`, `fixed40x12`, `fixed40x13`, `fixed40x14`, `fixed40x15`, `fixed40x16`, `fixed40x17`, `fixed40x18`, `fixed40x19`, `fixed40x20`, `fixed40x21`, `fixed40x22`, `fixed40x23`, `fixed40x24`, `fixed40x25`, `fixed40x26`, `fixed40x27`, `fixed40x28`, `fixed40x29`, `fixed40x30`, `fixed40x31`, `fixed40x32`, `fixed40x33`, `fixed40x34`, `fixed40x35`, `fixed40x36`, `fixed40x37`, `fixed40x38`, `fixed40x39`, `fixed40x40`, `fixed40x41`, `fixed40x42`, `fixed40x43`, `fixed40x44`, `fixed40x45`, `fixed40x46`, `fixed40x47`, `fixed40x48`, `fixed40x49`, `fixed40x50`, `fixed40x51`, `fixed40x52`, `fixed40x53`, `fixed40x54`, `fixed40x55`, `fixed40x56`, `fixed40x57`, `fixed40x58`, `fixed40x59`, `fixed40x60`, `fixed40x61`, `fixed40x62`, `fixed40x63`, `fixed40x64`, `fixed40x65`, `fixed40x66`, `fixed40x67`, `fixed40x68`, `fixed40x69`, `fixed40x70`, `fixed40x71`, `fixed40x72`, `fixed40x73`, `fixed40x74`, `fixed40x75`, `fixed40x76`, `fixed40x77`, `fixed40x78`, `fixed40x79`, `fixed40x80`, `fixed48x0`, `fixed48x1`, `fixed48x2`, `fixed48x3`, `fixed48x4`, `fixed48x5`, `fixed48x6`, `fixed48x7`, `fixed48x8`, `fixed48x9`, `fixed48x10`, `fixed48x11`, `fixed48x12`, `fixed48x13`, `fixed48x14`, `fixed48x15`, `fixed48x16`, `fixed48x17`, `fixed48x18`, `fixed48x19`, `fixed48x20`, `fixed48x21`, `fixed48x22`, `fixed48x23`, `fixed48x24`, `fixed48x25`, `fixed48x26`, `fixed48x27`, `fixed48x28`, `fixed48x29`, `fixed48x30`, `fixed48x31`, `fixed48x32`, `fixed48x33`, `fixed48x34`, `fixed48x35`, `fixed48x36`, `fixed48x37`, `fixed48x38`, `fixed48x39`, `fixed48x40`, `fixed48x41`, `fixed48x42`, `fixed48x43`, `fixed48x44`, `fixed48x45`, `fixed48x46`, `fixed48x47`, `fixed48x48`, `fixed48x49`, `fixed48x50`, `fixed48x51`, `fixed48x52`, `fixed48x53`, `fixed48x54`, `fixed48x55`, `fixed48x56`, `fixed48x57`, `fixed48x58`, `fixed48x59`, `fixed48x60`, `fixed48x61`, `fixed48x62`, `fixed48x63`, `fixed48x64`, `fixed48x65`, `fixed48x66`, `fixed48x67`, `fixed48x68`, `fixed48x69`, `fixed48x70`, `fixed48x71`, `fixed48x72`, `fixed48x73`, `fixed48x74`, `fixed48x75`, `fixed48x76`, `fixed48x77`, `fixed48x78`, `fixed48x79`, `fixed48x80`, `fixed56x0`, `fixed56x1`, `fixed56x2`, `fixed56x3`, `fixed56x4`, `fixed56x5`, `fixed56x6`, `fixed56x7`, `fixed56x8`, `fixed56x9`, `fixed56x10`, `fixed56x11`, `fixed56x12`, `fixed56x13`, `fixed56x14`, `fixed56x15`, `fixed56x16`, `fixed56x17`, `fixed56x18`, `fixed56x19`, `fixed56x20`, `fixed56x21`, `fixed56x22`, `fixed56x23`, `fixed56x24`, `fixed56x25`, `fixed56x26`, `fixed56x27`, `fixed56x28`, `fixed56x29`, `fixed56x30`, `fixed56x31`, `fixed56x32`, `fixed56x33`, `fixed56x34`, `fixed56x35`, `fixed56x36`, `fixed56x37`, `fixed56x38`, `fixed56x39`, `fixed56x40`, `fixed56x41`, `fixed56x42`, `fixed56x43`, `fixed56x44`, `fixed56x45`, `fixed56x46`, `fixed56x47`, `fixed56x48`, `fixed56x49`, `fixed56x50`, `fixed56x51`, `fixed56x52`, `fixed56x53`, `fixed56x54`, `fixed56x55`, `fixed56x56`, `fixed56x57`, `fixed56x58`, `fixed56x59`, `fixed56x60`, `fixed56x61`, `fixed56x62`, `fixed56x63`, `fixed56x64`, `fixed56x65`, `fixed56x66`, `fixed56x67`, `fixed56x68`, `fixed56x69`, `fixed56x70`, `fixed56x71`, `fixed56x72`, `fixed56x73`, `fixed56x74`, `fixed56x75`, `fixed56x76`, `fixed56x77`, `fixed56x78`, `fixed56x79`, `fixed56x80`, `fixed64x0`, `fixed64x1`, `fixed64x2`, `fixed64x3`, `fixed64x4`, `fixed64x5`, `fixed64x6`, `fixed64x7`, `fixed64x8`, `fixed64x9`, `fixed64x10`, `fixed64x11`, `fixed64x12`, `fixed64x13`, `fixed64x14`, `fixed64x15`, `fixed64x16`, `fixed64x17`, `fixed64x18`, `fixed64x19`, `fixed64x20`, `fixed64x21`, `fixed64x22`, `fixed64x23`, `fixed64x24`, `fixed64x25`, `fixed64x26`, `fixed64x27`, `fixed64x28`, `fixed64x29`, `fixed64x30`, `fixed64x31`, `fixed64x32`, `fixed64x33`, `fixed64x34`, `fixed64x35`, `fixed64x36`, `fixed64x37`, `fixed64x38`, `fixed64x39`, `fixed64x40`, `fixed64x41`, `fixed64x42`, `fixed64x43`, `fixed64x44`, `fixed64x45`, `fixed64x46`, `fixed64x47`, `fixed64x48`, `fixed64x49`, `fixed64x50`, `fixed64x51`, `fixed64x52`, `fixed64x53`, `fixed64x54`, `fixed64x55`, `fixed64x56`, `fixed64x57`, `fixed64x58`, `fixed64x59`, `fixed64x60`, `fixed64x61`, `fixed64x62`, `fixed64x63`, `fixed64x64`, `fixed64x65`, `fixed64x66`, `fixed64x67`, `fixed64x68`, `fixed64x69`, `fixed64x70`, `fixed64x71`, `fixed64x72`, `fixed64x73`, `fixed64x74`, `fixed64x75`, `fixed64x76`, `fixed64x77`, `fixed64x78`, `fixed64x79`, `fixed64x80`, `fixed72x0`, `fixed72x1`, `fixed72x2`, `fixed72x3`, `fixed72x4`, `fixed72x5`, `fixed72x6`, `fixed72x7`, `fixed72x8`, `fixed72x9`, `fixed72x10`, `fixed72x11`, `fixed72x12`, `fixed72x13`, `fixed72x14`, `fixed72x15`, `fixed72x16`, `fixed72x17`, `fixed72x18`, `fixed72x19`, `fixed72x20`, `fixed72x21`, `fixed72x22`, `fixed72x23`, `fixed72x24`, `fixed72x25`, `fixed72x26`, `fixed72x27`, `fixed72x28`, `fixed72x29`, `fixed72x30`, `fixed72x31`, `fixed72x32`, `fixed72x33`, `fixed72x34`, `fixed72x35`, `fixed72x36`, `fixed72x37`, `fixed72x38`, `fixed72x39`, `fixed72x40`, `fixed72x41`, `fixed72x42`, `fixed72x43`, `fixed72x44`, `fixed72x45`, `fixed72x46`, `fixed72x47`, `fixed72x48`, `fixed72x49`, `fixed72x50`, `fixed72x51`, `fixed72x52`, `fixed72x53`, `fixed72x54`, `fixed72x55`, `fixed72x56`, `fixed72x57`, `fixed72x58`, `fixed72x59`, `fixed72x60`, `fixed72x61`, `fixed72x62`, `fixed72x63`, `fixed72x64`, `fixed72x65`, `fixed72x66`, `fixed72x67`, `fixed72x68`, `fixed72x69`, `fixed72x70`, `fixed72x71`, `fixed72x72`, `fixed72x73`, `fixed72x74`, `fixed72x75`, `fixed72x76`, `fixed72x77`, `fixed72x78`, `fixed72x79`, `fixed72x80`, `fixed80x0`, `fixed80x1`, `fixed80x2`, `fixed80x3`, `fixed80x4`, `fixed80x5`, `fixed80x6`, `fixed80x7`, `fixed80x8`, `fixed80x9`, `fixed80x10`, `fixed80x11`, `fixed80x12`, `fixed80x13`, `fixed80x14`, `fixed80x15`, `fixed80x16`, `fixed80x17`, `fixed80x18`, `fixed80x19`, `fixed80x20`, `fixed80x21`, `fixed80x22`, `fixed80x23`, `fixed80x24`, `fixed80x25`, `fixed80x26`, `fixed80x27`, `fixed80x28`, `fixed80x29`, `fixed80x30`, `fixed80x31`, `fixed80x32`, `fixed80x33`, `fixed80x34`, `fixed80x35`, `fixed80x36`, `fixed80x37`, `fixed80x38`, `fixed80x39`, `fixed80x40`, `fixed80x41`, `fixed80x42`, `fixed80x43`, `fixed80x44`, `fixed80x45`, `fixed80x46`, `fixed80x47`, `fixed80x48`, `fixed80x49`, `fixed80x50`, `fixed80x51`, `fixed80x52`, `fixed80x53`, `fixed80x54`, `fixed80x55`, `fixed80x56`, `fixed80x57`, `fixed80x58`, `fixed80x59`, `fixed80x60`, `fixed80x61`, `fixed80x62`, `fixed80x63`, `fixed80x64`, `fixed80x65`, `fixed80x66`, `fixed80x67`, `fixed80x68`, `fixed80x69`, `fixed80x70`, `fixed80x71`, `fixed80x72`, `fixed80x73`, `fixed80x74`, `fixed80x75`, `fixed80x76`, `fixed80x77`, `fixed80x78`, `fixed80x79`, `fixed80x80`, `fixed88x0`, `fixed88x1`, `fixed88x2`, `fixed88x3`, `fixed88x4`, `fixed88x5`, `fixed88x6`, `fixed88x7`, `fixed88x8`, `fixed88x9`, `fixed88x10`, `fixed88x11`, `fixed88x12`, `fixed88x13`, `fixed88x14`, `fixed88x15`, `fixed88x16`, `fixed88x17`, `fixed88x18`, `fixed88x19`, `fixed88x20`, `fixed88x21`, `fixed88x22`, `fixed88x23`, `fixed88x24`, `fixed88x25`, `fixed88x26`, `fixed88x27`, `fixed88x28`, `fixed88x29`, `fixed88x30`, `fixed88x31`, `fixed88x32`, `fixed88x33`, `fixed88x34`, `fixed88x35`, `fixed88x36`, `fixed88x37`, `fixed88x38`, `fixed88x39`, `fixed88x40`, `fixed88x41`, `fixed88x42`, `fixed88x43`, `fixed88x44`, `fixed88x45`, `fixed88x46`, `fixed88x47`, `fixed88x48`, `fixed88x49`, `fixed88x50`, `fixed88x51`, `fixed88x52`, `fixed88x53`, `fixed88x54`, `fixed88x55`, `fixed88x56`, `fixed88x57`, `fixed88x58`, `fixed88x59`, `fixed88x60`, `fixed88x61`, `fixed88x62`, `fixed88x63`, `fixed88x64`, `fixed88x65`, `fixed88x66`, `fixed88x67`, `fixed88x68`, `fixed88x69`, `fixed88x70`, `fixed88x71`, `fixed88x72`, `fixed88x73`, `fixed88x74`, `fixed88x75`, `fixed88x76`, `fixed88x77`, `fixed88x78`, `fixed88x79`, `fixed88x80`, `fixed96x0`, `fixed96x1`, `fixed96x2`, `fixed96x3`, `fixed96x4`, `fixed96x5`, `fixed96x6`, `fixed96x7`, `fixed96x8`, `fixed96x9`, `fixed96x10`, `fixed96x11`, `fixed96x12`, `fixed96x13`, `fixed96x14`, `fixed96x15`, `fixed96x16`, `fixed96x17`, `fixed96x18`, `fixed96x19`, `fixed96x20`, `fixed96x21`, `fixed96x22`, `fixed96x23`, `fixed96x24`, `fixed96x25`, `fixed96x26`, `fixed96x27`, `fixed96x28`, `fixed96x29`, `fixed96x30`, `fixed96x31`, `fixed96x32`, `fixed96x33`, `fixed96x34`, `fixed96x35`, `fixed96x36`, `fixed96x37`, `fixed96x38`, `fixed96x39`, `fixed96x40`, `fixed96x41`, `fixed96x42`, `fixed96x43`, `fixed96x44`, `fixed96x45`, `fixed96x46`, `fixed96x47`, `fixed96x48`, `fixed96x49`, `fixed96x50`, `fixed96x51`, `fixed96x52`, `fixed96x53`, `fixed96x54`, `fixed96x55`, `fixed96x56`, `fixed96x57`, `fixed96x58`, `fixed96x59`, `fixed96x60`, `fixed96x61`, `fixed96x62`, `fixed96x63`, `fixed96x64`, `fixed96x65`, `fixed96x66`, `fixed96x67`, `fixed96x68`, `fixed96x69`, `fixed96x70`, `fixed96x71`, `fixed96x72`, `fixed96x73`, `fixed96x74`, `fixed96x75`, `fixed96x76`, `fixed96x77`, `fixed96x78`, `fixed96x79`, `fixed96x80`, `fixed104x0`, `fixed104x1`, `fixed104x2`, `fixed104x3`, `fixed104x4`, `fixed104x5`, `fixed104x6`, `fixed104x7`, `fixed104x8`, `fixed104x9`, `fixed104x10`, `fixed104x11`, `fixed104x12`, `fixed104x13`, `fixed104x14`, `fixed104x15`, `fixed104x16`, `fixed104x17`, `fixed104x18`, `fixed104x19`, `fixed104x20`, `fixed104x21`, `fixed104x22`, `fixed104x23`, `fixed104x24`, `fixed104x25`, `fixed104x26`, `fixed104x27`, `fixed104x28`, `fixed104x29`, `fixed104x30`, `fixed104x31`, `fixed104x32`, `fixed104x33`, `fixed104x34`, `fixed104x35`, `fixed104x36`, `fixed104x37`, `fixed104x38`, `fixed104x39`, `fixed104x40`, `fixed104x41`, `fixed104x42`, `fixed104x43`, `fixed104x44`, `fixed104x45`, `fixed104x46`, `fixed104x47`, `fixed104x48`, `fixed104x49`, `fixed104x50`, `fixed104x51`, `fixed104x52`, `fixed104x53`, `fixed104x54`, `fixed104x55`, `fixed104x56`, `fixed104x57`, `fixed104x58`, `fixed104x59`, `fixed104x60`, `fixed104x61`, `fixed104x62`, `fixed104x63`, `fixed104x64`, `fixed104x65`, `fixed104x66`, `fixed104x67`, `fixed104x68`, `fixed104x69`, `fixed104x70`, `fixed104x71`, `fixed104x72`, `fixed104x73`, `fixed104x74`, `fixed104x75`, `fixed104x76`, `fixed104x77`, `fixed104x78`, `fixed104x79`, `fixed104x80`, `fixed112x0`, `fixed112x1`, `fixed112x2`, `fixed112x3`, `fixed112x4`, `fixed112x5`, `fixed112x6`, `fixed112x7`, `fixed112x8`, `fixed112x9`, `fixed112x10`, `fixed112x11`, `fixed112x12`, `fixed112x13`, `fixed112x14`, `fixed112x15`, `fixed112x16`, `fixed112x17`, `fixed112x18`, `fixed112x19`, `fixed112x20`, `fixed112x21`, `fixed112x22`, `fixed112x23`, `fixed112x24`, `fixed112x25`, `fixed112x26`, `fixed112x27`, `fixed112x28`, `fixed112x29`, `fixed112x30`, `fixed112x31`, `fixed112x32`, `fixed112x33`, `fixed112x34`, `fixed112x35`, `fixed112x36`, `fixed112x37`, `fixed112x38`, `fixed112x39`, `fixed112x40`, `fixed112x41`, `fixed112x42`, `fixed112x43`, `fixed112x44`, `fixed112x45`, `fixed112x46`, `fixed112x47`, `fixed112x48`, `fixed112x49`, `fixed112x50`, `fixed112x51`, `fixed112x52`, `fixed112x53`, `fixed112x54`, `fixed112x55`, `fixed112x56`, `fixed112x57`, `fixed112x58`, `fixed112x59`, `fixed112x60`, `fixed112x61`, `fixed112x62`, `fixed112x63`, `fixed112x64`, `fixed112x65`, `fixed112x66`, `fixed112x67`, `fixed112x68`, `fixed112x69`, `fixed112x70`, `fixed112x71`, `fixed112x72`, `fixed112x73`, `fixed112x74`, `fixed112x75`, `fixed112x76`, `fixed112x77`, `fixed112x78`, `fixed112x79`, `fixed112x80`, `fixed120x0`, `fixed120x1`, `fixed120x2`, `fixed120x3`, `fixed120x4`, `fixed120x5`, `fixed120x6`, `fixed120x7`, `fixed120x8`, `fixed120x9`, `fixed120x10`, `fixed120x11`, `fixed120x12`, `fixed120x13`, `fixed120x14`, `fixed120x15`, `fixed120x16`, `fixed120x17`, `fixed120x18`, `fixed120x19`, `fixed120x20`, `fixed120x21`, `fixed120x22`, `fixed120x23`, `fixed120x24`, `fixed120x25`, `fixed120x26`, `fixed120x27`, `fixed120x28`, `fixed120x29`, `fixed120x30`, `fixed120x31`, `fixed120x32`, `fixed120x33`, `fixed120x34`, `fixed120x35`, `fixed120x36`, `fixed120x37`, `fixed120x38`, `fixed120x39`, `fixed120x40`, `fixed120x41`, `fixed120x42`, `fixed120x43`, `fixed120x44`, `fixed120x45`, `fixed120x46`, `fixed120x47`, `fixed120x48`, `fixed120x49`, `fixed120x50`, `fixed120x51`, `fixed120x52`, `fixed120x53`, `fixed120x54`, `fixed120x55`, `fixed120x56`, `fixed120x57`, `fixed120x58`, `fixed120x59`, `fixed120x60`, `fixed120x61`, `fixed120x62`, `fixed120x63`, `fixed120x64`, `fixed120x65`, `fixed120x66`, `fixed120x67`, `fixed120x68`, `fixed120x69`, `fixed120x70`, `fixed120x71`, `fixed120x72`, `fixed120x73`, `fixed120x74`, `fixed120x75`, `fixed120x76`, `fixed120x77`, `fixed120x78`, `fixed120x79`, `fixed120x80`, `fixed128x0`, `fixed128x1`, `fixed128x2`, `fixed128x3`, `fixed128x4`, `fixed128x5`, `fixed128x6`, `fixed128x7`, `fixed128x8`, `fixed128x9`, `fixed128x10`, `fixed128x11`, `fixed128x12`, `fixed128x13`, `fixed128x14`, `fixed128x15`, `fixed128x16`, `fixed128x17`, `fixed128x18`, `fixed128x19`, `fixed128x20`, `fixed128x21`, `fixed128x22`, `fixed128x23`, `fixed128x24`, `fixed128x25`, `fixed128x26`, `fixed128x27`, `fixed128x28`, `fixed128x29`, `fixed128x30`, `fixed128x31`, `fixed128x32`, `fixed128x33`, `fixed128x34`, `fixed128x35`, `fixed128x36`, `fixed128x37`, `fixed128x38`, `fixed128x39`, `fixed128x40`, `fixed128x41`, `fixed128x42`, `fixed128x43`, `fixed128x44`, `fixed128x45`, `fixed128x46`, `fixed128x47`, `fixed128x48`, `fixed128x49`, `fixed128x50`, `fixed128x51`, `fixed128x52`, `fixed128x53`, `fixed128x54`, `fixed128x55`, `fixed128x56`, `fixed128x57`, `fixed128x58`, `fixed128x59`, `fixed128x60`, `fixed128x61`, `fixed128x62`, `fixed128x63`, `fixed128x64`, `fixed128x65`, `fixed128x66`, `fixed128x67`, `fixed128x68`, `fixed128x69`, `fixed128x70`, `fixed128x71`, `fixed128x72`, `fixed128x73`, `fixed128x74`, `fixed128x75`, `fixed128x76`, `fixed128x77`, `fixed128x78`, `fixed128x79`, `fixed128x80`, `fixed136x0`, `fixed136x1`, `fixed136x2`, `fixed136x3`, `fixed136x4`, `fixed136x5`, `fixed136x6`, `fixed136x7`, `fixed136x8`, `fixed136x9`, `fixed136x10`, `fixed136x11`, `fixed136x12`, `fixed136x13`, `fixed136x14`, `fixed136x15`, `fixed136x16`, `fixed136x17`, `fixed136x18`, `fixed136x19`, `fixed136x20`, `fixed136x21`, `fixed136x22`, `fixed136x23`, `fixed136x24`, `fixed136x25`, `fixed136x26`, `fixed136x27`, `fixed136x28`, `fixed136x29`, `fixed136x30`, `fixed136x31`, `fixed136x32`, `fixed136x33`, `fixed136x34`, `fixed136x35`, `fixed136x36`, `fixed136x37`, `fixed136x38`, `fixed136x39`, `fixed136x40`, `fixed136x41`, `fixed136x42`, `fixed136x43`, `fixed136x44`, `fixed136x45`, `fixed136x46`, `fixed136x47`, `fixed136x48`, `fixed136x49`, `fixed136x50`, `fixed136x51`, `fixed136x52`, `fixed136x53`, `fixed136x54`, `fixed136x55`, `fixed136x56`, `fixed136x57`, `fixed136x58`, `fixed136x59`, `fixed136x60`, `fixed136x61`, `fixed136x62`, `fixed136x63`, `fixed136x64`, `fixed136x65`, `fixed136x66`, `fixed136x67`, `fixed136x68`, `fixed136x69`, `fixed136x70`, `fixed136x71`, `fixed136x72`, `fixed136x73`, `fixed136x74`, `fixed136x75`, `fixed136x76`, `fixed136x77`, `fixed136x78`, `fixed136x79`, `fixed136x80`, `fixed144x0`, `fixed144x1`, `fixed144x2`, `fixed144x3`, `fixed144x4`, `fixed144x5`, `fixed144x6`, `fixed144x7`, `fixed144x8`, `fixed144x9`, `fixed144x10`, `fixed144x11`, `fixed144x12`, `fixed144x13`, `fixed144x14`, `fixed144x15`, `fixed144x16`, `fixed144x17`, `fixed144x18`, `fixed144x19`, `fixed144x20`, `fixed144x21`, `fixed144x22`, `fixed144x23`, `fixed144x24`, `fixed144x25`, `fixed144x26`, `fixed144x27`, `fixed144x28`, `fixed144x29`, `fixed144x30`, `fixed144x31`, `fixed144x32`, `fixed144x33`, `fixed144x34`, `fixed144x35`, `fixed144x36`, `fixed144x37`, `fixed144x38`, `fixed144x39`, `fixed144x40`, `fixed144x41`, `fixed144x42`, `fixed144x43`, `fixed144x44`, `fixed144x45`, `fixed144x46`, `fixed144x47`, `fixed144x48`, `fixed144x49`, `fixed144x50`, `fixed144x51`, `fixed144x52`, `fixed144x53`, `fixed144x54`, `fixed144x55`, `fixed144x56`, `fixed144x57`, `fixed144x58`, `fixed144x59`, `fixed144x60`, `fixed144x61`, `fixed144x62`, `fixed144x63`, `fixed144x64`, `fixed144x65`, `fixed144x66`, `fixed144x67`, `fixed144x68`, `fixed144x69`, `fixed144x70`, `fixed144x71`, `fixed144x72`, `fixed144x73`, `fixed144x74`, `fixed144x75`, `fixed144x76`, `fixed144x77`, `fixed144x78`, `fixed144x79`, `fixed144x80`, `fixed152x0`, `fixed152x1`, `fixed152x2`, `fixed152x3`, `fixed152x4`, `fixed152x5`, `fixed152x6`, `fixed152x7`, `fixed152x8`, `fixed152x9`, `fixed152x10`, `fixed152x11`, `fixed152x12`, `fixed152x13`, `fixed152x14`, `fixed152x15`, `fixed152x16`, `fixed152x17`, `fixed152x18`, `fixed152x19`, `fixed152x20`, `fixed152x21`, `fixed152x22`, `fixed152x23`, `fixed152x24`, `fixed152x25`, `fixed152x26`, `fixed152x27`, `fixed152x28`, `fixed152x29`, `fixed152x30`, `fixed152x31`, `fixed152x32`, `fixed152x33`, `fixed152x34`, `fixed152x35`, `fixed152x36`, `fixed152x37`, `fixed152x38`, `fixed152x39`, `fixed152x40`, `fixed152x41`, `fixed152x42`, `fixed152x43`, `fixed152x44`, `fixed152x45`, `fixed152x46`, `fixed152x47`, `fixed152x48`, `fixed152x49`, `fixed152x50`, `fixed152x51`, `fixed152x52`, `fixed152x53`, `fixed152x54`, `fixed152x55`, `fixed152x56`, `fixed152x57`, `fixed152x58`, `fixed152x59`, `fixed152x60`, `fixed152x61`, `fixed152x62`, `fixed152x63`, `fixed152x64`, `fixed152x65`, `fixed152x66`, `fixed152x67`, `fixed152x68`, `fixed152x69`, `fixed152x70`, `fixed152x71`, `fixed152x72`, `fixed152x73`, `fixed152x74`, `fixed152x75`, `fixed152x76`, `fixed152x77`, `fixed152x78`, `fixed152x79`, `fixed152x80`, `fixed160x0`, `fixed160x1`, `fixed160x2`, `fixed160x3`, `fixed160x4`, `fixed160x5`, `fixed160x6`, `fixed160x7`, `fixed160x8`, `fixed160x9`, `fixed160x10`, `fixed160x11`, `fixed160x12`, `fixed160x13`, `fixed160x14`, `fixed160x15`, `fixed160x16`, `fixed160x17`, `fixed160x18`, `fixed160x19`, `fixed160x20`, `fixed160x21`, `fixed160x22`, `fixed160x23`, `fixed160x24`, `fixed160x25`, `fixed160x26`, `fixed160x27`, `fixed160x28`, `fixed160x29`, `fixed160x30`, `fixed160x31`, `fixed160x32`, `fixed160x33`, `fixed160x34`, `fixed160x35`, `fixed160x36`, `fixed160x37`, `fixed160x38`, `fixed160x39`, `fixed160x40`, `fixed160x41`, `fixed160x42`, `fixed160x43`, `fixed160x44`, `fixed160x45`, `fixed160x46`, `fixed160x47`, `fixed160x48`, `fixed160x49`, `fixed160x50`, `fixed160x51`, `fixed160x52`, `fixed160x53`, `fixed160x54`, `fixed160x55`, `fixed160x56`, `fixed160x57`, `fixed160x58`, `fixed160x59`, `fixed160x60`, `fixed160x61`, `fixed160x62`, `fixed160x63`, `fixed160x64`, `fixed160x65`, `fixed160x66`, `fixed160x67`, `fixed160x68`, `fixed160x69`, `fixed160x70`, `fixed160x71`, `fixed160x72`, `fixed160x73`, `fixed160x74`, `fixed160x75`, `fixed160x76`, `fixed160x77`, `fixed160x78`, `fixed160x79`, `fixed160x80`, `fixed168x0`, `fixed168x1`, `fixed168x2`, `fixed168x3`, `fixed168x4`, `fixed168x5`, `fixed168x6`, `fixed168x7`, `fixed168x8`, `fixed168x9`, `fixed168x10`, `fixed168x11`, `fixed168x12`, `fixed168x13`, `fixed168x14`, `fixed168x15`, `fixed168x16`, `fixed168x17`, `fixed168x18`, `fixed168x19`, `fixed168x20`, `fixed168x21`, `fixed168x22`, `fixed168x23`, `fixed168x24`, `fixed168x25`, `fixed168x26`, `fixed168x27`, `fixed168x28`, `fixed168x29`, `fixed168x30`, `fixed168x31`, `fixed168x32`, `fixed168x33`, `fixed168x34`, `fixed168x35`, `fixed168x36`, `fixed168x37`, `fixed168x38`, `fixed168x39`, `fixed168x40`, `fixed168x41`, `fixed168x42`, `fixed168x43`, `fixed168x44`, `fixed168x45`, `fixed168x46`, `fixed168x47`, `fixed168x48`, `fixed168x49`, `fixed168x50`, `fixed168x51`, `fixed168x52`, `fixed168x53`, `fixed168x54`, `fixed168x55`, `fixed168x56`, `fixed168x57`, `fixed168x58`, `fixed168x59`, `fixed168x60`, `fixed168x61`, `fixed168x62`, `fixed168x63`, `fixed168x64`, `fixed168x65`, `fixed168x66`, `fixed168x67`, `fixed168x68`, `fixed168x69`, `fixed168x70`, `fixed168x71`, `fixed168x72`, `fixed168x73`, `fixed168x74`, `fixed168x75`, `fixed168x76`, `fixed168x77`, `fixed168x78`, `fixed168x79`, `fixed168x80`, `fixed176x0`, `fixed176x1`, `fixed176x2`, `fixed176x3`, `fixed176x4`, `fixed176x5`, `fixed176x6`, `fixed176x7`, `fixed176x8`, `fixed176x9`, `fixed176x10`, `fixed176x11`, `fixed176x12`, `fixed176x13`, `fixed176x14`, `fixed176x15`, `fixed176x16`, `fixed176x17`, `fixed176x18`, `fixed176x19`, `fixed176x20`, `fixed176x21`, `fixed176x22`, `fixed176x23`, `fixed176x24`, `fixed176x25`, `fixed176x26`, `fixed176x27`, `fixed176x28`, `fixed176x29`, `fixed176x30`, `fixed176x31`, `fixed176x32`, `fixed176x33`, `fixed176x34`, `fixed176x35`, `fixed176x36`, `fixed176x37`, `fixed176x38`, `fixed176x39`, `fixed176x40`, `fixed176x41`, `fixed176x42`, `fixed176x43`, `fixed176x44`, `fixed176x45`, `fixed176x46`, `fixed176x47`, `fixed176x48`, `fixed176x49`, `fixed176x50`, `fixed176x51`, `fixed176x52`, `fixed176x53`, `fixed176x54`, `fixed176x55`, `fixed176x56`, `fixed176x57`, `fixed176x58`, `fixed176x59`, `fixed176x60`, `fixed176x61`, `fixed176x62`, `fixed176x63`, `fixed176x64`, `fixed176x65`, `fixed176x66`, `fixed176x67`, `fixed176x68`, `fixed176x69`, `fixed176x70`, `fixed176x71`, `fixed176x72`, `fixed176x73`, `fixed176x74`, `fixed176x75`, `fixed176x76`, `fixed176x77`, `fixed176x78`, `fixed176x79`, `fixed176x80`, `fixed184x0`, `fixed184x1`, `fixed184x2`, `fixed184x3`, `fixed184x4`, `fixed184x5`, `fixed184x6`, `fixed184x7`, `fixed184x8`, `fixed184x9`, `fixed184x10`, `fixed184x11`, `fixed184x12`, `fixed184x13`, `fixed184x14`, `fixed184x15`, `fixed184x16`, `fixed184x17`, `fixed184x18`, `fixed184x19`, `fixed184x20`, `fixed184x21`, `fixed184x22`, `fixed184x23`, `fixed184x24`, `fixed184x25`, `fixed184x26`, `fixed184x27`, `fixed184x28`, `fixed184x29`, `fixed184x30`, `fixed184x31`, `fixed184x32`, `fixed184x33`, `fixed184x34`, `fixed184x35`, `fixed184x36`, `fixed184x37`, `fixed184x38`, `fixed184x39`, `fixed184x40`, `fixed184x41`, `fixed184x42`, `fixed184x43`, `fixed184x44`, `fixed184x45`, `fixed184x46`, `fixed184x47`, `fixed184x48`, `fixed184x49`, `fixed184x50`, `fixed184x51`, `fixed184x52`, `fixed184x53`, `fixed184x54`, `fixed184x55`, `fixed184x56`, `fixed184x57`, `fixed184x58`, `fixed184x59`, `fixed184x60`, `fixed184x61`, `fixed184x62`, `fixed184x63`, `fixed184x64`, `fixed184x65`, `fixed184x66`, `fixed184x67`, `fixed184x68`, `fixed184x69`, `fixed184x70`, `fixed184x71`, `fixed184x72`, `fixed192x0`, `fixed192x1`, `fixed192x2`, `fixed192x3`, `fixed192x4`, `fixed192x5`, `fixed192x6`, `fixed192x7`, `fixed192x8`, `fixed192x9`, `fixed192x10`, `fixed192x11`, `fixed192x12`, `fixed192x13`, `fixed192x14`, `fixed192x15`, `fixed192x16`, `fixed192x17`, `fixed192x18`, `fixed192x19`, `fixed192x20`, `fixed192x21`, `fixed192x22`, `fixed192x23`, `fixed192x24`, `fixed192x25`, `fixed192x26`, `fixed192x27`, `fixed192x28`, `fixed192x29`, `fixed192x30`, `fixed192x31`, `fixed192x32`, `fixed192x33`, `fixed192x34`, `fixed192x35`, `fixed192x36`, `fixed192x37`, `fixed192x38`, `fixed192x39`, `fixed192x40`, `fixed192x41`, `fixed192x42`, `fixed192x43`, `fixed192x44`, `fixed192x45`, `fixed192x46`, `fixed192x47`, `fixed192x48`, `fixed192x49`, `fixed192x50`, `fixed192x51`, `fixed192x52`, `fixed192x53`, `fixed192x54`, `fixed192x55`, `fixed192x56`, `fixed192x57`, `fixed192x58`, `fixed192x59`, `fixed192x60`, `fixed192x61`, `fixed192x62`, `fixed192x63`, `fixed192x64`, `fixed200x0`, `fixed200x1`, `fixed200x2`, `fixed200x3`, `fixed200x4`, `fixed200x5`, `fixed200x6`, `fixed200x7`, `fixed200x8`, `fixed200x9`, `fixed200x10`, `fixed200x11`, `fixed200x12`, `fixed200x13`, `fixed200x14`, `fixed200x15`, `fixed200x16`, `fixed200x17`, `fixed200x18`, `fixed200x19`, `fixed200x20`, `fixed200x21`, `fixed200x22`, `fixed200x23`, `fixed200x24`, `fixed200x25`, `fixed200x26`, `fixed200x27`, `fixed200x28`, `fixed200x29`, `fixed200x30`, `fixed200x31`, `fixed200x32`, `fixed200x33`, `fixed200x34`, `fixed200x35`, `fixed200x36`, `fixed200x37`, `fixed200x38`, `fixed200x39`, `fixed200x40`, `fixed200x41`, `fixed200x42`, `fixed200x43`, `fixed200x44`, `fixed200x45`, `fixed200x46`, `fixed200x47`, `fixed200x48`, `fixed200x49`, `fixed200x50`, `fixed200x51`, `fixed200x52`, `fixed200x53`, `fixed200x54`, `fixed200x55`, `fixed200x56`, `fixed208x0`, `fixed208x1`, `fixed208x2`, `fixed208x3`, `fixed208x4`, `fixed208x5`, `fixed208x6`, `fixed208x7`, `fixed208x8`, `fixed208x9`, `fixed208x10`, `fixed208x11`, `fixed208x12`, `fixed208x13`, `fixed208x14`, `fixed208x15`, `fixed208x16`, `fixed208x17`, `fixed208x18`, `fixed208x19`, `fixed208x20`, `fixed208x21`, `fixed208x22`, `fixed208x23`, `fixed208x24`, `fixed208x25`, `fixed208x26`, `fixed208x27`, `fixed208x28`, `fixed208x29`, `fixed208x30`, `fixed208x31`, `fixed208x32`, `fixed208x33`, `fixed208x34`, `fixed208x35`, `fixed208x36`, `fixed208x37`, `fixed208x38`, `fixed208x39`, `fixed208x40`, `fixed208x41`, `fixed208x42`, `fixed208x43`, `fixed208x44`, `fixed208x45`, `fixed208x46`, `fixed208x47`, `fixed208x48`, `fixed216x0`, `fixed216x1`, `fixed216x2`, `fixed216x3`, `fixed216x4`, `fixed216x5`, `fixed216x6`, `fixed216x7`, `fixed216x8`, `fixed216x9`, `fixed216x10`, `fixed216x11`, `fixed216x12`, `fixed216x13`, `fixed216x14`, `fixed216x15`, `fixed216x16`, `fixed216x17`, `fixed216x18`, `fixed216x19`, `fixed216x20`, `fixed216x21`, `fixed216x22`, `fixed216x23`, `fixed216x24`, `fixed216x25`, `fixed216x26`, `fixed216x27`, `fixed216x28`, `fixed216x29`, `fixed216x30`, `fixed216x31`, `fixed216x32`, `fixed216x33`, `fixed216x34`, `fixed216x35`, `fixed216x36`, `fixed216x37`, `fixed216x38`, `fixed216x39`, `fixed216x40`, `fixed224x0`, `fixed224x1`, `fixed224x2`, `fixed224x3`, `fixed224x4`, `fixed224x5`, `fixed224x6`, `fixed224x7`, `fixed224x8`, `fixed224x9`, `fixed224x10`, `fixed224x11`, `fixed224x12`, `fixed224x13`, `fixed224x14`, `fixed224x15`, `fixed224x16`, `fixed224x17`, `fixed224x18`, `fixed224x19`, `fixed224x20`, `fixed224x21`, `fixed224x22`, `fixed224x23`, `fixed224x24`, `fixed224x25`, `fixed224x26`, `fixed224x27`, `fixed224x28`, `fixed224x29`, `fixed224x30`, `fixed224x31`, `fixed224x32`, `fixed232x0`, `fixed232x1`, `fixed232x2`, `fixed232x3`, `fixed232x4`, `fixed232x5`, `fixed232x6`, `fixed232x7`, `fixed232x8`, `fixed232x9`, `fixed232x10`, `fixed232x11`, `fixed232x12`, `fixed232x13`, `fixed232x14`, `fixed232x15`, `fixed232x16`, `fixed232x17`, `fixed232x18`, `fixed232x19`, `fixed232x20`, `fixed232x21`, `fixed232x22`, `fixed232x23`, `fixed232x24`, `fixed240x0`, `fixed240x1`, `fixed240x2`, `fixed240x3`, `fixed240x4`, `fixed240x5`, `fixed240x6`, `fixed240x7`, `fixed240x8`, `fixed240x9`, `fixed240x10`, `fixed240x11`, `fixed240x12`, `fixed240x13`, `fixed240x14`, `fixed240x15`, `fixed240x16`, `fixed248x0`, `fixed248x1`, `fixed248x2`, `fixed248x3`, `fixed248x4`, `fixed248x5`, `fixed248x6`, `fixed248x7`, `fixed248x8`, `fixed256x0`), KeywordType, nil}, - {Words(``, `\b`, `ufixed8x0`, `ufixed8x1`, `ufixed8x2`, `ufixed8x3`, `ufixed8x4`, `ufixed8x5`, `ufixed8x6`, `ufixed8x7`, `ufixed8x8`, `ufixed8x9`, `ufixed8x10`, `ufixed8x11`, `ufixed8x12`, `ufixed8x13`, `ufixed8x14`, `ufixed8x15`, `ufixed8x16`, `ufixed8x17`, `ufixed8x18`, `ufixed8x19`, `ufixed8x20`, `ufixed8x21`, `ufixed8x22`, `ufixed8x23`, `ufixed8x24`, `ufixed8x25`, `ufixed8x26`, `ufixed8x27`, `ufixed8x28`, `ufixed8x29`, `ufixed8x30`, `ufixed8x31`, `ufixed8x32`, `ufixed8x33`, `ufixed8x34`, `ufixed8x35`, `ufixed8x36`, `ufixed8x37`, `ufixed8x38`, `ufixed8x39`, `ufixed8x40`, `ufixed8x41`, `ufixed8x42`, `ufixed8x43`, `ufixed8x44`, `ufixed8x45`, `ufixed8x46`, `ufixed8x47`, `ufixed8x48`, `ufixed8x49`, `ufixed8x50`, `ufixed8x51`, `ufixed8x52`, `ufixed8x53`, `ufixed8x54`, `ufixed8x55`, `ufixed8x56`, `ufixed8x57`, `ufixed8x58`, `ufixed8x59`, `ufixed8x60`, `ufixed8x61`, `ufixed8x62`, `ufixed8x63`, `ufixed8x64`, `ufixed8x65`, `ufixed8x66`, `ufixed8x67`, `ufixed8x68`, `ufixed8x69`, `ufixed8x70`, `ufixed8x71`, `ufixed8x72`, `ufixed8x73`, `ufixed8x74`, `ufixed8x75`, `ufixed8x76`, `ufixed8x77`, `ufixed8x78`, `ufixed8x79`, `ufixed8x80`, `ufixed16x0`, `ufixed16x1`, `ufixed16x2`, `ufixed16x3`, `ufixed16x4`, `ufixed16x5`, `ufixed16x6`, `ufixed16x7`, `ufixed16x8`, `ufixed16x9`, `ufixed16x10`, `ufixed16x11`, `ufixed16x12`, `ufixed16x13`, `ufixed16x14`, `ufixed16x15`, `ufixed16x16`, `ufixed16x17`, `ufixed16x18`, `ufixed16x19`, `ufixed16x20`, `ufixed16x21`, `ufixed16x22`, `ufixed16x23`, `ufixed16x24`, `ufixed16x25`, `ufixed16x26`, `ufixed16x27`, `ufixed16x28`, `ufixed16x29`, `ufixed16x30`, `ufixed16x31`, `ufixed16x32`, `ufixed16x33`, `ufixed16x34`, `ufixed16x35`, `ufixed16x36`, `ufixed16x37`, `ufixed16x38`, `ufixed16x39`, `ufixed16x40`, `ufixed16x41`, `ufixed16x42`, `ufixed16x43`, `ufixed16x44`, `ufixed16x45`, `ufixed16x46`, `ufixed16x47`, `ufixed16x48`, `ufixed16x49`, `ufixed16x50`, `ufixed16x51`, `ufixed16x52`, `ufixed16x53`, `ufixed16x54`, `ufixed16x55`, `ufixed16x56`, `ufixed16x57`, `ufixed16x58`, `ufixed16x59`, `ufixed16x60`, `ufixed16x61`, `ufixed16x62`, `ufixed16x63`, `ufixed16x64`, `ufixed16x65`, `ufixed16x66`, `ufixed16x67`, `ufixed16x68`, `ufixed16x69`, `ufixed16x70`, `ufixed16x71`, `ufixed16x72`, `ufixed16x73`, `ufixed16x74`, `ufixed16x75`, `ufixed16x76`, `ufixed16x77`, `ufixed16x78`, `ufixed16x79`, `ufixed16x80`, `ufixed24x0`, `ufixed24x1`, `ufixed24x2`, `ufixed24x3`, `ufixed24x4`, `ufixed24x5`, `ufixed24x6`, `ufixed24x7`, `ufixed24x8`, `ufixed24x9`, `ufixed24x10`, `ufixed24x11`, `ufixed24x12`, `ufixed24x13`, `ufixed24x14`, `ufixed24x15`, `ufixed24x16`, `ufixed24x17`, `ufixed24x18`, `ufixed24x19`, `ufixed24x20`, `ufixed24x21`, `ufixed24x22`, `ufixed24x23`, `ufixed24x24`, `ufixed24x25`, `ufixed24x26`, `ufixed24x27`, `ufixed24x28`, `ufixed24x29`, `ufixed24x30`, `ufixed24x31`, `ufixed24x32`, `ufixed24x33`, `ufixed24x34`, `ufixed24x35`, `ufixed24x36`, `ufixed24x37`, `ufixed24x38`, `ufixed24x39`, `ufixed24x40`, `ufixed24x41`, `ufixed24x42`, `ufixed24x43`, `ufixed24x44`, `ufixed24x45`, `ufixed24x46`, `ufixed24x47`, `ufixed24x48`, `ufixed24x49`, `ufixed24x50`, `ufixed24x51`, `ufixed24x52`, `ufixed24x53`, `ufixed24x54`, `ufixed24x55`, `ufixed24x56`, `ufixed24x57`, `ufixed24x58`, `ufixed24x59`, `ufixed24x60`, `ufixed24x61`, `ufixed24x62`, `ufixed24x63`, `ufixed24x64`, `ufixed24x65`, `ufixed24x66`, `ufixed24x67`, `ufixed24x68`, `ufixed24x69`, `ufixed24x70`, `ufixed24x71`, `ufixed24x72`, `ufixed24x73`, `ufixed24x74`, `ufixed24x75`, `ufixed24x76`, `ufixed24x77`, `ufixed24x78`, `ufixed24x79`, `ufixed24x80`, `ufixed32x0`, `ufixed32x1`, `ufixed32x2`, `ufixed32x3`, `ufixed32x4`, `ufixed32x5`, `ufixed32x6`, `ufixed32x7`, `ufixed32x8`, `ufixed32x9`, `ufixed32x10`, `ufixed32x11`, `ufixed32x12`, `ufixed32x13`, `ufixed32x14`, `ufixed32x15`, `ufixed32x16`, `ufixed32x17`, `ufixed32x18`, `ufixed32x19`, `ufixed32x20`, `ufixed32x21`, `ufixed32x22`, `ufixed32x23`, `ufixed32x24`, `ufixed32x25`, `ufixed32x26`, `ufixed32x27`, `ufixed32x28`, `ufixed32x29`, `ufixed32x30`, `ufixed32x31`, `ufixed32x32`, `ufixed32x33`, `ufixed32x34`, `ufixed32x35`, `ufixed32x36`, `ufixed32x37`, `ufixed32x38`, `ufixed32x39`, `ufixed32x40`, `ufixed32x41`, `ufixed32x42`, `ufixed32x43`, `ufixed32x44`, `ufixed32x45`, `ufixed32x46`, `ufixed32x47`, `ufixed32x48`, `ufixed32x49`, `ufixed32x50`, `ufixed32x51`, `ufixed32x52`, `ufixed32x53`, `ufixed32x54`, `ufixed32x55`, `ufixed32x56`, `ufixed32x57`, `ufixed32x58`, `ufixed32x59`, `ufixed32x60`, `ufixed32x61`, `ufixed32x62`, `ufixed32x63`, `ufixed32x64`, `ufixed32x65`, `ufixed32x66`, `ufixed32x67`, `ufixed32x68`, `ufixed32x69`, `ufixed32x70`, `ufixed32x71`, `ufixed32x72`, `ufixed32x73`, `ufixed32x74`, `ufixed32x75`, `ufixed32x76`, `ufixed32x77`, `ufixed32x78`, `ufixed32x79`, `ufixed32x80`, `ufixed40x0`, `ufixed40x1`, `ufixed40x2`, `ufixed40x3`, `ufixed40x4`, `ufixed40x5`, `ufixed40x6`, `ufixed40x7`, `ufixed40x8`, `ufixed40x9`, `ufixed40x10`, `ufixed40x11`, `ufixed40x12`, `ufixed40x13`, `ufixed40x14`, `ufixed40x15`, `ufixed40x16`, `ufixed40x17`, `ufixed40x18`, `ufixed40x19`, `ufixed40x20`, `ufixed40x21`, `ufixed40x22`, `ufixed40x23`, `ufixed40x24`, `ufixed40x25`, `ufixed40x26`, `ufixed40x27`, `ufixed40x28`, `ufixed40x29`, `ufixed40x30`, `ufixed40x31`, `ufixed40x32`, `ufixed40x33`, `ufixed40x34`, `ufixed40x35`, `ufixed40x36`, `ufixed40x37`, `ufixed40x38`, `ufixed40x39`, `ufixed40x40`, `ufixed40x41`, `ufixed40x42`, `ufixed40x43`, `ufixed40x44`, `ufixed40x45`, `ufixed40x46`, `ufixed40x47`, `ufixed40x48`, `ufixed40x49`, `ufixed40x50`, `ufixed40x51`, `ufixed40x52`, `ufixed40x53`, `ufixed40x54`, `ufixed40x55`, `ufixed40x56`, `ufixed40x57`, `ufixed40x58`, `ufixed40x59`, `ufixed40x60`, `ufixed40x61`, `ufixed40x62`, `ufixed40x63`, `ufixed40x64`, `ufixed40x65`, `ufixed40x66`, `ufixed40x67`, `ufixed40x68`, `ufixed40x69`, `ufixed40x70`, `ufixed40x71`, `ufixed40x72`, `ufixed40x73`, `ufixed40x74`, `ufixed40x75`, `ufixed40x76`, `ufixed40x77`, `ufixed40x78`, `ufixed40x79`, `ufixed40x80`, `ufixed48x0`, `ufixed48x1`, `ufixed48x2`, `ufixed48x3`, `ufixed48x4`, `ufixed48x5`, `ufixed48x6`, `ufixed48x7`, `ufixed48x8`, `ufixed48x9`, `ufixed48x10`, `ufixed48x11`, `ufixed48x12`, `ufixed48x13`, `ufixed48x14`, `ufixed48x15`, `ufixed48x16`, `ufixed48x17`, `ufixed48x18`, `ufixed48x19`, `ufixed48x20`, `ufixed48x21`, `ufixed48x22`, `ufixed48x23`, `ufixed48x24`, `ufixed48x25`, `ufixed48x26`, `ufixed48x27`, `ufixed48x28`, `ufixed48x29`, `ufixed48x30`, `ufixed48x31`, `ufixed48x32`, `ufixed48x33`, `ufixed48x34`, `ufixed48x35`, `ufixed48x36`, `ufixed48x37`, `ufixed48x38`, `ufixed48x39`, `ufixed48x40`, `ufixed48x41`, `ufixed48x42`, `ufixed48x43`, `ufixed48x44`, `ufixed48x45`, `ufixed48x46`, `ufixed48x47`, `ufixed48x48`, `ufixed48x49`, `ufixed48x50`, `ufixed48x51`, `ufixed48x52`, `ufixed48x53`, `ufixed48x54`, `ufixed48x55`, `ufixed48x56`, `ufixed48x57`, `ufixed48x58`, `ufixed48x59`, `ufixed48x60`, `ufixed48x61`, `ufixed48x62`, `ufixed48x63`, `ufixed48x64`, `ufixed48x65`, `ufixed48x66`, `ufixed48x67`, `ufixed48x68`, `ufixed48x69`, `ufixed48x70`, `ufixed48x71`, `ufixed48x72`, `ufixed48x73`, `ufixed48x74`, `ufixed48x75`, `ufixed48x76`, `ufixed48x77`, `ufixed48x78`, `ufixed48x79`, `ufixed48x80`, `ufixed56x0`, `ufixed56x1`, `ufixed56x2`, `ufixed56x3`, `ufixed56x4`, `ufixed56x5`, `ufixed56x6`, `ufixed56x7`, `ufixed56x8`, `ufixed56x9`, `ufixed56x10`, `ufixed56x11`, `ufixed56x12`, `ufixed56x13`, `ufixed56x14`, `ufixed56x15`, `ufixed56x16`, `ufixed56x17`, `ufixed56x18`, `ufixed56x19`, `ufixed56x20`, `ufixed56x21`, `ufixed56x22`, `ufixed56x23`, `ufixed56x24`, `ufixed56x25`, `ufixed56x26`, `ufixed56x27`, `ufixed56x28`, `ufixed56x29`, `ufixed56x30`, `ufixed56x31`, `ufixed56x32`, `ufixed56x33`, `ufixed56x34`, `ufixed56x35`, `ufixed56x36`, `ufixed56x37`, `ufixed56x38`, `ufixed56x39`, `ufixed56x40`, `ufixed56x41`, `ufixed56x42`, `ufixed56x43`, `ufixed56x44`, `ufixed56x45`, `ufixed56x46`, `ufixed56x47`, `ufixed56x48`, `ufixed56x49`, `ufixed56x50`, `ufixed56x51`, `ufixed56x52`, `ufixed56x53`, `ufixed56x54`, `ufixed56x55`, `ufixed56x56`, `ufixed56x57`, `ufixed56x58`, `ufixed56x59`, `ufixed56x60`, `ufixed56x61`, `ufixed56x62`, `ufixed56x63`, `ufixed56x64`, `ufixed56x65`, `ufixed56x66`, `ufixed56x67`, `ufixed56x68`, `ufixed56x69`, `ufixed56x70`, `ufixed56x71`, `ufixed56x72`, `ufixed56x73`, `ufixed56x74`, `ufixed56x75`, `ufixed56x76`, `ufixed56x77`, `ufixed56x78`, `ufixed56x79`, `ufixed56x80`, `ufixed64x0`, `ufixed64x1`, `ufixed64x2`, `ufixed64x3`, `ufixed64x4`, `ufixed64x5`, `ufixed64x6`, `ufixed64x7`, `ufixed64x8`, `ufixed64x9`, `ufixed64x10`, `ufixed64x11`, `ufixed64x12`, `ufixed64x13`, `ufixed64x14`, `ufixed64x15`, `ufixed64x16`, `ufixed64x17`, `ufixed64x18`, `ufixed64x19`, `ufixed64x20`, `ufixed64x21`, `ufixed64x22`, `ufixed64x23`, `ufixed64x24`, `ufixed64x25`, `ufixed64x26`, `ufixed64x27`, `ufixed64x28`, `ufixed64x29`, `ufixed64x30`, `ufixed64x31`, `ufixed64x32`, `ufixed64x33`, `ufixed64x34`, `ufixed64x35`, `ufixed64x36`, `ufixed64x37`, `ufixed64x38`, `ufixed64x39`, `ufixed64x40`, `ufixed64x41`, `ufixed64x42`, `ufixed64x43`, `ufixed64x44`, `ufixed64x45`, `ufixed64x46`, `ufixed64x47`, `ufixed64x48`, `ufixed64x49`, `ufixed64x50`, `ufixed64x51`, `ufixed64x52`, `ufixed64x53`, `ufixed64x54`, `ufixed64x55`, `ufixed64x56`, `ufixed64x57`, `ufixed64x58`, `ufixed64x59`, `ufixed64x60`, `ufixed64x61`, `ufixed64x62`, `ufixed64x63`, `ufixed64x64`, `ufixed64x65`, `ufixed64x66`, `ufixed64x67`, `ufixed64x68`, `ufixed64x69`, `ufixed64x70`, `ufixed64x71`, `ufixed64x72`, `ufixed64x73`, `ufixed64x74`, `ufixed64x75`, `ufixed64x76`, `ufixed64x77`, `ufixed64x78`, `ufixed64x79`, `ufixed64x80`, `ufixed72x0`, `ufixed72x1`, `ufixed72x2`, `ufixed72x3`, `ufixed72x4`, `ufixed72x5`, `ufixed72x6`, `ufixed72x7`, `ufixed72x8`, `ufixed72x9`, `ufixed72x10`, `ufixed72x11`, `ufixed72x12`, `ufixed72x13`, `ufixed72x14`, `ufixed72x15`, `ufixed72x16`, `ufixed72x17`, `ufixed72x18`, `ufixed72x19`, `ufixed72x20`, `ufixed72x21`, `ufixed72x22`, `ufixed72x23`, `ufixed72x24`, `ufixed72x25`, `ufixed72x26`, `ufixed72x27`, `ufixed72x28`, `ufixed72x29`, `ufixed72x30`, `ufixed72x31`, `ufixed72x32`, `ufixed72x33`, `ufixed72x34`, `ufixed72x35`, `ufixed72x36`, `ufixed72x37`, `ufixed72x38`, `ufixed72x39`, `ufixed72x40`, `ufixed72x41`, `ufixed72x42`, `ufixed72x43`, `ufixed72x44`, `ufixed72x45`, `ufixed72x46`, `ufixed72x47`, `ufixed72x48`, `ufixed72x49`, `ufixed72x50`, `ufixed72x51`, `ufixed72x52`, `ufixed72x53`, `ufixed72x54`, `ufixed72x55`, `ufixed72x56`, `ufixed72x57`, `ufixed72x58`, `ufixed72x59`, `ufixed72x60`, `ufixed72x61`, `ufixed72x62`, `ufixed72x63`, `ufixed72x64`, `ufixed72x65`, `ufixed72x66`, `ufixed72x67`, `ufixed72x68`, `ufixed72x69`, `ufixed72x70`, `ufixed72x71`, `ufixed72x72`, `ufixed72x73`, `ufixed72x74`, `ufixed72x75`, `ufixed72x76`, `ufixed72x77`, `ufixed72x78`, `ufixed72x79`, `ufixed72x80`, `ufixed80x0`, `ufixed80x1`, `ufixed80x2`, `ufixed80x3`, `ufixed80x4`, `ufixed80x5`, `ufixed80x6`, `ufixed80x7`, `ufixed80x8`, `ufixed80x9`, `ufixed80x10`, `ufixed80x11`, `ufixed80x12`, `ufixed80x13`, `ufixed80x14`, `ufixed80x15`, `ufixed80x16`, `ufixed80x17`, `ufixed80x18`, `ufixed80x19`, `ufixed80x20`, `ufixed80x21`, `ufixed80x22`, `ufixed80x23`, `ufixed80x24`, `ufixed80x25`, `ufixed80x26`, `ufixed80x27`, `ufixed80x28`, `ufixed80x29`, `ufixed80x30`, `ufixed80x31`, `ufixed80x32`, `ufixed80x33`, `ufixed80x34`, `ufixed80x35`, `ufixed80x36`, `ufixed80x37`, `ufixed80x38`, `ufixed80x39`, `ufixed80x40`, `ufixed80x41`, `ufixed80x42`, `ufixed80x43`, `ufixed80x44`, `ufixed80x45`, `ufixed80x46`, `ufixed80x47`, `ufixed80x48`, `ufixed80x49`, `ufixed80x50`, `ufixed80x51`, `ufixed80x52`, `ufixed80x53`, `ufixed80x54`, `ufixed80x55`, `ufixed80x56`, `ufixed80x57`, `ufixed80x58`, `ufixed80x59`, `ufixed80x60`, `ufixed80x61`, `ufixed80x62`, `ufixed80x63`, `ufixed80x64`, `ufixed80x65`, `ufixed80x66`, `ufixed80x67`, `ufixed80x68`, `ufixed80x69`, `ufixed80x70`, `ufixed80x71`, `ufixed80x72`, `ufixed80x73`, `ufixed80x74`, `ufixed80x75`, `ufixed80x76`, `ufixed80x77`, `ufixed80x78`, `ufixed80x79`, `ufixed80x80`, `ufixed88x0`, `ufixed88x1`, `ufixed88x2`, `ufixed88x3`, `ufixed88x4`, `ufixed88x5`, `ufixed88x6`, `ufixed88x7`, `ufixed88x8`, `ufixed88x9`, `ufixed88x10`, `ufixed88x11`, `ufixed88x12`, `ufixed88x13`, `ufixed88x14`, `ufixed88x15`, `ufixed88x16`, `ufixed88x17`, `ufixed88x18`, `ufixed88x19`, `ufixed88x20`, `ufixed88x21`, `ufixed88x22`, `ufixed88x23`, `ufixed88x24`, `ufixed88x25`, `ufixed88x26`, `ufixed88x27`, `ufixed88x28`, `ufixed88x29`, `ufixed88x30`, `ufixed88x31`, `ufixed88x32`, `ufixed88x33`, `ufixed88x34`, `ufixed88x35`, `ufixed88x36`, `ufixed88x37`, `ufixed88x38`, `ufixed88x39`, `ufixed88x40`, `ufixed88x41`, `ufixed88x42`, `ufixed88x43`, `ufixed88x44`, `ufixed88x45`, `ufixed88x46`, `ufixed88x47`, `ufixed88x48`, `ufixed88x49`, `ufixed88x50`, `ufixed88x51`, `ufixed88x52`, `ufixed88x53`, `ufixed88x54`, `ufixed88x55`, `ufixed88x56`, `ufixed88x57`, `ufixed88x58`, `ufixed88x59`, `ufixed88x60`, `ufixed88x61`, `ufixed88x62`, `ufixed88x63`, `ufixed88x64`, `ufixed88x65`, `ufixed88x66`, `ufixed88x67`, `ufixed88x68`, `ufixed88x69`, `ufixed88x70`, `ufixed88x71`, `ufixed88x72`, `ufixed88x73`, `ufixed88x74`, `ufixed88x75`, `ufixed88x76`, `ufixed88x77`, `ufixed88x78`, `ufixed88x79`, `ufixed88x80`, `ufixed96x0`, `ufixed96x1`, `ufixed96x2`, `ufixed96x3`, `ufixed96x4`, `ufixed96x5`, `ufixed96x6`, `ufixed96x7`, `ufixed96x8`, `ufixed96x9`, `ufixed96x10`, `ufixed96x11`, `ufixed96x12`, `ufixed96x13`, `ufixed96x14`, `ufixed96x15`, `ufixed96x16`, `ufixed96x17`, `ufixed96x18`, `ufixed96x19`, `ufixed96x20`, `ufixed96x21`, `ufixed96x22`, `ufixed96x23`, `ufixed96x24`, `ufixed96x25`, `ufixed96x26`, `ufixed96x27`, `ufixed96x28`, `ufixed96x29`, `ufixed96x30`, `ufixed96x31`, `ufixed96x32`, `ufixed96x33`, `ufixed96x34`, `ufixed96x35`, `ufixed96x36`, `ufixed96x37`, `ufixed96x38`, `ufixed96x39`, `ufixed96x40`, `ufixed96x41`, `ufixed96x42`, `ufixed96x43`, `ufixed96x44`, `ufixed96x45`, `ufixed96x46`, `ufixed96x47`, `ufixed96x48`, `ufixed96x49`, `ufixed96x50`, `ufixed96x51`, `ufixed96x52`, `ufixed96x53`, `ufixed96x54`, `ufixed96x55`, `ufixed96x56`, `ufixed96x57`, `ufixed96x58`, `ufixed96x59`, `ufixed96x60`, `ufixed96x61`, `ufixed96x62`, `ufixed96x63`, `ufixed96x64`, `ufixed96x65`, `ufixed96x66`, `ufixed96x67`, `ufixed96x68`, `ufixed96x69`, `ufixed96x70`, `ufixed96x71`, `ufixed96x72`, `ufixed96x73`, `ufixed96x74`, `ufixed96x75`, `ufixed96x76`, `ufixed96x77`, `ufixed96x78`, `ufixed96x79`, `ufixed96x80`, `ufixed104x0`, `ufixed104x1`, `ufixed104x2`, `ufixed104x3`, `ufixed104x4`, `ufixed104x5`, `ufixed104x6`, `ufixed104x7`, `ufixed104x8`, `ufixed104x9`, `ufixed104x10`, `ufixed104x11`, `ufixed104x12`, `ufixed104x13`, `ufixed104x14`, `ufixed104x15`, `ufixed104x16`, `ufixed104x17`, `ufixed104x18`, `ufixed104x19`, `ufixed104x20`, `ufixed104x21`, `ufixed104x22`, `ufixed104x23`, `ufixed104x24`, `ufixed104x25`, `ufixed104x26`, `ufixed104x27`, `ufixed104x28`, `ufixed104x29`, `ufixed104x30`, `ufixed104x31`, `ufixed104x32`, `ufixed104x33`, `ufixed104x34`, `ufixed104x35`, `ufixed104x36`, `ufixed104x37`, `ufixed104x38`, `ufixed104x39`, `ufixed104x40`, `ufixed104x41`, `ufixed104x42`, `ufixed104x43`, `ufixed104x44`, `ufixed104x45`, `ufixed104x46`, `ufixed104x47`, `ufixed104x48`, `ufixed104x49`, `ufixed104x50`, `ufixed104x51`, `ufixed104x52`, `ufixed104x53`, `ufixed104x54`, `ufixed104x55`, `ufixed104x56`, `ufixed104x57`, `ufixed104x58`, `ufixed104x59`, `ufixed104x60`, `ufixed104x61`, `ufixed104x62`, `ufixed104x63`, `ufixed104x64`, `ufixed104x65`, `ufixed104x66`, `ufixed104x67`, `ufixed104x68`, `ufixed104x69`, `ufixed104x70`, `ufixed104x71`, `ufixed104x72`, `ufixed104x73`, `ufixed104x74`, `ufixed104x75`, `ufixed104x76`, `ufixed104x77`, `ufixed104x78`, `ufixed104x79`, `ufixed104x80`, `ufixed112x0`, `ufixed112x1`, `ufixed112x2`, `ufixed112x3`, `ufixed112x4`, `ufixed112x5`, `ufixed112x6`, `ufixed112x7`, `ufixed112x8`, `ufixed112x9`, `ufixed112x10`, `ufixed112x11`, `ufixed112x12`, `ufixed112x13`, `ufixed112x14`, `ufixed112x15`, `ufixed112x16`, `ufixed112x17`, `ufixed112x18`, `ufixed112x19`, `ufixed112x20`, `ufixed112x21`, `ufixed112x22`, `ufixed112x23`, `ufixed112x24`, `ufixed112x25`, `ufixed112x26`, `ufixed112x27`, `ufixed112x28`, `ufixed112x29`, `ufixed112x30`, `ufixed112x31`, `ufixed112x32`, `ufixed112x33`, `ufixed112x34`, `ufixed112x35`, `ufixed112x36`, `ufixed112x37`, `ufixed112x38`, `ufixed112x39`, `ufixed112x40`, `ufixed112x41`, `ufixed112x42`, `ufixed112x43`, `ufixed112x44`, `ufixed112x45`, `ufixed112x46`, `ufixed112x47`, `ufixed112x48`, `ufixed112x49`, `ufixed112x50`, `ufixed112x51`, `ufixed112x52`, `ufixed112x53`, `ufixed112x54`, `ufixed112x55`, `ufixed112x56`, `ufixed112x57`, `ufixed112x58`, `ufixed112x59`, `ufixed112x60`, `ufixed112x61`, `ufixed112x62`, `ufixed112x63`, `ufixed112x64`, `ufixed112x65`, `ufixed112x66`, `ufixed112x67`, `ufixed112x68`, `ufixed112x69`, `ufixed112x70`, `ufixed112x71`, `ufixed112x72`, `ufixed112x73`, `ufixed112x74`, `ufixed112x75`, `ufixed112x76`, `ufixed112x77`, `ufixed112x78`, `ufixed112x79`, `ufixed112x80`, `ufixed120x0`, `ufixed120x1`, `ufixed120x2`, `ufixed120x3`, `ufixed120x4`, `ufixed120x5`, `ufixed120x6`, `ufixed120x7`, `ufixed120x8`, `ufixed120x9`, `ufixed120x10`, `ufixed120x11`, `ufixed120x12`, `ufixed120x13`, `ufixed120x14`, `ufixed120x15`, `ufixed120x16`, `ufixed120x17`, `ufixed120x18`, `ufixed120x19`, `ufixed120x20`, `ufixed120x21`, `ufixed120x22`, `ufixed120x23`, `ufixed120x24`, `ufixed120x25`, `ufixed120x26`, `ufixed120x27`, `ufixed120x28`, `ufixed120x29`, `ufixed120x30`, `ufixed120x31`, `ufixed120x32`, `ufixed120x33`, `ufixed120x34`, `ufixed120x35`, `ufixed120x36`, `ufixed120x37`, `ufixed120x38`, `ufixed120x39`, `ufixed120x40`, `ufixed120x41`, `ufixed120x42`, `ufixed120x43`, `ufixed120x44`, `ufixed120x45`, `ufixed120x46`, `ufixed120x47`, `ufixed120x48`, `ufixed120x49`, `ufixed120x50`, `ufixed120x51`, `ufixed120x52`, `ufixed120x53`, `ufixed120x54`, `ufixed120x55`, `ufixed120x56`, `ufixed120x57`, `ufixed120x58`, `ufixed120x59`, `ufixed120x60`, `ufixed120x61`, `ufixed120x62`, `ufixed120x63`, `ufixed120x64`, `ufixed120x65`, `ufixed120x66`, `ufixed120x67`, `ufixed120x68`, `ufixed120x69`, `ufixed120x70`, `ufixed120x71`, `ufixed120x72`, `ufixed120x73`, `ufixed120x74`, `ufixed120x75`, `ufixed120x76`, `ufixed120x77`, `ufixed120x78`, `ufixed120x79`, `ufixed120x80`, `ufixed128x0`, `ufixed128x1`, `ufixed128x2`, `ufixed128x3`, `ufixed128x4`, `ufixed128x5`, `ufixed128x6`, `ufixed128x7`, `ufixed128x8`, `ufixed128x9`, `ufixed128x10`, `ufixed128x11`, `ufixed128x12`, `ufixed128x13`, `ufixed128x14`, `ufixed128x15`, `ufixed128x16`, `ufixed128x17`, `ufixed128x18`, `ufixed128x19`, `ufixed128x20`, `ufixed128x21`, `ufixed128x22`, `ufixed128x23`, `ufixed128x24`, `ufixed128x25`, `ufixed128x26`, `ufixed128x27`, `ufixed128x28`, `ufixed128x29`, `ufixed128x30`, `ufixed128x31`, `ufixed128x32`, `ufixed128x33`, `ufixed128x34`, `ufixed128x35`, `ufixed128x36`, `ufixed128x37`, `ufixed128x38`, `ufixed128x39`, `ufixed128x40`, `ufixed128x41`, `ufixed128x42`, `ufixed128x43`, `ufixed128x44`, `ufixed128x45`, `ufixed128x46`, `ufixed128x47`, `ufixed128x48`, `ufixed128x49`, `ufixed128x50`, `ufixed128x51`, `ufixed128x52`, `ufixed128x53`, `ufixed128x54`, `ufixed128x55`, `ufixed128x56`, `ufixed128x57`, `ufixed128x58`, `ufixed128x59`, `ufixed128x60`, `ufixed128x61`, `ufixed128x62`, `ufixed128x63`, `ufixed128x64`, `ufixed128x65`, `ufixed128x66`, `ufixed128x67`, `ufixed128x68`, `ufixed128x69`, `ufixed128x70`, `ufixed128x71`, `ufixed128x72`, `ufixed128x73`, `ufixed128x74`, `ufixed128x75`, `ufixed128x76`, `ufixed128x77`, `ufixed128x78`, `ufixed128x79`, `ufixed128x80`, `ufixed136x0`, `ufixed136x1`, `ufixed136x2`, `ufixed136x3`, `ufixed136x4`, `ufixed136x5`, `ufixed136x6`, `ufixed136x7`, `ufixed136x8`, `ufixed136x9`, `ufixed136x10`, `ufixed136x11`, `ufixed136x12`, `ufixed136x13`, `ufixed136x14`, `ufixed136x15`, `ufixed136x16`, `ufixed136x17`, `ufixed136x18`, `ufixed136x19`, `ufixed136x20`, `ufixed136x21`, `ufixed136x22`, `ufixed136x23`, `ufixed136x24`, `ufixed136x25`, `ufixed136x26`, `ufixed136x27`, `ufixed136x28`, `ufixed136x29`, `ufixed136x30`, `ufixed136x31`, `ufixed136x32`, `ufixed136x33`, `ufixed136x34`, `ufixed136x35`, `ufixed136x36`, `ufixed136x37`, `ufixed136x38`, `ufixed136x39`, `ufixed136x40`, `ufixed136x41`, `ufixed136x42`, `ufixed136x43`, `ufixed136x44`, `ufixed136x45`, `ufixed136x46`, `ufixed136x47`, `ufixed136x48`, `ufixed136x49`, `ufixed136x50`, `ufixed136x51`, `ufixed136x52`, `ufixed136x53`, `ufixed136x54`, `ufixed136x55`, `ufixed136x56`, `ufixed136x57`, `ufixed136x58`, `ufixed136x59`, `ufixed136x60`, `ufixed136x61`, `ufixed136x62`, `ufixed136x63`, `ufixed136x64`, `ufixed136x65`, `ufixed136x66`, `ufixed136x67`, `ufixed136x68`, `ufixed136x69`, `ufixed136x70`, `ufixed136x71`, `ufixed136x72`, `ufixed136x73`, `ufixed136x74`, `ufixed136x75`, `ufixed136x76`, `ufixed136x77`, `ufixed136x78`, `ufixed136x79`, `ufixed136x80`, `ufixed144x0`, `ufixed144x1`, `ufixed144x2`, `ufixed144x3`, `ufixed144x4`, `ufixed144x5`, `ufixed144x6`, `ufixed144x7`, `ufixed144x8`, `ufixed144x9`, `ufixed144x10`, `ufixed144x11`, `ufixed144x12`, `ufixed144x13`, `ufixed144x14`, `ufixed144x15`, `ufixed144x16`, `ufixed144x17`, `ufixed144x18`, `ufixed144x19`, `ufixed144x20`, `ufixed144x21`, `ufixed144x22`, `ufixed144x23`, `ufixed144x24`, `ufixed144x25`, `ufixed144x26`, `ufixed144x27`, `ufixed144x28`, `ufixed144x29`, `ufixed144x30`, `ufixed144x31`, `ufixed144x32`, `ufixed144x33`, `ufixed144x34`, `ufixed144x35`, `ufixed144x36`, `ufixed144x37`, `ufixed144x38`, `ufixed144x39`, `ufixed144x40`, `ufixed144x41`, `ufixed144x42`, `ufixed144x43`, `ufixed144x44`, `ufixed144x45`, `ufixed144x46`, `ufixed144x47`, `ufixed144x48`, `ufixed144x49`, `ufixed144x50`, `ufixed144x51`, `ufixed144x52`, `ufixed144x53`, `ufixed144x54`, `ufixed144x55`, `ufixed144x56`, `ufixed144x57`, `ufixed144x58`, `ufixed144x59`, `ufixed144x60`, `ufixed144x61`, `ufixed144x62`, `ufixed144x63`, `ufixed144x64`, `ufixed144x65`, `ufixed144x66`, `ufixed144x67`, `ufixed144x68`, `ufixed144x69`, `ufixed144x70`, `ufixed144x71`, `ufixed144x72`, `ufixed144x73`, `ufixed144x74`, `ufixed144x75`, `ufixed144x76`, `ufixed144x77`, `ufixed144x78`, `ufixed144x79`, `ufixed144x80`, `ufixed152x0`, `ufixed152x1`, `ufixed152x2`, `ufixed152x3`, `ufixed152x4`, `ufixed152x5`, `ufixed152x6`, `ufixed152x7`, `ufixed152x8`, `ufixed152x9`, `ufixed152x10`, `ufixed152x11`, `ufixed152x12`, `ufixed152x13`, `ufixed152x14`, `ufixed152x15`, `ufixed152x16`, `ufixed152x17`, `ufixed152x18`, `ufixed152x19`, `ufixed152x20`, `ufixed152x21`, `ufixed152x22`, `ufixed152x23`, `ufixed152x24`, `ufixed152x25`, `ufixed152x26`, `ufixed152x27`, `ufixed152x28`, `ufixed152x29`, `ufixed152x30`, `ufixed152x31`, `ufixed152x32`, `ufixed152x33`, `ufixed152x34`, `ufixed152x35`, `ufixed152x36`, `ufixed152x37`, `ufixed152x38`, `ufixed152x39`, `ufixed152x40`, `ufixed152x41`, `ufixed152x42`, `ufixed152x43`, `ufixed152x44`, `ufixed152x45`, `ufixed152x46`, `ufixed152x47`, `ufixed152x48`, `ufixed152x49`, `ufixed152x50`, `ufixed152x51`, `ufixed152x52`, `ufixed152x53`, `ufixed152x54`, `ufixed152x55`, `ufixed152x56`, `ufixed152x57`, `ufixed152x58`, `ufixed152x59`, `ufixed152x60`, `ufixed152x61`, `ufixed152x62`, `ufixed152x63`, `ufixed152x64`, `ufixed152x65`, `ufixed152x66`, `ufixed152x67`, `ufixed152x68`, `ufixed152x69`, `ufixed152x70`, `ufixed152x71`, `ufixed152x72`, `ufixed152x73`, `ufixed152x74`, `ufixed152x75`, `ufixed152x76`, `ufixed152x77`, `ufixed152x78`, `ufixed152x79`, `ufixed152x80`, `ufixed160x0`, `ufixed160x1`, `ufixed160x2`, `ufixed160x3`, `ufixed160x4`, `ufixed160x5`, `ufixed160x6`, `ufixed160x7`, `ufixed160x8`, `ufixed160x9`, `ufixed160x10`, `ufixed160x11`, `ufixed160x12`, `ufixed160x13`, `ufixed160x14`, `ufixed160x15`, `ufixed160x16`, `ufixed160x17`, `ufixed160x18`, `ufixed160x19`, `ufixed160x20`, `ufixed160x21`, `ufixed160x22`, `ufixed160x23`, `ufixed160x24`, `ufixed160x25`, `ufixed160x26`, `ufixed160x27`, `ufixed160x28`, `ufixed160x29`, `ufixed160x30`, `ufixed160x31`, `ufixed160x32`, `ufixed160x33`, `ufixed160x34`, `ufixed160x35`, `ufixed160x36`, `ufixed160x37`, `ufixed160x38`, `ufixed160x39`, `ufixed160x40`, `ufixed160x41`, `ufixed160x42`, `ufixed160x43`, `ufixed160x44`, `ufixed160x45`, `ufixed160x46`, `ufixed160x47`, `ufixed160x48`, `ufixed160x49`, `ufixed160x50`, `ufixed160x51`, `ufixed160x52`, `ufixed160x53`, `ufixed160x54`, `ufixed160x55`, `ufixed160x56`, `ufixed160x57`, `ufixed160x58`, `ufixed160x59`, `ufixed160x60`, `ufixed160x61`, `ufixed160x62`, `ufixed160x63`, `ufixed160x64`, `ufixed160x65`, `ufixed160x66`, `ufixed160x67`, `ufixed160x68`, `ufixed160x69`, `ufixed160x70`, `ufixed160x71`, `ufixed160x72`, `ufixed160x73`, `ufixed160x74`, `ufixed160x75`, `ufixed160x76`, `ufixed160x77`, `ufixed160x78`, `ufixed160x79`, `ufixed160x80`, `ufixed168x0`, `ufixed168x1`, `ufixed168x2`, `ufixed168x3`, `ufixed168x4`, `ufixed168x5`, `ufixed168x6`, `ufixed168x7`, `ufixed168x8`, `ufixed168x9`, `ufixed168x10`, `ufixed168x11`, `ufixed168x12`, `ufixed168x13`, `ufixed168x14`, `ufixed168x15`, `ufixed168x16`, `ufixed168x17`, `ufixed168x18`, `ufixed168x19`, `ufixed168x20`, `ufixed168x21`, `ufixed168x22`, `ufixed168x23`, `ufixed168x24`, `ufixed168x25`, `ufixed168x26`, `ufixed168x27`, `ufixed168x28`, `ufixed168x29`, `ufixed168x30`, `ufixed168x31`, `ufixed168x32`, `ufixed168x33`, `ufixed168x34`, `ufixed168x35`, `ufixed168x36`, `ufixed168x37`, `ufixed168x38`, `ufixed168x39`, `ufixed168x40`, `ufixed168x41`, `ufixed168x42`, `ufixed168x43`, `ufixed168x44`, `ufixed168x45`, `ufixed168x46`, `ufixed168x47`, `ufixed168x48`, `ufixed168x49`, `ufixed168x50`, `ufixed168x51`, `ufixed168x52`, `ufixed168x53`, `ufixed168x54`, `ufixed168x55`, `ufixed168x56`, `ufixed168x57`, `ufixed168x58`, `ufixed168x59`, `ufixed168x60`, `ufixed168x61`, `ufixed168x62`, `ufixed168x63`, `ufixed168x64`, `ufixed168x65`, `ufixed168x66`, `ufixed168x67`, `ufixed168x68`, `ufixed168x69`, `ufixed168x70`, `ufixed168x71`, `ufixed168x72`, `ufixed168x73`, `ufixed168x74`, `ufixed168x75`, `ufixed168x76`, `ufixed168x77`, `ufixed168x78`, `ufixed168x79`, `ufixed168x80`, `ufixed176x0`, `ufixed176x1`, `ufixed176x2`, `ufixed176x3`, `ufixed176x4`, `ufixed176x5`, `ufixed176x6`, `ufixed176x7`, `ufixed176x8`, `ufixed176x9`, `ufixed176x10`, `ufixed176x11`, `ufixed176x12`, `ufixed176x13`, `ufixed176x14`, `ufixed176x15`, `ufixed176x16`, `ufixed176x17`, `ufixed176x18`, `ufixed176x19`, `ufixed176x20`, `ufixed176x21`, `ufixed176x22`, `ufixed176x23`, `ufixed176x24`, `ufixed176x25`, `ufixed176x26`, `ufixed176x27`, `ufixed176x28`, `ufixed176x29`, `ufixed176x30`, `ufixed176x31`, `ufixed176x32`, `ufixed176x33`, `ufixed176x34`, `ufixed176x35`, `ufixed176x36`, `ufixed176x37`, `ufixed176x38`, `ufixed176x39`, `ufixed176x40`, `ufixed176x41`, `ufixed176x42`, `ufixed176x43`, `ufixed176x44`, `ufixed176x45`, `ufixed176x46`, `ufixed176x47`, `ufixed176x48`, `ufixed176x49`, `ufixed176x50`, `ufixed176x51`, `ufixed176x52`, `ufixed176x53`, `ufixed176x54`, `ufixed176x55`, `ufixed176x56`, `ufixed176x57`, `ufixed176x58`, `ufixed176x59`, `ufixed176x60`, `ufixed176x61`, `ufixed176x62`, `ufixed176x63`, `ufixed176x64`, `ufixed176x65`, `ufixed176x66`, `ufixed176x67`, `ufixed176x68`, `ufixed176x69`, `ufixed176x70`, `ufixed176x71`, `ufixed176x72`, `ufixed176x73`, `ufixed176x74`, `ufixed176x75`, `ufixed176x76`, `ufixed176x77`, `ufixed176x78`, `ufixed176x79`, `ufixed176x80`, `ufixed184x0`, `ufixed184x1`, `ufixed184x2`, `ufixed184x3`, `ufixed184x4`, `ufixed184x5`, `ufixed184x6`, `ufixed184x7`, `ufixed184x8`, `ufixed184x9`, `ufixed184x10`, `ufixed184x11`, `ufixed184x12`, `ufixed184x13`, `ufixed184x14`, `ufixed184x15`, `ufixed184x16`, `ufixed184x17`, `ufixed184x18`, `ufixed184x19`, `ufixed184x20`, `ufixed184x21`, `ufixed184x22`, `ufixed184x23`, `ufixed184x24`, `ufixed184x25`, `ufixed184x26`, `ufixed184x27`, `ufixed184x28`, `ufixed184x29`, `ufixed184x30`, `ufixed184x31`, `ufixed184x32`, `ufixed184x33`, `ufixed184x34`, `ufixed184x35`, `ufixed184x36`, `ufixed184x37`, `ufixed184x38`, `ufixed184x39`, `ufixed184x40`, `ufixed184x41`, `ufixed184x42`, `ufixed184x43`, `ufixed184x44`, `ufixed184x45`, `ufixed184x46`, `ufixed184x47`, `ufixed184x48`, `ufixed184x49`, `ufixed184x50`, `ufixed184x51`, `ufixed184x52`, `ufixed184x53`, `ufixed184x54`, `ufixed184x55`, `ufixed184x56`, `ufixed184x57`, `ufixed184x58`, `ufixed184x59`, `ufixed184x60`, `ufixed184x61`, `ufixed184x62`, `ufixed184x63`, `ufixed184x64`, `ufixed184x65`, `ufixed184x66`, `ufixed184x67`, `ufixed184x68`, `ufixed184x69`, `ufixed184x70`, `ufixed184x71`, `ufixed184x72`, `ufixed192x0`, `ufixed192x1`, `ufixed192x2`, `ufixed192x3`, `ufixed192x4`, `ufixed192x5`, `ufixed192x6`, `ufixed192x7`, `ufixed192x8`, `ufixed192x9`, `ufixed192x10`, `ufixed192x11`, `ufixed192x12`, `ufixed192x13`, `ufixed192x14`, `ufixed192x15`, `ufixed192x16`, `ufixed192x17`, `ufixed192x18`, `ufixed192x19`, `ufixed192x20`, `ufixed192x21`, `ufixed192x22`, `ufixed192x23`, `ufixed192x24`, `ufixed192x25`, `ufixed192x26`, `ufixed192x27`, `ufixed192x28`, `ufixed192x29`, `ufixed192x30`, `ufixed192x31`, `ufixed192x32`, `ufixed192x33`, `ufixed192x34`, `ufixed192x35`, `ufixed192x36`, `ufixed192x37`, `ufixed192x38`, `ufixed192x39`, `ufixed192x40`, `ufixed192x41`, `ufixed192x42`, `ufixed192x43`, `ufixed192x44`, `ufixed192x45`, `ufixed192x46`, `ufixed192x47`, `ufixed192x48`, `ufixed192x49`, `ufixed192x50`, `ufixed192x51`, `ufixed192x52`, `ufixed192x53`, `ufixed192x54`, `ufixed192x55`, `ufixed192x56`, `ufixed192x57`, `ufixed192x58`, `ufixed192x59`, `ufixed192x60`, `ufixed192x61`, `ufixed192x62`, `ufixed192x63`, `ufixed192x64`, `ufixed200x0`, `ufixed200x1`, `ufixed200x2`, `ufixed200x3`, `ufixed200x4`, `ufixed200x5`, `ufixed200x6`, `ufixed200x7`, `ufixed200x8`, `ufixed200x9`, `ufixed200x10`, `ufixed200x11`, `ufixed200x12`, `ufixed200x13`, `ufixed200x14`, `ufixed200x15`, `ufixed200x16`, `ufixed200x17`, `ufixed200x18`, `ufixed200x19`, `ufixed200x20`, `ufixed200x21`, `ufixed200x22`, `ufixed200x23`, `ufixed200x24`, `ufixed200x25`, `ufixed200x26`, `ufixed200x27`, `ufixed200x28`, `ufixed200x29`, `ufixed200x30`, `ufixed200x31`, `ufixed200x32`, `ufixed200x33`, `ufixed200x34`, `ufixed200x35`, `ufixed200x36`, `ufixed200x37`, `ufixed200x38`, `ufixed200x39`, `ufixed200x40`, `ufixed200x41`, `ufixed200x42`, `ufixed200x43`, `ufixed200x44`, `ufixed200x45`, `ufixed200x46`, `ufixed200x47`, `ufixed200x48`, `ufixed200x49`, `ufixed200x50`, `ufixed200x51`, `ufixed200x52`, `ufixed200x53`, `ufixed200x54`, `ufixed200x55`, `ufixed200x56`, `ufixed208x0`, `ufixed208x1`, `ufixed208x2`, `ufixed208x3`, `ufixed208x4`, `ufixed208x5`, `ufixed208x6`, `ufixed208x7`, `ufixed208x8`, `ufixed208x9`, `ufixed208x10`, `ufixed208x11`, `ufixed208x12`, `ufixed208x13`, `ufixed208x14`, `ufixed208x15`, `ufixed208x16`, `ufixed208x17`, `ufixed208x18`, `ufixed208x19`, `ufixed208x20`, `ufixed208x21`, `ufixed208x22`, `ufixed208x23`, `ufixed208x24`, `ufixed208x25`, `ufixed208x26`, `ufixed208x27`, `ufixed208x28`, `ufixed208x29`, `ufixed208x30`, `ufixed208x31`, `ufixed208x32`, `ufixed208x33`, `ufixed208x34`, `ufixed208x35`, `ufixed208x36`, `ufixed208x37`, `ufixed208x38`, `ufixed208x39`, `ufixed208x40`, `ufixed208x41`, `ufixed208x42`, `ufixed208x43`, `ufixed208x44`, `ufixed208x45`, `ufixed208x46`, `ufixed208x47`, `ufixed208x48`, `ufixed216x0`, `ufixed216x1`, `ufixed216x2`, `ufixed216x3`, `ufixed216x4`, `ufixed216x5`, `ufixed216x6`, `ufixed216x7`, `ufixed216x8`, `ufixed216x9`, `ufixed216x10`, `ufixed216x11`, `ufixed216x12`, `ufixed216x13`, `ufixed216x14`, `ufixed216x15`, `ufixed216x16`, `ufixed216x17`, `ufixed216x18`, `ufixed216x19`, `ufixed216x20`, `ufixed216x21`, `ufixed216x22`, `ufixed216x23`, `ufixed216x24`, `ufixed216x25`, `ufixed216x26`, `ufixed216x27`, `ufixed216x28`, `ufixed216x29`, `ufixed216x30`, `ufixed216x31`, `ufixed216x32`, `ufixed216x33`, `ufixed216x34`, `ufixed216x35`, `ufixed216x36`, `ufixed216x37`, `ufixed216x38`, `ufixed216x39`, `ufixed216x40`, `ufixed224x0`, `ufixed224x1`, `ufixed224x2`, `ufixed224x3`, `ufixed224x4`, `ufixed224x5`, `ufixed224x6`, `ufixed224x7`, `ufixed224x8`, `ufixed224x9`, `ufixed224x10`, `ufixed224x11`, `ufixed224x12`, `ufixed224x13`, `ufixed224x14`, `ufixed224x15`, `ufixed224x16`, `ufixed224x17`, `ufixed224x18`, `ufixed224x19`, `ufixed224x20`, `ufixed224x21`, `ufixed224x22`, `ufixed224x23`, `ufixed224x24`, `ufixed224x25`, `ufixed224x26`, `ufixed224x27`, `ufixed224x28`, `ufixed224x29`, `ufixed224x30`, `ufixed224x31`, `ufixed224x32`, `ufixed232x0`, `ufixed232x1`, `ufixed232x2`, `ufixed232x3`, `ufixed232x4`, `ufixed232x5`, `ufixed232x6`, `ufixed232x7`, `ufixed232x8`, `ufixed232x9`, `ufixed232x10`, `ufixed232x11`, `ufixed232x12`, `ufixed232x13`, `ufixed232x14`, `ufixed232x15`, `ufixed232x16`, `ufixed232x17`, `ufixed232x18`, `ufixed232x19`, `ufixed232x20`, `ufixed232x21`, `ufixed232x22`, `ufixed232x23`, `ufixed232x24`, `ufixed240x0`, `ufixed240x1`, `ufixed240x2`, `ufixed240x3`, `ufixed240x4`, `ufixed240x5`, `ufixed240x6`, `ufixed240x7`, `ufixed240x8`, `ufixed240x9`, `ufixed240x10`, `ufixed240x11`, `ufixed240x12`, `ufixed240x13`, `ufixed240x14`, `ufixed240x15`, `ufixed240x16`, `ufixed248x0`, `ufixed248x1`, `ufixed248x2`, `ufixed248x3`, `ufixed248x4`, `ufixed248x5`, `ufixed248x6`, `ufixed248x7`, `ufixed248x8`, `ufixed256x0`), KeywordType, nil}, - }, - "numbers": { - {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - }, - "string-parse-common": { - {`\\(u[0-9a-fA-F]{4}|x..|[^x])`, LiteralStringEscape, nil}, - {`[^\\"\'\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "string-parse-double": { - {`"`, LiteralString, Pop(1)}, - {`'`, LiteralString, nil}, - }, - "string-parse-single": { - {`'`, LiteralString, Pop(1)}, - {`"`, LiteralString, nil}, - }, - "strings": { - {`hex'[0-9a-fA-F]+'`, LiteralString, nil}, - {`hex"[0-9a-fA-F]+"`, LiteralString, nil}, - {`"`, LiteralString, Combined("string-parse-common", "string-parse-double")}, - {`'`, LiteralString, Combined("string-parse-common", "string-parse-single")}, - }, - "whitespace": { - {`\s+`, Text, nil}, - }, - "root": { - Include("comments"), - Include("keywords-types"), - Include("keywords-other"), - Include("numbers"), - Include("strings"), - Include("whitespace"), - {`\+\+|--|\*\*|\?|:|~|&&|\|\||=>|==?|!=?|(<<|>>>?|[-<>+*%&|^/])=?`, Operator, nil}, - {`[{(\[;,]`, Punctuation, nil}, - {`[})\].]`, Punctuation, nil}, - {`(block|msg|now|this|super|tx)\b`, NameBuiltin, nil}, - {`(sender|origin)\b`, NameBuiltin, nil}, - {`(gas|value)\b`, NameBuiltin, nil}, - {`(selfdestruct|suicide)\b`, NameBuiltin, nil}, - {`(balance|send|transfer)\b`, NameBuiltin, nil}, - {`(assert|revert|require)\b`, NameBuiltin, nil}, - {`(call|callcode|delegatecall)\b`, NameBuiltin, nil}, - {`selector\b`, NameBuiltin, nil}, - {`(addmod|ecrecover|keccak256|mulmod|ripemd160|sha256|sha3)\b`, NameFunction, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/sparql.go b/vendor/github.com/alecthomas/chroma/lexers/s/sparql.go deleted file mode 100644 index 47a1716b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/sparql.go +++ /dev/null @@ -1,69 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Sparql lexer. -var Sparql = internal.Register(MustNewLexer( - &Config{ - Name: "SPARQL", - Aliases: []string{"sparql"}, - Filenames: []string{"*.rq", "*.sparql"}, - MimeTypes: []string{"application/sparql-query"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`((?i)select|construct|describe|ask|where|filter|group\s+by|minus|distinct|reduced|from\s+named|from|order\s+by|desc|asc|limit|offset|bindings|load|clear|drop|create|add|move|copy|insert\s+data|delete\s+data|delete\s+where|delete|insert|using\s+named|using|graph|default|named|all|optional|service|silent|bind|union|not\s+in|in|as|having|to|prefix|base)\b`, Keyword, nil}, - {`(a)\b`, Keyword, nil}, - {"(<(?:[^<>\"{}|^`\\\\\\x00-\\x20])*>)", NameLabel, nil}, - {`(_:[0-9a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_](?:[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀.]*[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀])?)`, NameLabel, nil}, - {`[?$][0-9a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_][a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9·̀-ͯ‿-⁀]*`, NameVariable, nil}, - {`([a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�](?:[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀.]*[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀])?)?(\:)((?:[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_:0-9]|(?:%[0-9A-Fa-f][0-9A-Fa-f])|(?:\\[ _~.\-!$&"()*+,;=/?#@%]))(?:(?:[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀.:]|(?:%[0-9A-Fa-f][0-9A-Fa-f])|(?:\\[ _~.\-!$&"()*+,;=/?#@%]))*(?:[a-zA-ZÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_\-0-9·̀-ͯ‿-⁀:]|(?:%[0-9A-Fa-f][0-9A-Fa-f])|(?:\\[ _~.\-!$&"()*+,;=/?#@%])))?)?`, ByGroups(NameNamespace, Punctuation, NameTag), nil}, - {`((?i)str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|contains|strstarts|strends|strbefore|strafter|year|month|day|hours|minutes|seconds|timezone|tz|now|md5|sha1|sha256|sha384|sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|isliteral|isnumeric|regex|substr|replace|exists|not\s+exists|count|sum|min|max|avg|sample|group_concat|separator)\b`, NameFunction, nil}, - {`(true|false)`, KeywordConstant, nil}, - {`[+\-]?(\d+\.\d*[eE][+-]?\d+|\.?\d+[eE][+-]?\d+)`, LiteralNumberFloat, nil}, - {`[+\-]?(\d+\.\d*|\.\d+)`, LiteralNumberFloat, nil}, - {`[+\-]?\d+`, LiteralNumberInteger, nil}, - {`(\|\||&&|=|\*|\-|\+|/|!=|<=|>=|!|<|>)`, Operator, nil}, - {`[(){}.;,:^\[\]]`, Punctuation, nil}, - {`#[^\n]*`, Comment, nil}, - {`"""`, LiteralString, Push("triple-double-quoted-string")}, - {`"`, LiteralString, Push("single-double-quoted-string")}, - {`'''`, LiteralString, Push("triple-single-quoted-string")}, - {`'`, LiteralString, Push("single-single-quoted-string")}, - }, - "triple-double-quoted-string": { - {`"""`, LiteralString, Push("end-of-string")}, - {`[^\\]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "single-double-quoted-string": { - {`"`, LiteralString, Push("end-of-string")}, - {`[^"\\\n]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "triple-single-quoted-string": { - {`'''`, LiteralString, Push("end-of-string")}, - {`[^\\]+`, LiteralString, nil}, - {`\\`, LiteralStringEscape, Push("string-escape")}, - }, - "single-single-quoted-string": { - {`'`, LiteralString, Push("end-of-string")}, - {`[^'\\\n]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "string-escape": { - {`u[0-9A-Fa-f]{4}`, LiteralStringEscape, Pop(1)}, - {`U[0-9A-Fa-f]{8}`, LiteralStringEscape, Pop(1)}, - {`.`, LiteralStringEscape, Pop(1)}, - }, - "end-of-string": { - {`(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)`, ByGroups(Operator, NameFunction), Pop(2)}, - {`\^\^`, Operator, Pop(2)}, - Default(Pop(2)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/sql.go b/vendor/github.com/alecthomas/chroma/lexers/s/sql.go deleted file mode 100644 index 6f4e3e07..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/sql.go +++ /dev/null @@ -1,49 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// SQL lexer. -var SQL = internal.Register(MustNewLexer( - &Config{ - Name: "SQL", - Aliases: []string{"sql"}, - Filenames: []string{"*.sql"}, - MimeTypes: []string{"text/x-sql"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`--.*\n?`, CommentSingle, nil}, - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`'`, LiteralStringSingle, Push("string")}, - {`"`, LiteralStringDouble, Push("double-string")}, - {Words(``, `\b`, `ABORT`, `ABS`, `ABSOLUTE`, `ACCESS`, `ADA`, `ADD`, `ADMIN`, `AFTER`, `AGGREGATE`, `ALIAS`, `ALL`, `ALLOCATE`, `ALTER`, `ANALYSE`, `ANALYZE`, `AND`, `ANY`, `ARE`, `AS`, `ASC`, `ASENSITIVE`, `ASSERTION`, `ASSIGNMENT`, `ASYMMETRIC`, `AT`, `ATOMIC`, `AUTHORIZATION`, `AVG`, `BACKWARD`, `BEFORE`, `BEGIN`, `BETWEEN`, `BITVAR`, `BIT_LENGTH`, `BOTH`, `BREADTH`, `BY`, `C`, `CACHE`, `CALL`, `CALLED`, `CARDINALITY`, `CASCADE`, `CASCADED`, `CASE`, `CAST`, `CATALOG`, `CATALOG_NAME`, `CHAIN`, `CHARACTERISTICS`, `CHARACTER_LENGTH`, `CHARACTER_SET_CATALOG`, `CHARACTER_SET_NAME`, `CHARACTER_SET_SCHEMA`, `CHAR_LENGTH`, `CHECK`, `CHECKED`, `CHECKPOINT`, `CLASS`, `CLASS_ORIGIN`, `CLOB`, `CLOSE`, `CLUSTER`, `COALSECE`, `COBOL`, `COLLATE`, `COLLATION`, `COLLATION_CATALOG`, `COLLATION_NAME`, `COLLATION_SCHEMA`, `COLUMN`, `COLUMN_NAME`, `COMMAND_FUNCTION`, `COMMAND_FUNCTION_CODE`, `COMMENT`, `COMMIT`, `COMMITTED`, `COMPLETION`, `CONDITION_NUMBER`, `CONNECT`, `CONNECTION`, `CONNECTION_NAME`, `CONSTRAINT`, `CONSTRAINTS`, `CONSTRAINT_CATALOG`, `CONSTRAINT_NAME`, `CONSTRAINT_SCHEMA`, `CONSTRUCTOR`, `CONTAINS`, `CONTINUE`, `CONVERSION`, `CONVERT`, `COPY`, `CORRESPONTING`, `COUNT`, `CREATE`, `CREATEDB`, `CREATEUSER`, `CROSS`, `CUBE`, `CURRENT`, `CURRENT_DATE`, `CURRENT_PATH`, `CURRENT_ROLE`, `CURRENT_TIME`, `CURRENT_TIMESTAMP`, `CURRENT_USER`, `CURSOR`, `CURSOR_NAME`, `CYCLE`, `DATA`, `DATABASE`, `DATETIME_INTERVAL_CODE`, `DATETIME_INTERVAL_PRECISION`, `DAY`, `DEALLOCATE`, `DECLARE`, `DEFAULT`, `DEFAULTS`, `DEFERRABLE`, `DEFERRED`, `DEFINED`, `DEFINER`, `DELETE`, `DELIMITER`, `DELIMITERS`, `DEREF`, `DESC`, `DESCRIBE`, `DESCRIPTOR`, `DESTROY`, `DESTRUCTOR`, `DETERMINISTIC`, `DIAGNOSTICS`, `DICTIONARY`, `DISCONNECT`, `DISPATCH`, `DISTINCT`, `DO`, `DOMAIN`, `DROP`, `DYNAMIC`, `DYNAMIC_FUNCTION`, `DYNAMIC_FUNCTION_CODE`, `EACH`, `ELSE`, `ELSIF`, `ENCODING`, `ENCRYPTED`, `END`, `END-EXEC`, `EQUALS`, `ESCAPE`, `EVERY`, `EXCEPTION`, `EXCEPT`, `EXCLUDING`, `EXCLUSIVE`, `EXEC`, `EXECUTE`, `EXISTING`, `EXISTS`, `EXPLAIN`, `EXTERNAL`, `EXTRACT`, `FALSE`, `FETCH`, `FINAL`, `FIRST`, `FOR`, `FORCE`, `FOREIGN`, `FORTRAN`, `FORWARD`, `FOUND`, `FREE`, `FREEZE`, `FROM`, `FULL`, `FUNCTION`, `G`, `GENERAL`, `GENERATED`, `GET`, `GLOBAL`, `GO`, `GOTO`, `GRANT`, `GRANTED`, `GROUP`, `GROUPING`, `HANDLER`, `HAVING`, `HIERARCHY`, `HOLD`, `HOST`, `IDENTITY`, `IF`, `IGNORE`, `ILIKE`, `IMMEDIATE`, `IMMUTABLE`, `IMPLEMENTATION`, `IMPLICIT`, `IN`, `INCLUDING`, `INCREMENT`, `INDEX`, `INDITCATOR`, `INFIX`, `INHERITS`, `INITIALIZE`, `INITIALLY`, `INNER`, `INOUT`, `INPUT`, `INSENSITIVE`, `INSERT`, `INSTANTIABLE`, `INSTEAD`, `INTERSECT`, `INTO`, `INVOKER`, `IS`, `ISNULL`, `ISOLATION`, `ITERATE`, `JOIN`, `KEY`, `KEY_MEMBER`, `KEY_TYPE`, `LANCOMPILER`, `LANGUAGE`, `LARGE`, `LAST`, `LATERAL`, `LEADING`, `LEFT`, `LENGTH`, `LESS`, `LEVEL`, `LIKE`, `LIMIT`, `LISTEN`, `LOAD`, `LOCAL`, `LOCALTIME`, `LOCALTIMESTAMP`, `LOCATION`, `LOCATOR`, `LOCK`, `LOWER`, `MAP`, `MATCH`, `MAX`, `MAXVALUE`, `MESSAGE_LENGTH`, `MESSAGE_OCTET_LENGTH`, `MESSAGE_TEXT`, `METHOD`, `MIN`, `MINUTE`, `MINVALUE`, `MOD`, `MODE`, `MODIFIES`, `MODIFY`, `MONTH`, `MORE`, `MOVE`, `MUMPS`, `NAMES`, `NATIONAL`, `NATURAL`, `NCHAR`, `NCLOB`, `NEW`, `NEXT`, `NO`, `NOCREATEDB`, `NOCREATEUSER`, `NONE`, `NOT`, `NOTHING`, `NOTIFY`, `NOTNULL`, `NULL`, `NULLABLE`, `NULLIF`, `OBJECT`, `OCTET_LENGTH`, `OF`, `OFF`, `OFFSET`, `OIDS`, `OLD`, `ON`, `ONLY`, `OPEN`, `OPERATION`, `OPERATOR`, `OPTION`, `OPTIONS`, `OR`, `ORDER`, `ORDINALITY`, `OUT`, `OUTER`, `OUTPUT`, `OVERLAPS`, `OVERLAY`, `OVERRIDING`, `OWNER`, `PAD`, `PARAMETER`, `PARAMETERS`, `PARAMETER_MODE`, `PARAMATER_NAME`, `PARAMATER_ORDINAL_POSITION`, `PARAMETER_SPECIFIC_CATALOG`, `PARAMETER_SPECIFIC_NAME`, `PARAMATER_SPECIFIC_SCHEMA`, `PARTIAL`, `PASCAL`, `PENDANT`, `PLACING`, `PLI`, `POSITION`, `POSTFIX`, `PRECISION`, `PREFIX`, `PREORDER`, `PREPARE`, `PRESERVE`, `PRIMARY`, `PRIOR`, `PRIVILEGES`, `PROCEDURAL`, `PROCEDURE`, `PUBLIC`, `READ`, `READS`, `RECHECK`, `RECURSIVE`, `REF`, `REFERENCES`, `REFERENCING`, `REINDEX`, `RELATIVE`, `RENAME`, `REPEATABLE`, `REPLACE`, `RESET`, `RESTART`, `RESTRICT`, `RESULT`, `RETURN`, `RETURNED_LENGTH`, `RETURNED_OCTET_LENGTH`, `RETURNED_SQLSTATE`, `RETURNS`, `REVOKE`, `RIGHT`, `ROLE`, `ROLLBACK`, `ROLLUP`, `ROUTINE`, `ROUTINE_CATALOG`, `ROUTINE_NAME`, `ROUTINE_SCHEMA`, `ROW`, `ROWS`, `ROW_COUNT`, `RULE`, `SAVE_POINT`, `SCALE`, `SCHEMA`, `SCHEMA_NAME`, `SCOPE`, `SCROLL`, `SEARCH`, `SECOND`, `SECURITY`, `SELECT`, `SELF`, `SENSITIVE`, `SERIALIZABLE`, `SERVER_NAME`, `SESSION`, `SESSION_USER`, `SET`, `SETOF`, `SETS`, `SHARE`, `SHOW`, `SIMILAR`, `SIMPLE`, `SIZE`, `SOME`, `SOURCE`, `SPACE`, `SPECIFIC`, `SPECIFICTYPE`, `SPECIFIC_NAME`, `SQL`, `SQLCODE`, `SQLERROR`, `SQLEXCEPTION`, `SQLSTATE`, `SQLWARNINIG`, `STABLE`, `START`, `STATE`, `STATEMENT`, `STATIC`, `STATISTICS`, `STDIN`, `STDOUT`, `STORAGE`, `STRICT`, `STRUCTURE`, `STYPE`, `SUBCLASS_ORIGIN`, `SUBLIST`, `SUBSTRING`, `SUM`, `SYMMETRIC`, `SYSID`, `SYSTEM`, `SYSTEM_USER`, `TABLE`, `TABLE_NAME`, ` TEMP`, `TEMPLATE`, `TEMPORARY`, `TERMINATE`, `THAN`, `THEN`, `TIMESTAMP`, `TIMEZONE_HOUR`, `TIMEZONE_MINUTE`, `TO`, `TOAST`, `TRAILING`, `TRANSACTION`, `TRANSACTIONS_COMMITTED`, `TRANSACTIONS_ROLLED_BACK`, `TRANSACTION_ACTIVE`, `TRANSFORM`, `TRANSFORMS`, `TRANSLATE`, `TRANSLATION`, `TREAT`, `TRIGGER`, `TRIGGER_CATALOG`, `TRIGGER_NAME`, `TRIGGER_SCHEMA`, `TRIM`, `TRUE`, `TRUNCATE`, `TRUSTED`, `TYPE`, `UNCOMMITTED`, `UNDER`, `UNENCRYPTED`, `UNION`, `UNIQUE`, `UNKNOWN`, `UNLISTEN`, `UNNAMED`, `UNNEST`, `UNTIL`, `UPDATE`, `UPPER`, `USAGE`, `USER`, `USER_DEFINED_TYPE_CATALOG`, `USER_DEFINED_TYPE_NAME`, `USER_DEFINED_TYPE_SCHEMA`, `USING`, `VACUUM`, `VALID`, `VALIDATOR`, `VALUES`, `VARIABLE`, `VERBOSE`, `VERSION`, `VIEW`, `VOLATILE`, `WHEN`, `WHENEVER`, `WHERE`, `WITH`, `WITHOUT`, `WORK`, `WRITE`, `YEAR`, `ZONE`), Keyword, nil}, - {Words(``, `\b`, `ARRAY`, `BIGINT`, `BINARY`, `BIT`, `BLOB`, `BOOLEAN`, `CHAR`, `CHARACTER`, `DATE`, `DEC`, `DECIMAL`, `FLOAT`, `INT`, `INTEGER`, `INTERVAL`, `NUMBER`, `NUMERIC`, `REAL`, `SERIAL`, `SMALLINT`, `VARCHAR`, `VARYING`, `INT8`, `SERIAL8`, `TEXT`), NameBuiltin, nil}, - {"[+*/<>=~!@#%^&|`?-]", Operator, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`[a-z_][\w$]*`, Name, nil}, - {`[;:()\[\],.]`, Punctuation, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "double-string": { - {`[^"]+`, LiteralStringDouble, nil}, - {`""`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/squid.go b/vendor/github.com/alecthomas/chroma/lexers/s/squid.go deleted file mode 100644 index 1f161901..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/squid.go +++ /dev/null @@ -1,38 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Squidconf lexer. -var Squidconf = internal.Register(MustNewLexer( - &Config{ - Name: "SquidConf", - Aliases: []string{"squidconf", "squid.conf", "squid"}, - Filenames: []string{"squid.conf"}, - MimeTypes: []string{"text/x-squidconf"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, TextWhitespace, nil}, - {`#`, Comment, Push("comment")}, - {Words(`\b`, `\b`, `access_log`, `acl`, `always_direct`, `announce_host`, `announce_period`, `announce_port`, `announce_to`, `anonymize_headers`, `append_domain`, `as_whois_server`, `auth_param_basic`, `authenticate_children`, `authenticate_program`, `authenticate_ttl`, `broken_posts`, `buffered_logs`, `cache_access_log`, `cache_announce`, `cache_dir`, `cache_dns_program`, `cache_effective_group`, `cache_effective_user`, `cache_host`, `cache_host_acl`, `cache_host_domain`, `cache_log`, `cache_mem`, `cache_mem_high`, `cache_mem_low`, `cache_mgr`, `cachemgr_passwd`, `cache_peer`, `cache_peer_access`, `cahce_replacement_policy`, `cache_stoplist`, `cache_stoplist_pattern`, `cache_store_log`, `cache_swap`, `cache_swap_high`, `cache_swap_log`, `cache_swap_low`, `client_db`, `client_lifetime`, `client_netmask`, `connect_timeout`, `coredump_dir`, `dead_peer_timeout`, `debug_options`, `delay_access`, `delay_class`, `delay_initial_bucket_level`, `delay_parameters`, `delay_pools`, `deny_info`, `dns_children`, `dns_defnames`, `dns_nameservers`, `dns_testnames`, `emulate_httpd_log`, `err_html_text`, `fake_user_agent`, `firewall_ip`, `forwarded_for`, `forward_snmpd_port`, `fqdncache_size`, `ftpget_options`, `ftpget_program`, `ftp_list_width`, `ftp_passive`, `ftp_user`, `half_closed_clients`, `header_access`, `header_replace`, `hierarchy_stoplist`, `high_response_time_warning`, `high_page_fault_warning`, `hosts_file`, `htcp_port`, `http_access`, `http_anonymizer`, `httpd_accel`, `httpd_accel_host`, `httpd_accel_port`, `httpd_accel_uses_host_header`, `httpd_accel_with_proxy`, `http_port`, `http_reply_access`, `icp_access`, `icp_hit_stale`, `icp_port`, `icp_query_timeout`, `ident_lookup`, `ident_lookup_access`, `ident_timeout`, `incoming_http_average`, `incoming_icp_average`, `inside_firewall`, `ipcache_high`, `ipcache_low`, `ipcache_size`, `local_domain`, `local_ip`, `logfile_rotate`, `log_fqdn`, `log_icp_queries`, `log_mime_hdrs`, `maximum_object_size`, `maximum_single_addr_tries`, `mcast_groups`, `mcast_icp_query_timeout`, `mcast_miss_addr`, `mcast_miss_encode_key`, `mcast_miss_port`, `memory_pools`, `memory_pools_limit`, `memory_replacement_policy`, `mime_table`, `min_http_poll_cnt`, `min_icp_poll_cnt`, `minimum_direct_hops`, `minimum_object_size`, `minimum_retry_timeout`, `miss_access`, `negative_dns_ttl`, `negative_ttl`, `neighbor_timeout`, `neighbor_type_domain`, `netdb_high`, `netdb_low`, `netdb_ping_period`, `netdb_ping_rate`, `never_direct`, `no_cache`, `passthrough_proxy`, `pconn_timeout`, `pid_filename`, `pinger_program`, `positive_dns_ttl`, `prefer_direct`, `proxy_auth`, `proxy_auth_realm`, `query_icmp`, `quick_abort`, `quick_abort_max`, `quick_abort_min`, `quick_abort_pct`, `range_offset_limit`, `read_timeout`, `redirect_children`, `redirect_program`, `redirect_rewrites_host_header`, `reference_age`, `refresh_pattern`, `reload_into_ims`, `request_body_max_size`, `request_size`, `request_timeout`, `shutdown_lifetime`, `single_parent_bypass`, `siteselect_timeout`, `snmp_access`, `snmp_incoming_address`, `snmp_port`, `source_ping`, `ssl_proxy`, `store_avg_object_size`, `store_objects_per_bucket`, `strip_query_terms`, `swap_level1_dirs`, `swap_level2_dirs`, `tcp_incoming_address`, `tcp_outgoing_address`, `tcp_recv_bufsize`, `test_reachability`, `udp_hit_obj`, `udp_hit_obj_size`, `udp_incoming_address`, `udp_outgoing_address`, `unique_hostname`, `unlinkd_program`, `uri_whitespace`, `useragent_log`, `visible_hostname`, `wais_relay`, `wais_relay_host`, `wais_relay_port`), Keyword, nil}, - {Words(`\b`, `\b`, `proxy-only`, `weight`, `ttl`, `no-query`, `default`, `round-robin`, `multicast-responder`, `on`, `off`, `all`, `deny`, `allow`, `via`, `parent`, `no-digest`, `heap`, `lru`, `realm`, `children`, `q1`, `q2`, `credentialsttl`, `none`, `disable`, `offline_toggle`, `diskd`), NameConstant, nil}, - {Words(`\b`, `\b`, `shutdown`, `info`, `parameter`, `server_list`, `client_list`, `squid.conf`), LiteralString, nil}, - {Words(`stats/`, `\b`, `objects`, `vm_objects`, `utilization`, `ipcache`, `fqdncache`, `dns`, `redirector`, `io`, `reply_headers`, `filedescriptors`, `netdb`), LiteralString, nil}, - {Words(`log/`, `=`, `status`, `enable`, `disable`, `clear`), LiteralString, nil}, - {Words(`\b`, `\b`, `url_regex`, `urlpath_regex`, `referer_regex`, `port`, `proto`, `req_mime_type`, `rep_mime_type`, `method`, `browser`, `user`, `src`, `dst`, `time`, `dstdomain`, `ident`, `snmp_community`), Keyword, nil}, - {`(?:(?:(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})(?:\.(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})){3})|(?!.*::.*::)(?:(?!:)|:(?=:))(?:[0-9a-f]{0,4}(?:(?<=::)|(?|[<&?](?=\\w)|(?<=\\w)[>!?]", Punctuation, nil}, - {`[/=\-+!*%<>&|^?~]+`, Operator, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, - }, - "keywords": { - {Words(``, `\b`, `as`, `break`, `case`, `catch`, `continue`, `default`, `defer`, `do`, `else`, `fallthrough`, `for`, `guard`, `if`, `in`, `is`, `repeat`, `return`, `#selector`, `switch`, `throw`, `try`, `where`, `while`), Keyword, nil}, - {`@availability\([^)]+\)`, KeywordReserved, nil}, - {Words(``, `\b`, `associativity`, `convenience`, `dynamic`, `didSet`, `final`, `get`, `indirect`, `infix`, `inout`, `lazy`, `left`, `mutating`, `none`, `nonmutating`, `optional`, `override`, `postfix`, `precedence`, `prefix`, `Protocol`, `required`, `rethrows`, `right`, `set`, `throws`, `Type`, `unowned`, `weak`, `willSet`, `@availability`, `@autoclosure`, `@noreturn`, `@NSApplicationMain`, `@NSCopying`, `@NSManaged`, `@objc`, `@UIApplicationMain`, `@IBAction`, `@IBDesignable`, `@IBInspectable`, `@IBOutlet`), KeywordReserved, nil}, - {`(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__|__FILE__|__FUNCTION__|__LINE__|_|#(?:file|line|column|function))\b`, KeywordConstant, nil}, - {`import\b`, KeywordDeclaration, Push("module")}, - {`(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)`, ByGroups(KeywordDeclaration, Text, NameClass), nil}, - {`(func)(\s+)([a-zA-Z_]\w*)`, ByGroups(KeywordDeclaration, Text, NameFunction), nil}, - {`(var|let)(\s+)([a-zA-Z_]\w*)`, ByGroups(KeywordDeclaration, Text, NameVariable), nil}, - {Words(``, `\b`, `class`, `deinit`, `enum`, `extension`, `func`, `import`, `init`, `internal`, `let`, `operator`, `private`, `protocol`, `public`, `static`, `struct`, `subscript`, `typealias`, `var`), KeywordDeclaration, nil}, - }, - "comment": { - {`:param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):`, CommentSpecial, nil}, - }, - "comment-single": { - {`\n`, Text, Pop(1)}, - Include("comment"), - {`[^\n]`, CommentSingle, nil}, - }, - "comment-multi": { - Include("comment"), - {`[^*/]`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "module": { - {`\n`, Text, Pop(1)}, - {`[a-zA-Z_]\w*`, NameClass, nil}, - Include("root"), - }, - "preproc": { - {`\n`, Text, Pop(1)}, - Include("keywords"), - {`[A-Za-z]\w*`, CommentPreproc, nil}, - Include("root"), - }, - "string": { - {`\\\(`, LiteralStringInterpol, Push("string-intp")}, - {`"`, LiteralString, Pop(1)}, - {`\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}`, LiteralStringEscape, nil}, - {`[^\\"]+`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "string-intp": { - {`\(`, LiteralStringInterpol, Push()}, - {`\)`, LiteralStringInterpol, Pop(1)}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go b/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go deleted file mode 100644 index 6b0884ec..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go +++ /dev/null @@ -1,28 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var SYSTEMD = internal.Register(MustNewLexer( - &Config{ - Name: "SYSTEMD", - Aliases: []string{"systemd"}, - Filenames: []string{"*.service"}, - MimeTypes: []string{"text/plain"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`[;#].*`, Comment, nil}, - {`\[.*?\]$`, Keyword, nil}, - {`(.*?)(=)(.*)(\\\n)`, ByGroups(NameAttribute, Operator, LiteralString, Text), Push("continuation")}, - {`(.*?)(=)(.*)`, ByGroups(NameAttribute, Operator, LiteralString), nil}, - }, - "continuation": { - {`(.*?)(\\\n)`, ByGroups(LiteralString, Text), nil}, - {`(.*)`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/systemverilog.go b/vendor/github.com/alecthomas/chroma/lexers/s/systemverilog.go deleted file mode 100644 index 85c459fe..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/s/systemverilog.go +++ /dev/null @@ -1,73 +0,0 @@ -package s - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Systemverilog lexer. -var Systemverilog = internal.Register(MustNewLexer( - &Config{ - Name: "systemverilog", - Aliases: []string{"systemverilog", "sv"}, - Filenames: []string{"*.sv", "*.svh"}, - MimeTypes: []string{"text/x-systemverilog"}, - EnsureNL: true, - }, - Rules{ - "root": { - {"^\\s*`define", CommentPreproc, Push("macro")}, - {`^(\s*)(package)(\s+)`, ByGroups(Text, KeywordNamespace, Text), nil}, - {`^(\s*)(import)(\s+)("DPI(?:-C)?")(\s+)`, ByGroups(Text, KeywordNamespace, Text, LiteralString, Text), nil}, - {`^(\s*)(import)(\s+)`, ByGroups(Text, KeywordNamespace, Text), Push("import")}, - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`/(\\\n)?/(\n|(.|\n)*?[^\\]\n)`, CommentSingle, nil}, - {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, - {`[{}#@]`, Punctuation, nil}, - {`L?"`, LiteralString, Push("string")}, - {`L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'`, LiteralStringChar, nil}, - {`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?`, LiteralNumberFloat, nil}, - {`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil}, - {`([0-9]+)|(\'h)[0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`([0-9]+)|(\'b)[01]+`, LiteralNumberBin, nil}, - {`([0-9]+)|(\'d)[0-9]+`, LiteralNumberInteger, nil}, - {`([0-9]+)|(\'o)[0-7]+`, LiteralNumberOct, nil}, - {`\'[01xz]`, LiteralNumber, nil}, - {`\d+[Ll]?`, LiteralNumberInteger, nil}, - {`\*/`, Error, nil}, - {`[~!%^&*+=|?:<>/-]`, Operator, nil}, - {`[()\[\],.;\']`, Punctuation, nil}, - {"`[a-zA-Z_]\\w*", NameConstant, nil}, - {Words(``, `\b`, `accept_on`, `alias`, `always`, `always_comb`, `always_ff`, `always_latch`, `and`, `assert`, `assign`, `assume`, `automatic`, `before`, `begin`, `bind`, `bins`, `binsof`, `bit`, `break`, `buf`, `bufif0`, `bufif1`, `byte`, `case`, `casex`, `casez`, `cell`, `chandle`, `checker`, `class`, `clocking`, `cmos`, `config`, `const`, `constraint`, `context`, `continue`, `cover`, `covergroup`, `coverpoint`, `cross`, `deassign`, `default`, `defparam`, `design`, `disable`, `dist`, `do`, `edge`, `else`, `end`, `endcase`, `endchecker`, `endclass`, `endclocking`, `endconfig`, `endfunction`, `endgenerate`, `endgroup`, `endinterface`, `endmodule`, `endpackage`, `endprimitive`, `endprogram`, `endproperty`, `endsequence`, `endspecify`, `endtable`, `endtask`, `enum`, `event`, `eventually`, `expect`, `export`, `extends`, `extern`, `final`, `first_match`, `for`, `force`, `foreach`, `forever`, `fork`, `forkjoin`, `function`, `generate`, `genvar`, `global`, `highz0`, `highz1`, `if`, `iff`, `ifnone`, `ignore_bins`, `illegal_bins`, `implies`, `import`, `incdir`, `include`, `initial`, `inout`, `input`, `inside`, `instance`, `int`, `integer`, `interface`, `intersect`, `join`, `join_any`, `join_none`, `large`, `let`, `liblist`, `library`, `local`, `localparam`, `logic`, `longint`, `macromodule`, `matches`, `medium`, `modport`, `module`, `nand`, `negedge`, `new`, `nexttime`, `nmos`, `nor`, `noshowcancelled`, `not`, `notif0`, `notif1`, `null`, `or`, `output`, `package`, `packed`, `parameter`, `pmos`, `posedge`, `primitive`, `priority`, `program`, `property`, `protected`, `pull0`, `pull1`, `pulldown`, `pullup`, `pulsestyle_ondetect`, `pulsestyle_onevent`, `pure`, `rand`, `randc`, `randcase`, `randsequence`, `rcmos`, `real`, `realtime`, `ref`, `reg`, `reject_on`, `release`, `repeat`, `restrict`, `return`, `rnmos`, `rpmos`, `rtran`, `rtranif0`, `rtranif1`, `s_always`, `s_eventually`, `s_nexttime`, `s_until`, `s_until_with`, `scalared`, `sequence`, `shortint`, `shortreal`, `showcancelled`, `signed`, `small`, `solve`, `specify`, `specparam`, `static`, `string`, `strong`, `strong0`, `strong1`, `struct`, `super`, `supply0`, `supply1`, `sync_accept_on`, `sync_reject_on`, `table`, `tagged`, `task`, `this`, `throughout`, `time`, `timeprecision`, `timeunit`, `tran`, `tranif0`, `tranif1`, `tri`, `tri0`, `tri1`, `triand`, `trior`, `trireg`, `type`, `typedef`, `union`, `unique`, `unique0`, `unsigned`, `until`, `until_with`, `untyped`, `use`, `uwire`, `var`, `vectored`, `virtual`, `void`, `wait`, `wait_order`, `wand`, `weak`, `weak0`, `weak1`, `while`, `wildcard`, `wire`, `with`, `within`, `wor`, `xnor`, `xor`), Keyword, nil}, - {Words(``, `\b`, "`__FILE__", "`__LINE__", "`begin_keywords", "`celldefine", "`default_nettype", "`define", "`else", "`elsif", "`end_keywords", "`endcelldefine", "`endif", "`ifdef", "`ifndef", "`include", "`line", "`nounconnected_drive", "`pragma", "`resetall", "`timescale", "`unconnected_drive", "`undef", "`undefineall"), CommentPreproc, nil}, - {Words(``, `\b`, `$display`, `$displayb`, `$displayh`, `$displayo`, `$dumpall`, `$dumpfile`, `$dumpflush`, `$dumplimit`, `$dumpoff`, `$dumpon`, `$dumpports`, `$dumpportsall`, `$dumpportsflush`, `$dumpportslimit`, `$dumpportsoff`, `$dumpportson`, `$dumpvars`, `$fclose`, `$fdisplay`, `$fdisplayb`, `$fdisplayh`, `$fdisplayo`, `$feof`, `$ferror`, `$fflush`, `$fgetc`, `$fgets`, `$finish`, `$fmonitor`, `$fmonitorb`, `$fmonitorh`, `$fmonitoro`, `$fopen`, `$fread`, `$fscanf`, `$fseek`, `$fstrobe`, `$fstrobeb`, `$fstrobeh`, `$fstrobeo`, `$ftell`, `$fwrite`, `$fwriteb`, `$fwriteh`, `$fwriteo`, `$monitor`, `$monitorb`, `$monitorh`, `$monitoro`, `$monitoroff`, `$monitoron`, `$plusargs`, `$random`, `$readmemb`, `$readmemh`, `$rewind`, `$sformat`, `$sformatf`, `$sscanf`, `$strobe`, `$strobeb`, `$strobeh`, `$strobeo`, `$swrite`, `$swriteb`, `$swriteh`, `$swriteo`, `$test`, `$ungetc`, `$value$plusargs`, `$write`, `$writeb`, `$writeh`, `$writememb`, `$writememh`, `$writeo`), NameBuiltin, nil}, - {`(class)(\s+)`, ByGroups(Keyword, Text), Push("classname")}, - {Words(``, `\b`, `byte`, `shortint`, `int`, `longint`, `integer`, `time`, `bit`, `logic`, `reg`, `supply0`, `supply1`, `tri`, `triand`, `trior`, `tri0`, `tri1`, `trireg`, `uwire`, `wire`, `wand`, `woshortreal`, `real`, `realtime`), KeywordType, nil}, - {`[a-zA-Z_]\w*:(?!:)`, NameLabel, nil}, - {`\$?[a-zA-Z_]\w*`, Name, nil}, - }, - "classname": { - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - }, - "string": { - {`"`, LiteralString, Pop(1)}, - {`\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})`, LiteralStringEscape, nil}, - {`[^\\"\n]+`, LiteralString, nil}, - {`\\\n`, LiteralString, nil}, - {`\\`, LiteralString, nil}, - }, - "macro": { - {`[^/\n]+`, CommentPreproc, nil}, - {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, - {`//.*?\n`, CommentSingle, Pop(1)}, - {`/`, CommentPreproc, nil}, - {`(?<=\\)\n`, CommentPreproc, nil}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "import": { - {`[\w:]+\*?`, NameNamespace, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tablegen.go b/vendor/github.com/alecthomas/chroma/lexers/t/tablegen.go deleted file mode 100644 index 18c69787..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tablegen.go +++ /dev/null @@ -1,42 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// TableGen lexer. -var Tablegen = internal.Register(MustNewLexer( - &Config{ - Name: "TableGen", - Aliases: []string{"tablegen"}, - Filenames: []string{"*.td"}, - MimeTypes: []string{"text/x-tablegen"}, - }, - Rules{ - "root": { - Include("macro"), - Include("whitespace"), - {`c?"[^"]*?"`, LiteralString, nil}, - Include("keyword"), - {`\$[_a-zA-Z][_\w]*`, NameVariable, nil}, - {`\d*[_a-zA-Z][_\w]*`, NameVariable, nil}, - {`\[\{[\w\W]*?\}\]`, LiteralString, nil}, - {`[+-]?\d+|0x[\da-fA-F]+|0b[01]+`, LiteralNumber, nil}, - {`[=<>{}\[\]()*.,!:;]`, Punctuation, nil}, - }, - "macro": { - {`(#include\s+)("[^"]*")`, ByGroups(CommentPreproc, LiteralString), nil}, - {`^\s*#(ifdef|ifndef)\s+[_\w][_\w\d]*`, CommentPreproc, nil}, - {`^\s*#define\s+[_\w][_\w\d]*`, CommentPreproc, nil}, - {`^\s*#endif`, CommentPreproc, nil}, - }, - "whitespace": { - {`(\n|\s)+`, Text, nil}, - {`//.*?\n`, Comment, nil}, - }, - "keyword": { - {Words(``, `\b`, `bit`, `bits`, `class`, `code`, `dag`, `def`, `defm`, `field`, `foreach`, `in`, `int`, `let`, `list`, `multiclass`, `string`), Keyword, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tasm.go b/vendor/github.com/alecthomas/chroma/lexers/t/tasm.go deleted file mode 100644 index 960399ca..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tasm.go +++ /dev/null @@ -1,61 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Tasm lexer. -var Tasm = internal.Register(MustNewLexer( - &Config{ - Name: "TASM", - Aliases: []string{"tasm"}, - Filenames: []string{"*.asm", "*.ASM", "*.tasm"}, - MimeTypes: []string{"text/x-tasm"}, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`^\s*%`, CommentPreproc, Push("preproc")}, - Include("whitespace"), - {`[@a-z$._?][\w$.?#@~]*:`, NameLabel, nil}, - {`BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|ORG|ALIGN|STRUC|ENDSTRUC|ENDS|COMMON|CPU|GROUP|UPPERCASE|INCLUDE|EXPORT|LIBRARY|MODULE|PROC|ENDP|USES|ARG|DATASEG|UDATASEG|END|IDEAL|P386|MODEL|ASSUME|CODESEG|SIZE`, Keyword, Push("instruction-args")}, - {`([@a-z$._?][\w$.?#@~]*)(\s+)(db|dd|dw|T[A-Z][a-z]+)`, ByGroups(NameConstant, KeywordDeclaration, KeywordDeclaration), Push("instruction-args")}, - {`(?:res|d)[bwdqt]|times`, KeywordDeclaration, Push("instruction-args")}, - {`[@a-z$._?][\w$.?#@~]*`, NameFunction, Push("instruction-args")}, - {`[\r\n]+`, Text, nil}, - }, - "instruction-args": { - {"\"(\\\\\"|[^\"\\n])*\"|'(\\\\'|[^'\\n])*'|`(\\\\`|[^`\\n])*`", LiteralString, nil}, - {`(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)`, LiteralNumberHex, nil}, - {`[0-7]+q`, LiteralNumberOct, nil}, - {`[01]+b`, LiteralNumberBin, nil}, - {`[0-9]+\.e?[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - Include("punctuation"), - {`r[0-9][0-5]?[bwd]|[a-d][lh]|[er]?[a-d]x|[er]?[sb]p|[er]?[sd]i|[c-gs]s|st[0-7]|mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]`, NameBuiltin, nil}, - {`[@a-z$._?][\w$.?#@~]*`, NameVariable, nil}, - {`(\\\s*)(;.*)([\r\n])`, ByGroups(Text, CommentSingle, Text), nil}, - {`[\r\n]+`, Text, Pop(1)}, - Include("whitespace"), - }, - "preproc": { - {`[^;\n]+`, CommentPreproc, nil}, - {`;.*?\n`, CommentSingle, Pop(1)}, - {`\n`, CommentPreproc, Pop(1)}, - }, - "whitespace": { - {`[\n\r]`, Text, nil}, - {`\\[\n\r]`, Text, nil}, - {`[ \t]+`, Text, nil}, - {`;.*`, CommentSingle, nil}, - }, - "punctuation": { - {`[,():\[\]]+`, Punctuation, nil}, - {`[&|^<>+*=/%~-]+`, Operator, nil}, - {`[$]+`, KeywordConstant, nil}, - {`seg|wrt|strict`, OperatorWord, nil}, - {`byte|[dq]?word`, KeywordType, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tcl.go b/vendor/github.com/alecthomas/chroma/lexers/t/tcl.go deleted file mode 100644 index 77951b40..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tcl.go +++ /dev/null @@ -1,116 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Tcl lexer. -var Tcl = internal.Register(MustNewLexer( - &Config{ - Name: "Tcl", - Aliases: []string{"tcl"}, - Filenames: []string{"*.tcl", "*.rvt"}, - MimeTypes: []string{"text/x-tcl", "text/x-script.tcl", "application/x-tcl"}, - }, - Rules{ - "root": { - Include("command"), - Include("basic"), - Include("data"), - {`\}`, Keyword, nil}, - }, - "command": { - {Words(`\b`, `\b`, `after`, `apply`, `array`, `break`, `catch`, `continue`, `elseif`, `else`, `error`, `eval`, `expr`, `for`, `foreach`, `global`, `if`, `namespace`, `proc`, `rename`, `return`, `set`, `switch`, `then`, `trace`, `unset`, `update`, `uplevel`, `upvar`, `variable`, `vwait`, `while`), Keyword, Push("params")}, - {Words(`\b`, `\b`, `append`, `bgerror`, `binary`, `cd`, `chan`, `clock`, `close`, `concat`, `dde`, `dict`, `encoding`, `eof`, `exec`, `exit`, `fblocked`, `fconfigure`, `fcopy`, `file`, `fileevent`, `flush`, `format`, `gets`, `glob`, `history`, `http`, `incr`, `info`, `interp`, `join`, `lappend`, `lassign`, `lindex`, `linsert`, `list`, `llength`, `load`, `loadTk`, `lrange`, `lrepeat`, `lreplace`, `lreverse`, `lsearch`, `lset`, `lsort`, `mathfunc`, `mathop`, `memory`, `msgcat`, `open`, `package`, `pid`, `pkg::create`, `pkg_mkIndex`, `platform`, `platform::shell`, `puts`, `pwd`, `re_syntax`, `read`, `refchan`, `regexp`, `registry`, `regsub`, `scan`, `seek`, `socket`, `source`, `split`, `string`, `subst`, `tell`, `time`, `tm`, `unknown`, `unload`), NameBuiltin, Push("params")}, - {`([\w.-]+)`, NameVariable, Push("params")}, - {`#`, Comment, Push("comment")}, - }, - "command-in-brace": { - {Words(`\b`, `\b`, `after`, `apply`, `array`, `break`, `catch`, `continue`, `elseif`, `else`, `error`, `eval`, `expr`, `for`, `foreach`, `global`, `if`, `namespace`, `proc`, `rename`, `return`, `set`, `switch`, `then`, `trace`, `unset`, `update`, `uplevel`, `upvar`, `variable`, `vwait`, `while`), Keyword, Push("params-in-brace")}, - {Words(`\b`, `\b`, `append`, `bgerror`, `binary`, `cd`, `chan`, `clock`, `close`, `concat`, `dde`, `dict`, `encoding`, `eof`, `exec`, `exit`, `fblocked`, `fconfigure`, `fcopy`, `file`, `fileevent`, `flush`, `format`, `gets`, `glob`, `history`, `http`, `incr`, `info`, `interp`, `join`, `lappend`, `lassign`, `lindex`, `linsert`, `list`, `llength`, `load`, `loadTk`, `lrange`, `lrepeat`, `lreplace`, `lreverse`, `lsearch`, `lset`, `lsort`, `mathfunc`, `mathop`, `memory`, `msgcat`, `open`, `package`, `pid`, `pkg::create`, `pkg_mkIndex`, `platform`, `platform::shell`, `puts`, `pwd`, `re_syntax`, `read`, `refchan`, `regexp`, `registry`, `regsub`, `scan`, `seek`, `socket`, `source`, `split`, `string`, `subst`, `tell`, `time`, `tm`, `unknown`, `unload`), NameBuiltin, Push("params-in-brace")}, - {`([\w.-]+)`, NameVariable, Push("params-in-brace")}, - {`#`, Comment, Push("comment")}, - }, - "command-in-bracket": { - {Words(`\b`, `\b`, `after`, `apply`, `array`, `break`, `catch`, `continue`, `elseif`, `else`, `error`, `eval`, `expr`, `for`, `foreach`, `global`, `if`, `namespace`, `proc`, `rename`, `return`, `set`, `switch`, `then`, `trace`, `unset`, `update`, `uplevel`, `upvar`, `variable`, `vwait`, `while`), Keyword, Push("params-in-bracket")}, - {Words(`\b`, `\b`, `append`, `bgerror`, `binary`, `cd`, `chan`, `clock`, `close`, `concat`, `dde`, `dict`, `encoding`, `eof`, `exec`, `exit`, `fblocked`, `fconfigure`, `fcopy`, `file`, `fileevent`, `flush`, `format`, `gets`, `glob`, `history`, `http`, `incr`, `info`, `interp`, `join`, `lappend`, `lassign`, `lindex`, `linsert`, `list`, `llength`, `load`, `loadTk`, `lrange`, `lrepeat`, `lreplace`, `lreverse`, `lsearch`, `lset`, `lsort`, `mathfunc`, `mathop`, `memory`, `msgcat`, `open`, `package`, `pid`, `pkg::create`, `pkg_mkIndex`, `platform`, `platform::shell`, `puts`, `pwd`, `re_syntax`, `read`, `refchan`, `regexp`, `registry`, `regsub`, `scan`, `seek`, `socket`, `source`, `split`, `string`, `subst`, `tell`, `time`, `tm`, `unknown`, `unload`), NameBuiltin, Push("params-in-bracket")}, - {`([\w.-]+)`, NameVariable, Push("params-in-bracket")}, - {`#`, Comment, Push("comment")}, - }, - "command-in-paren": { - {Words(`\b`, `\b`, `after`, `apply`, `array`, `break`, `catch`, `continue`, `elseif`, `else`, `error`, `eval`, `expr`, `for`, `foreach`, `global`, `if`, `namespace`, `proc`, `rename`, `return`, `set`, `switch`, `then`, `trace`, `unset`, `update`, `uplevel`, `upvar`, `variable`, `vwait`, `while`), Keyword, Push("params-in-paren")}, - {Words(`\b`, `\b`, `append`, `bgerror`, `binary`, `cd`, `chan`, `clock`, `close`, `concat`, `dde`, `dict`, `encoding`, `eof`, `exec`, `exit`, `fblocked`, `fconfigure`, `fcopy`, `file`, `fileevent`, `flush`, `format`, `gets`, `glob`, `history`, `http`, `incr`, `info`, `interp`, `join`, `lappend`, `lassign`, `lindex`, `linsert`, `list`, `llength`, `load`, `loadTk`, `lrange`, `lrepeat`, `lreplace`, `lreverse`, `lsearch`, `lset`, `lsort`, `mathfunc`, `mathop`, `memory`, `msgcat`, `open`, `package`, `pid`, `pkg::create`, `pkg_mkIndex`, `platform`, `platform::shell`, `puts`, `pwd`, `re_syntax`, `read`, `refchan`, `regexp`, `registry`, `regsub`, `scan`, `seek`, `socket`, `source`, `split`, `string`, `subst`, `tell`, `time`, `tm`, `unknown`, `unload`), NameBuiltin, Push("params-in-paren")}, - {`([\w.-]+)`, NameVariable, Push("params-in-paren")}, - {`#`, Comment, Push("comment")}, - }, - "basic": { - {`\(`, Keyword, Push("paren")}, - {`\[`, Keyword, Push("bracket")}, - {`\{`, Keyword, Push("brace")}, - {`"`, LiteralStringDouble, Push("string")}, - {`(eq|ne|in|ni)\b`, OperatorWord, nil}, - {`!=|==|<<|>>|<=|>=|&&|\|\||\*\*|[-+~!*/%<>&^|?:]`, Operator, nil}, - }, - "data": { - {`\s+`, Text, nil}, - {`0x[a-fA-F0-9]+`, LiteralNumberHex, nil}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`\d+\.\d+`, LiteralNumberFloat, nil}, - {`\d+`, LiteralNumberInteger, nil}, - {`\$([\w.:-]+)`, NameVariable, nil}, - {`([\w.:-]+)`, Text, nil}, - }, - "params": { - {`;`, Keyword, Pop(1)}, - {`\n`, Text, Pop(1)}, - {`(else|elseif|then)\b`, Keyword, nil}, - Include("basic"), - Include("data"), - }, - "params-in-brace": { - {`\}`, Keyword, Push("#pop", "#pop")}, - Include("params"), - }, - "params-in-paren": { - {`\)`, Keyword, Push("#pop", "#pop")}, - Include("params"), - }, - "params-in-bracket": { - {`\]`, Keyword, Push("#pop", "#pop")}, - Include("params"), - }, - "string": { - {`\[`, LiteralStringDouble, Push("string-square")}, - {`(?s)(\\\\|\\[0-7]+|\\.|[^"\\])`, LiteralStringDouble, nil}, - {`"`, LiteralStringDouble, Pop(1)}, - }, - "string-square": { - {`\[`, LiteralStringDouble, Push("string-square")}, - {`(?s)(\\\\|\\[0-7]+|\\.|\\\n|[^\]\\])`, LiteralStringDouble, nil}, - {`\]`, LiteralStringDouble, Pop(1)}, - }, - "brace": { - {`\}`, Keyword, Pop(1)}, - Include("command-in-brace"), - Include("basic"), - Include("data"), - }, - "paren": { - {`\)`, Keyword, Pop(1)}, - Include("command-in-paren"), - Include("basic"), - Include("data"), - }, - "bracket": { - {`\]`, Keyword, Pop(1)}, - Include("command-in-bracket"), - Include("basic"), - Include("data"), - }, - "comment": { - {`.*[^\\]\n`, Comment, Pop(1)}, - {`.*\\\n`, Comment, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tcsh.go b/vendor/github.com/alecthomas/chroma/lexers/t/tcsh.go deleted file mode 100644 index e36bdfd8..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tcsh.go +++ /dev/null @@ -1,59 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Tcsh lexer. -var Tcsh = internal.Register(MustNewLexer( - &Config{ - Name: "Tcsh", - Aliases: []string{"tcsh", "csh"}, - Filenames: []string{"*.tcsh", "*.csh"}, - MimeTypes: []string{"application/x-csh"}, - }, - Rules{ - "root": { - Include("basic"), - {`\$\(`, Keyword, Push("paren")}, - {`\$\{#?`, Keyword, Push("curly")}, - {"`", LiteralStringBacktick, Push("backticks")}, - Include("data"), - }, - "basic": { - {`\b(if|endif|else|while|then|foreach|case|default|continue|goto|breaksw|end|switch|endsw)\s*\b`, Keyword, nil}, - {`\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|glob|getspath|hashstat|history|hup|inlib|jobs|kill|limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|source|stop|suspend|source|suspend|telltc|time|umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|ver|wait|warp|watchlog|where|which)\s*\b`, NameBuiltin, nil}, - {`#.*`, Comment, nil}, - {`\\[\w\W]`, LiteralStringEscape, nil}, - {`(\b\w+)(\s*)(=)`, ByGroups(NameVariable, Text, Operator), nil}, - {`[\[\]{}()=]+`, Operator, nil}, - {`<<\s*(\'?)\\?(\w+)[\w\W]+?\2`, LiteralString, nil}, - {`;`, Punctuation, nil}, - }, - "data": { - {`(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"`, LiteralStringDouble, nil}, - {`(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'`, LiteralStringSingle, nil}, - {`\s+`, Text, nil}, - {"[^=\\s\\[\\]{}()$\"\\'`\\\\;#]+", Text, nil}, - {`\d+(?= |\Z)`, LiteralNumber, nil}, - {`\$#?(\w+|.)`, NameVariable, nil}, - }, - "curly": { - {`\}`, Keyword, Pop(1)}, - {`:-`, Keyword, nil}, - {`\w+`, NameVariable, nil}, - {"[^}:\"\\'`$]+", Punctuation, nil}, - {`:`, Punctuation, nil}, - Include("root"), - }, - "paren": { - {`\)`, Keyword, Pop(1)}, - Include("root"), - }, - "backticks": { - {"`", LiteralStringBacktick, Pop(1)}, - Include("root"), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/termcap.go b/vendor/github.com/alecthomas/chroma/lexers/t/termcap.go deleted file mode 100644 index 21b7d15c..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/termcap.go +++ /dev/null @@ -1,42 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Termcap lexer. -var Termcap = internal.Register(MustNewLexer( - &Config{ - Name: "Termcap", - Aliases: []string{"termcap"}, - Filenames: []string{"termcap", "termcap.src"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`^#.*$`, Comment, nil}, - {`^[^\s#:|]+`, NameTag, Push("names")}, - }, - "names": { - {`\n`, Text, Pop(1)}, - {`:`, Punctuation, Push("defs")}, - {`\|`, Punctuation, nil}, - {`[^:|]+`, NameAttribute, nil}, - }, - "defs": { - {`\\\n[ \t]*`, Text, nil}, - {`\n[ \t]*`, Text, Pop(2)}, - {`(#)([0-9]+)`, ByGroups(Operator, LiteralNumber), nil}, - {`=`, Operator, Push("data")}, - {`:`, Punctuation, nil}, - {`[^\s:=#]+`, NameClass, nil}, - }, - "data": { - {`\\072`, Literal, nil}, - {`:`, Punctuation, Pop(1)}, - {`[^:\\]+`, Literal, nil}, - {`.`, Literal, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/terminfo.go b/vendor/github.com/alecthomas/chroma/lexers/t/terminfo.go deleted file mode 100644 index 79749e12..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/terminfo.go +++ /dev/null @@ -1,42 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Terminfo lexer. -var Terminfo = internal.Register(MustNewLexer( - &Config{ - Name: "Terminfo", - Aliases: []string{"terminfo"}, - Filenames: []string{"terminfo", "terminfo.src"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`^#.*$`, Comment, nil}, - {`^[^\s#,|]+`, NameTag, Push("names")}, - }, - "names": { - {`\n`, Text, Pop(1)}, - {`(,)([ \t]*)`, ByGroups(Punctuation, Text), Push("defs")}, - {`\|`, Punctuation, nil}, - {`[^,|]+`, NameAttribute, nil}, - }, - "defs": { - {`\n[ \t]+`, Text, nil}, - {`\n`, Text, Pop(2)}, - {`(#)([0-9]+)`, ByGroups(Operator, LiteralNumber), nil}, - {`=`, Operator, Push("data")}, - {`(,)([ \t]*)`, ByGroups(Punctuation, Text), nil}, - {`[^\s,=#]+`, NameClass, nil}, - }, - "data": { - {`\\[,\\]`, Literal, nil}, - {`(,)([ \t]*)`, ByGroups(Punctuation, Text), Pop(1)}, - {`[^\\,]+`, Literal, nil}, - {`.`, Literal, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go b/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go deleted file mode 100644 index 05125f70..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go +++ /dev/null @@ -1,69 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Terraform lexer. -var Terraform = internal.Register(MustNewLexer( - &Config{ - Name: "Terraform", - Aliases: []string{"terraform", "tf"}, - Filenames: []string{"*.tf"}, - MimeTypes: []string{"application/x-tf", "application/x-terraform"}, - }, - Rules{ - "root": { - Include("string"), - Include("punctuation"), - Include("curly"), - Include("basic"), - Include("whitespace"), - {`[0-9]+`, LiteralNumber, nil}, - }, - "basic": { - {Words(`\b`, `\b`, `true`, `false`), KeywordType, nil}, - {`\s*/\*`, CommentMultiline, Push("comment")}, - {`\s*#.*\n`, CommentSingle, nil}, - {`(.*?)(\s*)(=)`, ByGroups(NameAttribute, Text, Operator), nil}, - {Words(`\b`, `\b`, `variable`, `resource`, `provider`, `provisioner`, `module`), KeywordReserved, Push("function")}, - {Words(`\b`, `\b`, `ingress`, `egress`, `listener`, `default`, `connection`, `alias`), KeywordDeclaration, nil}, - {`\$\{`, LiteralStringInterpol, Push("var_builtin")}, - }, - "function": { - {`(\s+)(".*")(\s+)`, ByGroups(Text, LiteralString, Text), nil}, - Include("punctuation"), - Include("curly"), - }, - "var_builtin": { - {`\$\{`, LiteralStringInterpol, Push()}, - {Words(`\b`, `\b`, `concat`, `file`, `join`, `lookup`, `element`), NameBuiltin, nil}, - Include("string"), - Include("punctuation"), - {`\s+`, Text, nil}, - {`\}`, LiteralStringInterpol, Pop(1)}, - }, - "string": { - {`(".*")`, ByGroups(LiteralStringDouble), nil}, - }, - "punctuation": { - {`[\[\](),.]`, Punctuation, nil}, - }, - "curly": { - {`\{`, TextPunctuation, nil}, - {`\}`, TextPunctuation, nil}, - }, - "comment": { - {`[^*/]`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "whitespace": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tex.go b/vendor/github.com/alecthomas/chroma/lexers/t/tex.go deleted file mode 100644 index f1010c4a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tex.go +++ /dev/null @@ -1,56 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Tex lexer. -var TeX = internal.Register(MustNewLexer( - &Config{ - Name: "TeX", - Aliases: []string{"tex", "latex"}, - Filenames: []string{"*.tex", "*.aux", "*.toc"}, - MimeTypes: []string{"text/x-tex", "text/x-latex"}, - }, - Rules{ - "general": { - {`%.*?\n`, Comment, nil}, - {`[{}]`, NameBuiltin, nil}, - {`[&_^]`, NameBuiltin, nil}, - }, - "root": { - {`\\\[`, LiteralStringBacktick, Push("displaymath")}, - {`\\\(`, LiteralString, Push("inlinemath")}, - {`\$\$`, LiteralStringBacktick, Push("displaymath")}, - {`\$`, LiteralString, Push("inlinemath")}, - {`\\([a-zA-Z]+|.)`, Keyword, Push("command")}, - {`\\$`, Keyword, nil}, - Include("general"), - {`[^\\$%&_^{}]+`, Text, nil}, - }, - "math": { - {`\\([a-zA-Z]+|.)`, NameVariable, nil}, - Include("general"), - {`[0-9]+`, LiteralNumber, nil}, - {`[-=!+*/()\[\]]`, Operator, nil}, - {`[^=!+*/()\[\]\\$%&_^{}0-9-]+`, NameBuiltin, nil}, - }, - "inlinemath": { - {`\\\)`, LiteralString, Pop(1)}, - {`\$`, LiteralString, Pop(1)}, - Include("math"), - }, - "displaymath": { - {`\\\]`, LiteralString, Pop(1)}, - {`\$\$`, LiteralString, Pop(1)}, - {`\$`, NameBuiltin, nil}, - Include("math"), - }, - "command": { - {`\[.*?\]`, NameAttribute, nil}, - {`\*`, Keyword, nil}, - Default(Pop(1)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/thrift.go b/vendor/github.com/alecthomas/chroma/lexers/t/thrift.go deleted file mode 100644 index 5cbd0af9..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/thrift.go +++ /dev/null @@ -1,73 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Thrift lexer. -var Thrift = internal.Register(MustNewLexer( - &Config{ - Name: "Thrift", - Aliases: []string{"thrift"}, - Filenames: []string{"*.thrift"}, - MimeTypes: []string{"application/x-thrift"}, - }, - Rules{ - "root": { - Include("whitespace"), - Include("comments"), - {`"`, LiteralStringDouble, Combined("stringescape", "dqs")}, - {`\'`, LiteralStringSingle, Combined("stringescape", "sqs")}, - {`(namespace)(\s+)`, ByGroups(KeywordNamespace, TextWhitespace), Push("namespace")}, - {`(enum|union|struct|service|exception)(\s+)`, ByGroups(KeywordDeclaration, TextWhitespace), Push("class")}, - {`((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()`, ByGroups(UsingSelf("root"), NameFunction, Text, Operator), nil}, - Include("keywords"), - Include("numbers"), - {`[&=]`, Operator, nil}, - {`[:;,{}()<>\[\]]`, Punctuation, nil}, - {`[a-zA-Z_](\.\w|\w)*`, Name, nil}, - }, - "whitespace": { - {`\n`, TextWhitespace, nil}, - {`\s+`, TextWhitespace, nil}, - }, - "comments": { - {`#.*$`, Comment, nil}, - {`//.*?\n`, Comment, nil}, - {`/\*[\w\W]*?\*/`, CommentMultiline, nil}, - }, - "stringescape": { - {`\\([\\nrt"\'])`, LiteralStringEscape, nil}, - }, - "dqs": { - {`"`, LiteralStringDouble, Pop(1)}, - {`[^\\"\n]+`, LiteralStringDouble, nil}, - }, - "sqs": { - {`'`, LiteralStringSingle, Pop(1)}, - {`[^\\\'\n]+`, LiteralStringSingle, nil}, - }, - "namespace": { - {`[a-z*](\.\w|\w)*`, NameNamespace, Pop(1)}, - Default(Pop(1)), - }, - "class": { - {`[a-zA-Z_]\w*`, NameClass, Pop(1)}, - Default(Pop(1)), - }, - "keywords": { - {`(async|oneway|extends|throws|required|optional)\b`, Keyword, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`(const|typedef)\b`, KeywordDeclaration, nil}, - {Words(``, `\b`, `cpp_namespace`, `cpp_include`, `cpp_type`, `java_package`, `cocoa_prefix`, `csharp_namespace`, `delphi_namespace`, `php_namespace`, `py_module`, `perl_package`, `ruby_namespace`, `smalltalk_category`, `smalltalk_prefix`, `xsd_all`, `xsd_optional`, `xsd_nillable`, `xsd_namespace`, `xsd_attrs`, `include`), KeywordNamespace, nil}, - {Words(``, `\b`, `void`, `bool`, `byte`, `i16`, `i32`, `i64`, `double`, `string`, `binary`, `map`, `list`, `set`, `slist`, `senum`), KeywordType, nil}, - {Words(`\b`, `\b`, `BEGIN`, `END`, `__CLASS__`, `__DIR__`, `__FILE__`, `__FUNCTION__`, `__LINE__`, `__METHOD__`, `__NAMESPACE__`, `abstract`, `alias`, `and`, `args`, `as`, `assert`, `begin`, `break`, `case`, `catch`, `class`, `clone`, `continue`, `declare`, `def`, `default`, `del`, `delete`, `do`, `dynamic`, `elif`, `else`, `elseif`, `elsif`, `end`, `enddeclare`, `endfor`, `endforeach`, `endif`, `endswitch`, `endwhile`, `ensure`, `except`, `exec`, `finally`, `float`, `for`, `foreach`, `function`, `global`, `goto`, `if`, `implements`, `import`, `in`, `inline`, `instanceof`, `interface`, `is`, `lambda`, `module`, `native`, `new`, `next`, `nil`, `not`, `or`, `pass`, `public`, `print`, `private`, `protected`, `raise`, `redo`, `rescue`, `retry`, `register`, `return`, `self`, `sizeof`, `static`, `super`, `switch`, `synchronized`, `then`, `this`, `throw`, `transient`, `try`, `undef`, `unless`, `unsigned`, `until`, `use`, `var`, `virtual`, `volatile`, `when`, `while`, `with`, `xor`, `yield`), KeywordReserved, nil}, - }, - "numbers": { - {`[+-]?(\d+\.\d+([eE][+-]?\d+)?|\.?\d+[eE][+-]?\d+)`, LiteralNumberFloat, nil}, - {`[+-]?0x[0-9A-Fa-f]+`, LiteralNumberHex, nil}, - {`[+-]?[0-9]+`, LiteralNumberInteger, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/toml.go b/vendor/github.com/alecthomas/chroma/lexers/t/toml.go deleted file mode 100644 index 68bfc905..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/toml.go +++ /dev/null @@ -1,29 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var TOML = internal.Register(MustNewLexer( - &Config{ - Name: "TOML", - Aliases: []string{"toml"}, - Filenames: []string{"*.toml"}, - MimeTypes: []string{"text/x-toml"}, - }, - Rules{ - "root": { - {`\s+`, Text, nil}, - {`#.*`, Comment, nil}, - {Words(``, `\b`, `true`, `false`), KeywordConstant, nil}, - {`\d\d\d\d-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d\+)?(Z|[+-]\d{2}:\d{2})`, LiteralDate, nil}, - {`[+-]?[0-9](_?\d)*\.\d+`, LiteralNumberFloat, nil}, - {`[+-]?[0-9](_?\d)*`, LiteralNumberInteger, nil}, - {`"(\\\\|\\"|[^"])*"`, StringDouble, nil}, - {`'(\\\\|\\'|[^'])*'`, StringSingle, nil}, - {`[.,=\[\]]`, Punctuation, nil}, - {`[^\W\d]\w*`, NameOther, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tradingview.go b/vendor/github.com/alecthomas/chroma/lexers/t/tradingview.go deleted file mode 100644 index e3d8a7ac..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/tradingview.go +++ /dev/null @@ -1,40 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// TradingView lexer -var TradingView = internal.Register(MustNewLexer( - &Config{ - Name: "TradingView", - Aliases: []string{"tradingview", "tv"}, - Filenames: []string{"*.tv"}, - MimeTypes: []string{"text/x-tradingview"}, - DotAll: true, - EnsureNL: true, - }, - Rules{ - "root": { - {`[^\S\n]+|\n|[()]`, Text, nil}, - {`(//.*?)(\n)`, ByGroups(CommentSingle, Text), nil}, - {`>=|<=|==|!=|>|<|\?|-|\+|\*|\/|%|\[|\]`, Operator, nil}, - {`[:,.]`, Punctuation, nil}, - {`=`, KeywordPseudo, nil}, - {`"(\\\\|\\"|[^"\n])*["\n]`, LiteralString, nil}, - {`'\\.'|'[^\\]'`, LiteralString, nil}, - {`[0-9](\.[0-9]*)?([eE][+-][0-9]+)?`, LiteralNumber, nil}, - {`#[a-fA-F0-9]{8}|#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}`, LiteralStringOther, nil}, - {`(abs|acos|alertcondition|alma|asin|atan|atr|avg|barcolor|barssince|bgcolor|cci|ceil|change|cog|color\.new|correlation|cos|crossover|crossunder|cum|dev|ema|exp|falling|fill|fixnan|floor|heikinashi|highest|highestbars|hline|iff|kagi|label\.(delete|get_text|get_x|get_y|new|set_color|set_size|set_style|set_text|set_textcolor|set_x|set_xloc|set_xy|set_y|set_yloc)|line\.(new|delete|get_x1|get_x2|get_y1|get_y2|set_color|set_width|set_style|set_extend|set_xy1|set_xy2|set_x1|set_x2|set_y1|set_y2|set_xloc)|linebreak|linreg|log|log10|lowest|lowestbars|macd|max|max_bars_back|min|mom|nz|percentile_(linear_interpolation|nearest_rank)|percentrank|pivothigh|pivotlow|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|pointfigure|pow|renko|rising|rma|roc|round|rsi|sar|security|sign|sin|sma|sqrt|stdev|stoch|study|sum|swma|tan|timestamp|tostring|tsi|valuewhen|variance|vwma|wma|strategy\.(cancel|cancel_all|close|close_all|entry|exit|order|risk\.(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)))\b`, NameFunction, nil}, - {`\b(bool|color|cross|dayofmonth|dayofweek|float|hour|input|int|label|line|minute|month|na|offset|second|strategy|string|tickerid|time|tr|vwap|weekofyear|year)(\()`, ByGroups(NameFunction, Text), nil}, // functions that can also be variable - {`(accdist|adjustment\.(dividends|none|splits)|aqua|area|areabr|bar_index|black|blue|bool|circles|close|columns|currency\.(AUD|CAD|CHF|EUR|GBP|HKD|JPY|NOK|NONE|NZD|RUB|SEK|SGD|TRY|USD|ZAR)|color\.(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|dashed|dotted|dayofweek\.(monday|tuesday|wednesday|thursday|friday|saturday|sunday)|extend\.(both|left|right|none)|float|format\.(inherit|price|volume)|friday|fuchsia|gray|green|high|histogram|hl2|hlc3|hline\.style_(dotted|solid|dashed)|input\.(bool|float|integer|resolution|session|source|string|symbol)|integer|interval|isdaily|isdwm|isintraday|ismonthly|isweekly|label\.style_(arrowdown|arrowup|circle|cross|diamond|flag|labeldown|labelup|none|square|triangledown|triangleup|xcross)|lime|line\.style_(dashed|dotted|solid|arrow_both|arrow_left|arrow_right)|linebr|location\.(abovebar|absolute|belowbar|bottom|top)|low|maroon|monday|n|navy|ohlc4|olive|open|orange|period|plot\.style_(area|areabr|circles|columns|cross|histogram|line|linebr|stepline)|purple|red|resolution|saturday|scale\.(left|none|right)|session|session\.(extended|regular)|silver|size\.(auto|huge|large|normal|small|tiny)|solid|source|stepline|string|sunday|symbol|syminfo\.(mintick|pointvalue|prefix|root|session|ticker|tickerid|timezone)|teal|thursday|ticker|timeframe\.(isdaily|isdwm|isintraday|ismonthly|isweekly|multiplier|period)|timenow|tuesday|volume|wednesday|white|yellow|strategy\.(cash|closedtrades|commission\.(cash_per_contract|cash_per_order|percent)|direction\.(all|long|short)|equity|eventrades|fixed|grossloss|grossprofit|initial_capital|long|losstrades|max_contracts_held_(all|long|short)|max_drawdown|netprofit|oca\.(cancel|none|reduce)|openprofit|opentrades|percent_of_equity|position_avg_price|position_entry_name|position_size|short|wintrades)|shape\.(arrowdown|arrowup|circle|cross|diamond|flag|labeldown|labelup|square|triangledown|triangleup|xcross)|barstate\.is(first|history|last|new|realtime)|barmerge\.(gaps_on|gaps_off|lookahead_on|lookahead_off)|xloc\.bar_(index|time)|yloc\.(abovebar|belowbar|price))\b`, NameVariable, nil}, - {`(cross|dayofmonth|dayofweek|hour|minute|month|na|second|tickerid|time|tr|vwap|weekofyear|year)(\b[^\(])`, ByGroups(NameVariable, Text), nil}, // variables that can also be function - {`(int|float|bool|color|string|label|line)(\b[^\(=.])`, ByGroups(KeywordType, Text), nil}, // types that can also be a function - {`(var)\b`, KeywordType, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {`(and|or|not|if|else|for|to)\b`, OperatorWord, nil}, - {`@?[_a-zA-Z]\w*`, Text, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/transactsql.go b/vendor/github.com/alecthomas/chroma/lexers/t/transactsql.go deleted file mode 100644 index 769a2f91..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/transactsql.go +++ /dev/null @@ -1,60 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// TransactSQL lexer. -var TransactSQL = internal.Register(MustNewLexer( - &Config{ - Name: "Transact-SQL", - Aliases: []string{"tsql", "t-sql"}, - MimeTypes: []string{"text/x-tsql"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, TextWhitespace, nil}, - {`--(?m).*?$\n?`, CommentSingle, nil}, - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`'`, LiteralStringSingle, Push("string")}, - {`"`, LiteralStringName, Push("quoted-ident")}, - {Words(``, ``, `!<`, `!=`, `!>`, `<`, `<=`, `<>`, `=`, `>`, `>=`, `+`, `+=`, `-`, `-=`, `*`, `*=`, `/`, `/=`, `%`, `%=`, `&`, `&=`, `|`, `|=`, `^`, `^=`, `~`, `::`), Operator, nil}, - {Words(``, `\b`, `all`, `and`, `any`, `between`, `except`, `exists`, `in`, `intersect`, `like`, `not`, `or`, `some`, `union`), OperatorWord, nil}, - {Words(``, `\b`, `bigint`, `binary`, `bit`, `char`, `cursor`, `date`, `datetime`, `datetime2`, `datetimeoffset`, `decimal`, `float`, `hierarchyid`, `image`, `int`, `money`, `nchar`, `ntext`, `numeric`, `nvarchar`, `real`, `smalldatetime`, `smallint`, `smallmoney`, `sql_variant`, `table`, `text`, `time`, `timestamp`, `tinyint`, `uniqueidentifier`, `varbinary`, `varchar`, `xml`), NameClass, nil}, - {Words(``, `\b`, `$partition`, `abs`, `acos`, `app_name`, `applock_mode`, `applock_test`, `ascii`, `asin`, `assemblyproperty`, `atan`, `atn2`, `avg`, `binary_checksum`, `cast`, `ceiling`, `certencoded`, `certprivatekey`, `char`, `charindex`, `checksum`, `checksum_agg`, `choose`, `col_length`, `col_name`, `columnproperty`, `compress`, `concat`, `connectionproperty`, `context_info`, `convert`, `cos`, `cot`, `count`, `count_big`, `current_request_id`, `current_timestamp`, `current_transaction_id`, `current_user`, `cursor_status`, `database_principal_id`, `databasepropertyex`, `dateadd`, `datediff`, `datediff_big`, `datefromparts`, `datename`, `datepart`, `datetime2fromparts`, `datetimefromparts`, `datetimeoffsetfromparts`, `day`, `db_id`, `db_name`, `decompress`, `degrees`, `dense_rank`, `difference`, `eomonth`, `error_line`, `error_message`, `error_number`, `error_procedure`, `error_severity`, `error_state`, `exp`, `file_id`, `file_idex`, `file_name`, `filegroup_id`, `filegroup_name`, `filegroupproperty`, `fileproperty`, `floor`, `format`, `formatmessage`, `fulltextcatalogproperty`, `fulltextserviceproperty`, `get_filestream_transaction_context`, `getansinull`, `getdate`, `getutcdate`, `grouping`, `grouping_id`, `has_perms_by_name`, `host_id`, `host_name`, `iif`, `index_col`, `indexkey_property`, `indexproperty`, `is_member`, `is_rolemember`, `is_srvrolemember`, `isdate`, `isjson`, `isnull`, `isnumeric`, `json_modify`, `json_query`, `json_value`, `left`, `len`, `log`, `log10`, `lower`, `ltrim`, `max`, `min`, `min_active_rowversion`, `month`, `nchar`, `newid`, `newsequentialid`, `ntile`, `object_definition`, `object_id`, `object_name`, `object_schema_name`, `objectproperty`, `objectpropertyex`, `opendatasource`, `openjson`, `openquery`, `openrowset`, `openxml`, `original_db_name`, `original_login`, `parse`, `parsename`, `patindex`, `permissions`, `pi`, `power`, `pwdcompare`, `pwdencrypt`, `quotename`, `radians`, `rand`, `rank`, `replace`, `replicate`, `reverse`, `right`, `round`, `row_number`, `rowcount_big`, `rtrim`, `schema_id`, `schema_name`, `scope_identity`, `serverproperty`, `session_context`, `session_user`, `sign`, `sin`, `smalldatetimefromparts`, `soundex`, `sp_helplanguage`, `space`, `sqrt`, `square`, `stats_date`, `stdev`, `stdevp`, `str`, `string_escape`, `string_split`, `stuff`, `substring`, `sum`, `suser_id`, `suser_name`, `suser_sid`, `suser_sname`, `switchoffset`, `sysdatetime`, `sysdatetimeoffset`, `system_user`, `sysutcdatetime`, `tan`, `textptr`, `textvalid`, `timefromparts`, `todatetimeoffset`, `try_cast`, `try_convert`, `try_parse`, `type_id`, `type_name`, `typeproperty`, `unicode`, `upper`, `user_id`, `user_name`, `var`, `varp`, `xact_state`, `year`), NameFunction, nil}, - {`(goto)(\s+)(\w+\b)`, ByGroups(Keyword, TextWhitespace, NameLabel), nil}, - {Words(``, `\b`, `absolute`, `action`, `ada`, `add`, `admin`, `after`, `aggregate`, `alias`, `all`, `allocate`, `alter`, `and`, `any`, `are`, `array`, `as`, `asc`, `asensitive`, `assertion`, `asymmetric`, `at`, `atomic`, `authorization`, `avg`, `backup`, `before`, `begin`, `between`, `binary`, `bit`, `bit_length`, `blob`, `boolean`, `both`, `breadth`, `break`, `browse`, `bulk`, `by`, `call`, `called`, `cardinality`, `cascade`, `cascaded`, `case`, `cast`, `catalog`, `catch`, `char`, `char_length`, `character`, `character_length`, `check`, `checkpoint`, `class`, `clob`, `close`, `clustered`, `coalesce`, `collate`, `collation`, `collect`, `column`, `commit`, `completion`, `compute`, `condition`, `connect`, `connection`, `constraint`, `constraints`, `constructor`, `contains`, `containstable`, `continue`, `convert`, `corr`, `corresponding`, `count`, `covar_pop`, `covar_samp`, `create`, `cross`, `cube`, `cume_dist`, `current`, `current_catalog`, `current_date`, `current_default_transform_group`, `current_path`, `current_role`, `current_schema`, `current_time`, `current_timestamp`, `current_transform_group_for_type`, `current_user`, `cursor`, `cycle`, `data`, `database`, `date`, `day`, `dbcc`, `deallocate`, `dec`, `decimal`, `declare`, `default`, `deferrable`, `deferred`, `delete`, `deny`, `depth`, `deref`, `desc`, `describe`, `descriptor`, `destroy`, `destructor`, `deterministic`, `diagnostics`, `dictionary`, `disconnect`, `disk`, `distinct`, `distributed`, `domain`, `double`, `drop`, `dump`, `dynamic`, `each`, `element`, `else`, `end`, `end-exec`, `equals`, `errlvl`, `escape`, `every`, `except`, `exception`, `exec`, `execute`, `exists`, `exit`, `external`, `extract`, `false`, `fetch`, `file`, `fillfactor`, `filter`, `first`, `float`, `for`, `foreign`, `fortran`, `found`, `free`, `freetext`, `freetexttable`, `from`, `full`, `fulltexttable`, `function`, `fusion`, `general`, `get`, `global`, `go`, `goto`, `grant`, `group`, `grouping`, `having`, `hold`, `holdlock`, `host`, `hour`, `identity`, `identity_insert`, `identitycol`, `if`, `ignore`, `immediate`, `in`, `include`, `index`, `indicator`, `initialize`, `initially`, `inner`, `inout`, `input`, `insensitive`, `insert`, `int`, `integer`, `intersect`, `intersection`, `interval`, `into`, `is`, `isolation`, `iterate`, `join`, `key`, `kill`, `language`, `large`, `last`, `lateral`, `leading`, `left`, `less`, `level`, `like`, `like_regex`, `limit`, `lineno`, `ln`, `load`, `local`, `localtime`, `localtimestamp`, `locator`, `lower`, `map`, `match`, `max`, `member`, `merge`, `method`, `min`, `minute`, `mod`, `modifies`, `modify`, `module`, `month`, `multiset`, `names`, `national`, `natural`, `nchar`, `nclob`, `new`, `next`, `no`, `nocheck`, `nonclustered`, `none`, `normalize`, `not`, `null`, `nullif`, `numeric`, `object`, `occurrences_regex`, `octet_length`, `of`, `off`, `offsets`, `old`, `on`, `only`, `open`, `opendatasource`, `openquery`, `openrowset`, `openxml`, `operation`, `option`, `or`, `order`, `ordinality`, `out`, `outer`, `output`, `over`, `overlaps`, `overlay`, `pad`, `parameter`, `parameters`, `partial`, `partition`, `pascal`, `path`, `percent`, `percent_rank`, `percentile_cont`, `percentile_disc`, `pivot`, `plan`, `position`, `position_regex`, `postfix`, `precision`, `prefix`, `preorder`, `prepare`, `preserve`, `primary`, `print`, `prior`, `privileges`, `proc`, `procedure`, `public`, `raiserror`, `range`, `read`, `reads`, `readtext`, `real`, `reconfigure`, `recursive`, `ref`, `references`, `referencing`, `regr_avgx`, `regr_avgy`, `regr_count`, `regr_intercept`, `regr_r2`, `regr_slope`, `regr_sxx`, `regr_sxy`, `regr_syy`, `relative`, `release`, `replication`, `restore`, `restrict`, `result`, `return`, `returns`, `revert`, `revoke`, `right`, `role`, `rollback`, `rollup`, `routine`, `row`, `rowcount`, `rowguidcol`, `rows`, `rule`, `save`, `savepoint`, `schema`, `scope`, `scroll`, `search`, `second`, `section`, `securityaudit`, `select`, `semantickeyphrasetable`, `semanticsimilaritydetailstable`, `semanticsimilaritytable`, `sensitive`, `sequence`, `session`, `session_user`, `set`, `sets`, `setuser`, `shutdown`, `similar`, `size`, `smallint`, `some`, `space`, `specific`, `specifictype`, `sql`, `sqlca`, `sqlcode`, `sqlerror`, `sqlexception`, `sqlstate`, `sqlwarning`, `start`, `state`, `statement`, `static`, `statistics`, `stddev_pop`, `stddev_samp`, `structure`, `submultiset`, `substring`, `substring_regex`, `sum`, `symmetric`, `system`, `system_user`, `table`, `tablesample`, `temporary`, `terminate`, `textsize`, `than`, `then`, `throw`, `time`, `timestamp`, `timezone_hour`, `timezone_minute`, `to`, `top`, `trailing`, `tran`, `transaction`, `translate`, `translate_regex`, `translation`, `treat`, `trigger`, `trim`, `true`, `truncate`, `try`, `try_convert`, `tsequal`, `uescape`, `under`, `union`, `unique`, `unknown`, `unnest`, `unpivot`, `update`, `updatetext`, `upper`, `usage`, `use`, `user`, `using`, `value`, `values`, `var_pop`, `var_samp`, `varchar`, `variable`, `varying`, `view`, `waitfor`, `when`, `whenever`, `where`, `while`, `width_bucket`, `window`, `with`, `within`, `without`, `work`, `write`, `writetext`, `xmlagg`, `xmlattributes`, `xmlbinary`, `xmlcast`, `xmlcomment`, `xmlconcat`, `xmldocument`, `xmlelement`, `xmlexists`, `xmlforest`, `xmliterate`, `xmlnamespaces`, `xmlparse`, `xmlpi`, `xmlquery`, `xmlserialize`, `xmltable`, `xmltext`, `xmlvalidate`, `year`, `zone`), Keyword, nil}, - {`(\[)([^]]+)(\])`, ByGroups(Operator, Name, Operator), nil}, - {`0x[0-9a-f]+`, LiteralNumberHex, nil}, - {`[0-9]+\.[0-9]*(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`\.[0-9]+(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil}, - {`[0-9]+e[+-]?[0-9]+`, LiteralNumberFloat, nil}, - {`[0-9]+`, LiteralNumberInteger, nil}, - {`[;(),.]`, Punctuation, nil}, - {`@@\w+`, NameBuiltin, nil}, - {`@\w+`, NameVariable, nil}, - {`(\w+)(:)`, ByGroups(NameLabel, Punctuation), nil}, - {`#?#?\w+`, Name, nil}, - {`\?`, NameVariableMagic, nil}, - }, - "multiline-comments": { - {`/\*`, CommentMultiline, Push("multiline-comments")}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[^/*]+`, CommentMultiline, nil}, - {`[/*]`, CommentMultiline, nil}, - }, - "string": { - {`[^']+`, LiteralStringSingle, nil}, - {`''`, LiteralStringSingle, nil}, - {`'`, LiteralStringSingle, Pop(1)}, - }, - "quoted-ident": { - {`[^"]+`, LiteralStringName, nil}, - {`""`, LiteralStringName, nil}, - {`"`, LiteralStringName, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/turing.go b/vendor/github.com/alecthomas/chroma/lexers/t/turing.go deleted file mode 100644 index ae5671b5..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/turing.go +++ /dev/null @@ -1,43 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Turing lexer. -var Turing = internal.Register(MustNewLexer( - &Config{ - Name: "Turing", - Aliases: []string{"turing"}, - Filenames: []string{"*.turing", "*.tu"}, - MimeTypes: []string{"text/x-turing"}, - }, - Rules{ - "root": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, - {`%(.*?)\n`, CommentSingle, nil}, - {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, - {`(var|fcn|function|proc|procedure|process|class|end|record|type|begin|case|loop|for|const|union|monitor|module|handler)\b`, KeywordDeclaration, nil}, - {`(all|asm|assert|bind|bits|body|break|by|cheat|checked|close|condition|decreasing|def|deferred|else|elsif|exit|export|external|flexible|fork|forward|free|get|if|implement|import|include|inherit|init|invariant|label|new|objectclass|of|opaque|open|packed|pause|pervasive|post|pre|priority|put|quit|read|register|result|seek|self|set|signal|skip|tag|tell|then|timeout|to|unchecked|unqualified|wait|when|write)\b`, Keyword, nil}, - {`(true|false)\b`, KeywordConstant, nil}, - {Words(``, `\b`, `addressint`, `array`, `boolean`, `char`, `int`, `int1`, `int2`, `int4`, `int8`, `nat`, `nat1`, `nat2`, `nat4`, `nat8`, `pointer`, `real`, `real4`, `real8`, `string`, `enum`), KeywordType, nil}, - {`\d+i`, LiteralNumber, nil}, - {`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\.\d+([Ee][-+]\d+)?i`, LiteralNumber, nil}, - {`\d+[Ee][-+]\d+i`, LiteralNumber, nil}, - {`\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil}, - {`\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil}, - {`0[0-7]+`, LiteralNumberOct, nil}, - {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil}, - {`(0|[1-9][0-9]*)`, LiteralNumberInteger, nil}, - {`(div|mod|rem|\*\*|=|<|>|>=|<=|not=|not|and|or|xor|=>|in|shl|shr|->|~|~=|~in|&|:=|\.\.|[\^+\-*/&#])`, Operator, nil}, - {`'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'`, LiteralStringChar, nil}, - {`"(\\\\|\\"|[^"])*"`, LiteralString, nil}, - {`[()\[\]{}.,:]`, Punctuation, nil}, - {`[^\W\d]\w*`, NameOther, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/turtle.go b/vendor/github.com/alecthomas/chroma/lexers/t/turtle.go deleted file mode 100644 index 71d3c47b..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/turtle.go +++ /dev/null @@ -1,67 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Turtle lexer. -var Turtle = internal.Register(MustNewLexer( - &Config{ - Name: "Turtle", - Aliases: []string{"turtle"}, - Filenames: []string{"*.ttl"}, - MimeTypes: []string{"text/turtle", "application/x-turtle"}, - NotMultiline: true, - CaseInsensitive: true, - }, - Rules{ - "root": { - {`\s+`, TextWhitespace, nil}, - {"(@base|BASE)(\\s+)(<[^<>\"{}|^`\\\\\\x00-\\x20]*>)(\\s*)(\\.?)", ByGroups(Keyword, TextWhitespace, NameVariable, TextWhitespace, Punctuation), nil}, - {"(@prefix|PREFIX)(\\s+)((?:[a-z][\\w-]*)?\\:)(\\s+)(<[^<>\"{}|^`\\\\\\x00-\\x20]*>)(\\s*)(\\.?)", ByGroups(Keyword, TextWhitespace, NameNamespace, TextWhitespace, NameVariable, TextWhitespace, Punctuation), nil}, - {`(?<=\s)a(?=\s)`, KeywordType, nil}, - {"(<[^<>\"{}|^`\\\\\\x00-\\x20]*>)", NameVariable, nil}, - {`((?:[a-z][\w-]*)?\:)([a-z][\w-]*)`, ByGroups(NameNamespace, NameTag), nil}, - {`#[^\n]+`, Comment, nil}, - {`\b(true|false)\b`, Literal, nil}, - {`[+\-]?\d*\.\d+`, LiteralNumberFloat, nil}, - {`[+\-]?\d*(:?\.\d+)?E[+\-]?\d+`, LiteralNumberFloat, nil}, - {`[+\-]?\d+`, LiteralNumberInteger, nil}, - {`[\[\](){}.;,:^]`, Punctuation, nil}, - {`"""`, LiteralString, Push("triple-double-quoted-string")}, - {`"`, LiteralString, Push("single-double-quoted-string")}, - {`'''`, LiteralString, Push("triple-single-quoted-string")}, - {`'`, LiteralString, Push("single-single-quoted-string")}, - }, - "triple-double-quoted-string": { - {`"""`, LiteralString, Push("end-of-string")}, - {`[^\\]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "single-double-quoted-string": { - {`"`, LiteralString, Push("end-of-string")}, - {`[^"\\\n]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "triple-single-quoted-string": { - {`'''`, LiteralString, Push("end-of-string")}, - {`[^\\]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "single-single-quoted-string": { - {`'`, LiteralString, Push("end-of-string")}, - {`[^'\\\n]+`, LiteralString, nil}, - {`\\`, LiteralString, Push("string-escape")}, - }, - "string-escape": { - {`.`, LiteralString, Pop(1)}, - }, - "end-of-string": { - {`(@)([a-z]+(:?-[a-z0-9]+)*)`, ByGroups(Operator, GenericEmph, GenericEmph), Pop(2)}, - {"(\\^\\^)(<[^<>\"{}|^`\\\\\\x00-\\x20]*>)", ByGroups(Operator, GenericEmph), Pop(2)}, - {`(\^\^)((?:[a-z][\w-]*)?\:)([a-z][\w-]*)`, ByGroups(Operator, GenericEmph, GenericEmph), Pop(2)}, - Default(Pop(2)), - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/twig.go b/vendor/github.com/alecthomas/chroma/lexers/t/twig.go deleted file mode 100644 index 56aa9b9a..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/twig.go +++ /dev/null @@ -1,54 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Twig lexer. -var Twig = internal.Register(MustNewLexer( - &Config{ - Name: "Twig", - Aliases: []string{"twig"}, - Filenames: []string{}, - MimeTypes: []string{"application/x-twig"}, - DotAll: true, - }, - Rules{ - "root": { - {`[^{]+`, Other, nil}, - {`\{\{`, CommentPreproc, Push("var")}, - {`\{\#.*?\#\}`, Comment, nil}, - {`(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})`, ByGroups(CommentPreproc, Text, Keyword, Text, CommentPreproc, Other, CommentPreproc, Text, Keyword, Text, CommentPreproc), nil}, - {`(\{%)(-?\s*)(verbatim)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endverbatim)(\s*-?)(%\})`, ByGroups(CommentPreproc, Text, Keyword, Text, CommentPreproc, Other, CommentPreproc, Text, Keyword, Text, CommentPreproc), nil}, - {`(\{%)(-?\s*)(filter)(\s+)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w-]|[^\x00-\x7f])*)`, ByGroups(CommentPreproc, Text, Keyword, Text, NameFunction), Push("tag")}, - {`(\{%)(-?\s*)([a-zA-Z_]\w*)`, ByGroups(CommentPreproc, Text, Keyword), Push("tag")}, - {`\{`, Other, nil}, - }, - "varnames": { - {`(\|)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w-]|[^\x00-\x7f])*)`, ByGroups(Operator, Text, NameFunction), nil}, - {`(is)(\s+)(not)?(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w-]|[^\x00-\x7f])*)`, ByGroups(Keyword, Text, Keyword, Text, NameFunction), nil}, - {`(?i)(true|false|none|null)\b`, KeywordPseudo, nil}, - {`(in|not|and|b-and|or|b-or|b-xor|isif|elseif|else|importconstant|defined|divisibleby|empty|even|iterable|odd|sameasmatches|starts\s+with|ends\s+with)\b`, Keyword, nil}, - {`(loop|block|parent)\b`, NameBuiltin, nil}, - {`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w-]|[^\x00-\x7f])*`, NameVariable, nil}, - {`\.(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w-]|[^\x00-\x7f])*`, NameVariable, nil}, - {`\.[0-9]+`, LiteralNumber, nil}, - {`:?"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil}, - {`:?'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil}, - {`([{}()\[\]+\-*/,:~%]|\.\.|\?|:|\*\*|\/\/|!=|[><=]=?)`, Operator, nil}, - {`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil}, - }, - "var": { - {`\s+`, Text, nil}, - {`(-?)(\}\})`, ByGroups(Text, CommentPreproc), Pop(1)}, - Include("varnames"), - }, - "tag": { - {`\s+`, Text, nil}, - {`(-?)(%\})`, ByGroups(Text, CommentPreproc), Pop(1)}, - Include("varnames"), - {`.`, Punctuation, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go b/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go deleted file mode 100644 index 57d08bf1..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go +++ /dev/null @@ -1,73 +0,0 @@ -package t - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// TypeScript lexer. -var TypeScript = internal.Register(MustNewLexer( - &Config{ - Name: "TypeScript", - Aliases: []string{"ts", "typescript"}, - Filenames: []string{"*.ts", "*.tsx"}, - MimeTypes: []string{"text/x-typescript"}, - DotAll: true, - EnsureNL: true, - }, - Rules{ - "commentsandwhitespace": { - {`\s+`, Text, nil}, - {``, Comment, Pop(1)}, - {`-`, Comment, nil}, - }, - "tag": { - {`\s+`, Text, nil}, - {`[\w.:-]+\s*=`, NameAttribute, Push("attr")}, - {`/?\s*>`, NameTag, Pop(1)}, - }, - "attr": { - {`\s+`, Text, nil}, - {`".*?"`, LiteralString, Pop(1)}, - {`'.*?'`, LiteralString, Pop(1)}, - {`[^\s>]+`, LiteralString, Pop(1)}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/x/xorg.go b/vendor/github.com/alecthomas/chroma/lexers/x/xorg.go deleted file mode 100644 index 6e6cbec6..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/x/xorg.go +++ /dev/null @@ -1,25 +0,0 @@ -package x - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -// Xorg lexer. -var Xorg = internal.Register(MustNewLexer( - &Config{ - Name: "Xorg", - Aliases: []string{"xorg.conf"}, - Filenames: []string{"xorg.conf"}, - MimeTypes: []string{}, - }, - Rules{ - "root": { - {`\s+`, TextWhitespace, nil}, - {`#.*$`, Comment, nil}, - {`((|Sub)Section)(\s+)("\w+")`, ByGroups(KeywordNamespace, LiteralStringEscape, TextWhitespace, LiteralStringEscape), nil}, - {`(End(|Sub)Section)`, KeywordNamespace, nil}, - {`(\w+)(\s+)([^\n#]+)`, ByGroups(NameKeyword, TextWhitespace, LiteralString), nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/y/yaml.go b/vendor/github.com/alecthomas/chroma/lexers/y/yaml.go deleted file mode 100644 index 82fed0c0..00000000 --- a/vendor/github.com/alecthomas/chroma/lexers/y/yaml.go +++ /dev/null @@ -1,50 +0,0 @@ -package y - -import ( - . "github.com/alecthomas/chroma" // nolint - "github.com/alecthomas/chroma/lexers/internal" -) - -var YAML = internal.Register(MustNewLexer( - &Config{ - Name: "YAML", - Aliases: []string{"yaml"}, - Filenames: []string{"*.yaml", "*.yml"}, - MimeTypes: []string{"text/x-yaml"}, - }, - Rules{ - "root": { - Include("whitespace"), - {`^---`, Text, nil}, - {`[\n?]?\s*- `, Text, nil}, - {`#.*$`, Comment, nil}, - {`!![^\s]+`, CommentPreproc, nil}, - {`&[^\s]+`, CommentPreproc, nil}, - {`\*[^\s]+`, CommentPreproc, nil}, - {`^%include\s+[^\n\r]+`, CommentPreproc, nil}, - {`([>|+-]\s+)(\s+)((?:(?:.*?$)(?:[\n\r]*?)?)*)`, ByGroups(StringDoc, StringDoc, StringDoc), nil}, - Include("key"), - Include("value"), - {`[?:,\[\]]`, Punctuation, nil}, - {`.`, Text, nil}, - }, - "value": { - {Words(``, `\b`, "true", "false", "null"), KeywordConstant, nil}, - {`"(?:\\.|[^"])*"`, StringDouble, nil}, - {`'(?:\\.|[^'])*'`, StringSingle, nil}, - {`\d\d\d\d-\d\d-\d\d([T ]\d\d:\d\d:\d\d(\.\d+)?(Z|\s+[-+]\d+)?)?`, LiteralDate, nil}, - {`\b[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)\b`, Number, nil}, - {`\b[\w]+\b`, Text, nil}, - }, - "key": { - {`"[^"\n].*": `, Keyword, nil}, - {`(-)( )([^"\n{]*)(:)( )`, ByGroups(Punctuation, Whitespace, Keyword, Punctuation, Whitespace), nil}, - {`([^"\n{]*)(:)( )`, ByGroups(Keyword, Punctuation, Whitespace), nil}, - {`([^"\n{]*)(:)(\n)`, ByGroups(Keyword, Punctuation, Whitespace), nil}, - }, - "whitespace": { - {`\s+`, Whitespace, nil}, - {`\n+`, Whitespace, nil}, - }, - }, -)) diff --git a/vendor/github.com/alecthomas/chroma/mutators.go b/vendor/github.com/alecthomas/chroma/mutators.go deleted file mode 100644 index bd6d720e..00000000 --- a/vendor/github.com/alecthomas/chroma/mutators.go +++ /dev/null @@ -1,131 +0,0 @@ -package chroma - -import ( - "fmt" - "strings" -) - -// A Mutator modifies the behaviour of the lexer. -type Mutator interface { - // Mutate the lexer state machine as it is processing. - Mutate(state *LexerState) error -} - -// A LexerMutator is an additional interface that a Mutator can implement -// to modify the lexer when it is compiled. -type LexerMutator interface { - // Rules are the lexer rules, state is the state key for the rule the mutator is associated with. - MutateLexer(rules CompiledRules, state string, rule int) error -} - -// A MutatorFunc is a Mutator that mutates the lexer state machine as it is processing. -type MutatorFunc func(state *LexerState) error - -func (m MutatorFunc) Mutate(state *LexerState) error { return m(state) } // nolint - -// Mutators applies a set of Mutators in order. -func Mutators(modifiers ...Mutator) MutatorFunc { - return func(state *LexerState) error { - for _, modifier := range modifiers { - if err := modifier.Mutate(state); err != nil { - return err - } - } - return nil - } -} - -type includeMutator struct { - state string -} - -// Include the given state. -func Include(state string) Rule { - return Rule{Mutator: &includeMutator{state}} -} - -func (i *includeMutator) Mutate(s *LexerState) error { - return fmt.Errorf("should never reach here Include(%q)", i.state) -} - -func (i *includeMutator) MutateLexer(rules CompiledRules, state string, rule int) error { - includedRules, ok := rules[i.state] - if !ok { - return fmt.Errorf("invalid include state %q", i.state) - } - rules[state] = append(rules[state][:rule], append(includedRules, rules[state][rule+1:]...)...) - return nil -} - -type combinedMutator struct { - states []string -} - -// Combined creates a new anonymous state from the given states, and pushes that state. -func Combined(states ...string) Mutator { - return &combinedMutator{states} -} - -func (c *combinedMutator) Mutate(s *LexerState) error { - return fmt.Errorf("should never reach here Combined(%v)", c.states) -} - -func (c *combinedMutator) MutateLexer(rules CompiledRules, state string, rule int) error { - name := "__combined_" + strings.Join(c.states, "__") - if _, ok := rules[name]; !ok { - combined := []*CompiledRule{} - for _, state := range c.states { - rules, ok := rules[state] - if !ok { - return fmt.Errorf("invalid combine state %q", state) - } - combined = append(combined, rules...) - } - rules[name] = combined - } - rules[state][rule].Mutator = Push(name) - return nil -} - -// Push states onto the stack. -func Push(states ...string) MutatorFunc { - return func(s *LexerState) error { - if len(states) == 0 { - s.Stack = append(s.Stack, s.State) - } else { - for _, state := range states { - if state == "#pop" { - s.Stack = s.Stack[:len(s.Stack)-1] - } else { - s.Stack = append(s.Stack, state) - } - } - } - return nil - } -} - -// Pop state from the stack when rule matches. -func Pop(n int) MutatorFunc { - return func(state *LexerState) error { - if len(state.Stack) == 0 { - return fmt.Errorf("nothing to pop") - } - state.Stack = state.Stack[:len(state.Stack)-n] - return nil - } -} - -// Default returns a Rule that applies a set of Mutators. -func Default(mutators ...Mutator) Rule { - return Rule{Mutator: Mutators(mutators...)} -} - -// Stringify returns the raw string for a set of tokens. -func Stringify(tokens ...Token) string { - out := []string{} - for _, t := range tokens { - out = append(out, t.Value) - } - return strings.Join(out, "") -} diff --git a/vendor/github.com/alecthomas/chroma/pygments-lexers.txt b/vendor/github.com/alecthomas/chroma/pygments-lexers.txt deleted file mode 100644 index 9c9ced2e..00000000 --- a/vendor/github.com/alecthomas/chroma/pygments-lexers.txt +++ /dev/null @@ -1,325 +0,0 @@ -Generated with: - - g 'class.*RegexLexer' | pawk --strict -F: '"pygments.lexers.%s.%s" % (f[0].split(".")[0], f[2].split()[1].split("(")[0])' > lexers.txt - -perl6: - Requires a bunch of helpers that I do not have the time to convert. - -kotlin: - invalid unicode escape sequences - FIXED: Have to disable wide Unicode characters in unistring.py - -pygments.lexers.ambient.AmbientTalkLexer -pygments.lexers.ampl.AmplLexer -pygments.lexers.actionscript.ActionScriptLexer -pygments.lexers.actionscript.ActionScript3Lexer -pygments.lexers.actionscript.MxmlLexer -pygments.lexers.algebra.GAPLexer -pygments.lexers.algebra.MathematicaLexer -pygments.lexers.algebra.MuPADLexer -pygments.lexers.algebra.BCLexer -pygments.lexers.apl.APLLexer -pygments.lexers.bibtex.BibTeXLexer -pygments.lexers.bibtex.BSTLexer -pygments.lexers.basic.BlitzMaxLexer -pygments.lexers.basic.BlitzBasicLexer -pygments.lexers.basic.MonkeyLexer -pygments.lexers.basic.CbmBasicV2Lexer -pygments.lexers.basic.QBasicLexer -pygments.lexers.automation.AutohotkeyLexer -pygments.lexers.automation.AutoItLexer -pygments.lexers.archetype.AtomsLexer -pygments.lexers.c_like.ClayLexer -pygments.lexers.c_like.ValaLexer -pygments.lexers.asm.GasLexer -pygments.lexers.asm.ObjdumpLexer -pygments.lexers.asm.HsailLexer -pygments.lexers.asm.LlvmLexer -pygments.lexers.asm.NasmLexer -pygments.lexers.asm.TasmLexer -pygments.lexers.asm.Ca65Lexer -pygments.lexers.business.CobolLexer -pygments.lexers.business.ABAPLexer -pygments.lexers.business.OpenEdgeLexer -pygments.lexers.business.GoodDataCLLexer -pygments.lexers.business.MaqlLexer -pygments.lexers.capnproto.CapnProtoLexer -pygments.lexers.chapel.ChapelLexer -pygments.lexers.clean.CleanLexer -pygments.lexers.c_cpp.CFamilyLexer -pygments.lexers.console.VCTreeStatusLexer -pygments.lexers.console.PyPyLogLexer -pygments.lexers.csound.CsoundLexer -pygments.lexers.csound.CsoundDocumentLexer -pygments.lexers.csound.CsoundDocumentLexer -pygments.lexers.crystal.CrystalLexer -pygments.lexers.dalvik.SmaliLexer -pygments.lexers.css.CssLexer -pygments.lexers.css.SassLexer -pygments.lexers.css.ScssLexer -pygments.lexers.configs.IniLexer -pygments.lexers.configs.RegeditLexer -pygments.lexers.configs.PropertiesLexer -pygments.lexers.configs.KconfigLexer -pygments.lexers.configs.Cfengine3Lexer -pygments.lexers.configs.ApacheConfLexer -pygments.lexers.configs.SquidConfLexer -pygments.lexers.configs.NginxConfLexer -pygments.lexers.configs.LighttpdConfLexer -pygments.lexers.configs.DockerLexer -pygments.lexers.configs.TerraformLexer -pygments.lexers.configs.TermcapLexer -pygments.lexers.configs.TerminfoLexer -pygments.lexers.configs.PkgConfigLexer -pygments.lexers.configs.PacmanConfLexer -pygments.lexers.data.YamlLexer -pygments.lexers.data.JsonLexer -pygments.lexers.diff.DiffLexer -pygments.lexers.diff.DarcsPatchLexer -pygments.lexers.diff.WDiffLexer -pygments.lexers.dotnet.CSharpLexer -pygments.lexers.dotnet.NemerleLexer -pygments.lexers.dotnet.BooLexer -pygments.lexers.dotnet.VbNetLexer -pygments.lexers.dotnet.GenericAspxLexer -pygments.lexers.dotnet.FSharpLexer -pygments.lexers.dylan.DylanLexer -pygments.lexers.dylan.DylanLidLexer -pygments.lexers.ecl.ECLLexer -pygments.lexers.eiffel.EiffelLexer -pygments.lexers.dsls.ProtoBufLexer -pygments.lexers.dsls.ThriftLexer -pygments.lexers.dsls.BroLexer -pygments.lexers.dsls.PuppetLexer -pygments.lexers.dsls.RslLexer -pygments.lexers.dsls.MscgenLexer -pygments.lexers.dsls.VGLLexer -pygments.lexers.dsls.AlloyLexer -pygments.lexers.dsls.PanLexer -pygments.lexers.dsls.CrmshLexer -pygments.lexers.dsls.FlatlineLexer -pygments.lexers.dsls.SnowballLexer -pygments.lexers.elm.ElmLexer -pygments.lexers.erlang.ErlangLexer -pygments.lexers.erlang.ElixirLexer -pygments.lexers.ezhil.EzhilLexer -pygments.lexers.esoteric.BrainfuckLexer -pygments.lexers.esoteric.BefungeLexer -pygments.lexers.esoteric.CAmkESLexer -pygments.lexers.esoteric.CapDLLexer -pygments.lexers.esoteric.RedcodeLexer -pygments.lexers.esoteric.AheuiLexer -pygments.lexers.factor.FactorLexer -pygments.lexers.fantom.FantomLexer -pygments.lexers.felix.FelixLexer -pygments.lexers.forth.ForthLexer -pygments.lexers.fortran.FortranLexer -pygments.lexers.fortran.FortranFixedLexer -pygments.lexers.go.GoLexer -pygments.lexers.foxpro.FoxProLexer -pygments.lexers.graph.CypherLexer -pygments.lexers.grammar_notation.BnfLexer -pygments.lexers.grammar_notation.AbnfLexer -pygments.lexers.grammar_notation.JsgfLexer -pygments.lexers.graphics.GLShaderLexer -pygments.lexers.graphics.PostScriptLexer -pygments.lexers.graphics.AsymptoteLexer -pygments.lexers.graphics.GnuplotLexer -pygments.lexers.graphics.PovrayLexer -pygments.lexers.hexdump.HexdumpLexer -pygments.lexers.haskell.HaskellLexer -pygments.lexers.haskell.IdrisLexer -pygments.lexers.haskell.AgdaLexer -pygments.lexers.haskell.CryptolLexer -pygments.lexers.haskell.KokaLexer -pygments.lexers.haxe.HaxeLexer -pygments.lexers.haxe.HxmlLexer -pygments.lexers.hdl.VerilogLexer -pygments.lexers.hdl.SystemVerilogLexer -pygments.lexers.hdl.VhdlLexer -pygments.lexers.idl.IDLLexer -pygments.lexers.inferno.LimboLexer -pygments.lexers.igor.IgorLexer -pygments.lexers.html.HtmlLexer -pygments.lexers.html.DtdLexer -pygments.lexers.html.XmlLexer -pygments.lexers.html.HamlLexer -pygments.lexers.html.ScamlLexer -pygments.lexers.html.PugLexer -pygments.lexers.installers.NSISLexer -pygments.lexers.installers.RPMSpecLexer -pygments.lexers.installers.SourcesListLexer -pygments.lexers.installers.DebianControlLexer -pygments.lexers.iolang.IoLexer -pygments.lexers.julia.JuliaLexer -pygments.lexers.int_fiction.Inform6Lexer -pygments.lexers.int_fiction.Inform7Lexer -pygments.lexers.int_fiction.Tads3Lexer -pygments.lexers.make.BaseMakefileLexer -pygments.lexers.make.CMakeLexer -pygments.lexers.javascript.JavascriptLexer -pygments.lexers.javascript.KalLexer -pygments.lexers.javascript.LiveScriptLexer -pygments.lexers.javascript.DartLexer -pygments.lexers.javascript.TypeScriptLexer -pygments.lexers.javascript.LassoLexer -pygments.lexers.javascript.ObjectiveJLexer -pygments.lexers.javascript.CoffeeScriptLexer -pygments.lexers.javascript.MaskLexer -pygments.lexers.javascript.EarlGreyLexer -pygments.lexers.javascript.JuttleLexer -pygments.lexers.jvm.JavaLexer -pygments.lexers.jvm.ScalaLexer -pygments.lexers.jvm.GosuLexer -pygments.lexers.jvm.GroovyLexer -pygments.lexers.jvm.IokeLexer -pygments.lexers.jvm.ClojureLexer -pygments.lexers.jvm.TeaLangLexer -pygments.lexers.jvm.CeylonLexer -pygments.lexers.jvm.KotlinLexer -pygments.lexers.jvm.XtendLexer -pygments.lexers.jvm.PigLexer -pygments.lexers.jvm.GoloLexer -pygments.lexers.jvm.JasminLexer -pygments.lexers.markup.BBCodeLexer -pygments.lexers.markup.MoinWikiLexer -pygments.lexers.markup.RstLexer -pygments.lexers.markup.TexLexer -pygments.lexers.markup.GroffLexer -pygments.lexers.markup.MozPreprocHashLexer -pygments.lexers.markup.MarkdownLexer -pygments.lexers.ml.SMLLexer -pygments.lexers.ml.OcamlLexer -pygments.lexers.ml.OpaLexer -pygments.lexers.modeling.ModelicaLexer -pygments.lexers.modeling.BugsLexer -pygments.lexers.modeling.JagsLexer -pygments.lexers.modeling.StanLexer -pygments.lexers.matlab.MatlabLexer -pygments.lexers.matlab.OctaveLexer -pygments.lexers.matlab.ScilabLexer -pygments.lexers.monte.MonteLexer -pygments.lexers.lisp.SchemeLexer -pygments.lexers.lisp.CommonLispLexer -pygments.lexers.lisp.HyLexer -pygments.lexers.lisp.RacketLexer -pygments.lexers.lisp.NewLispLexer -pygments.lexers.lisp.EmacsLispLexer -pygments.lexers.lisp.ShenLexer -pygments.lexers.lisp.XtlangLexer -pygments.lexers.modula2.Modula2Lexer -pygments.lexers.ncl.NCLLexer -pygments.lexers.nim.NimLexer -pygments.lexers.nit.NitLexer -pygments.lexers.nix.NixLexer -pygments.lexers.oberon.ComponentPascalLexer -pygments.lexers.ooc.OocLexer -pygments.lexers.objective.SwiftLexer -pygments.lexers.parasail.ParaSailLexer -pygments.lexers.pawn.SourcePawnLexer -pygments.lexers.pawn.PawnLexer -pygments.lexers.pascal.AdaLexer -pygments.lexers.parsers.RagelLexer -pygments.lexers.parsers.RagelEmbeddedLexer -pygments.lexers.parsers.AntlrLexer -pygments.lexers.parsers.TreetopBaseLexer -pygments.lexers.parsers.EbnfLexer -pygments.lexers.php.ZephirLexer -pygments.lexers.php.PhpLexer -pygments.lexers.perl.PerlLexer -pygments.lexers.perl.Perl6Lexer -pygments.lexers.praat.PraatLexer -pygments.lexers.prolog.PrologLexer -pygments.lexers.prolog.LogtalkLexer -pygments.lexers.qvt.QVToLexer -pygments.lexers.rdf.SparqlLexer -pygments.lexers.rdf.TurtleLexer -pygments.lexers.python.PythonLexer -pygments.lexers.python.Python3Lexer -pygments.lexers.python.PythonTracebackLexer -pygments.lexers.python.Python3TracebackLexer -pygments.lexers.python.CythonLexer -pygments.lexers.python.DgLexer -pygments.lexers.rebol.RebolLexer -pygments.lexers.rebol.RedLexer -pygments.lexers.resource.ResourceLexer -pygments.lexers.rnc.RNCCompactLexer -pygments.lexers.roboconf.RoboconfGraphLexer -pygments.lexers.roboconf.RoboconfInstancesLexer -pygments.lexers.rust.RustLexer -pygments.lexers.ruby.RubyLexer -pygments.lexers.ruby.FancyLexer -pygments.lexers.sas.SASLexer -pygments.lexers.smalltalk.SmalltalkLexer -pygments.lexers.smalltalk.NewspeakLexer -pygments.lexers.smv.NuSMVLexer -pygments.lexers.shell.BashLexer -pygments.lexers.shell.BatchLexer -pygments.lexers.shell.TcshLexer -pygments.lexers.shell.PowerShellLexer -pygments.lexers.shell.FishShellLexer -pygments.lexers.snobol.SnobolLexer -pygments.lexers.scripting.LuaLexer -pygments.lexers.scripting.ChaiscriptLexer -pygments.lexers.scripting.LSLLexer -pygments.lexers.scripting.AppleScriptLexer -pygments.lexers.scripting.RexxLexer -pygments.lexers.scripting.MOOCodeLexer -pygments.lexers.scripting.HybrisLexer -pygments.lexers.scripting.EasytrieveLexer -pygments.lexers.scripting.JclLexer -pygments.lexers.supercollider.SuperColliderLexer -pygments.lexers.stata.StataLexer -pygments.lexers.tcl.TclLexer -pygments.lexers.sql.PostgresLexer -pygments.lexers.sql.PlPgsqlLexer -pygments.lexers.sql.PsqlRegexLexer -pygments.lexers.sql.SqlLexer -pygments.lexers.sql.TransactSqlLexer -pygments.lexers.sql.MySqlLexer -pygments.lexers.sql.RqlLexer -pygments.lexers.testing.GherkinLexer -pygments.lexers.testing.TAPLexer -pygments.lexers.textedit.AwkLexer -pygments.lexers.textedit.VimLexer -pygments.lexers.textfmts.IrcLogsLexer -pygments.lexers.textfmts.GettextLexer -pygments.lexers.textfmts.HttpLexer -pygments.lexers.textfmts.TodotxtLexer -pygments.lexers.trafficscript.RtsLexer -pygments.lexers.theorem.CoqLexer -pygments.lexers.theorem.IsabelleLexer -pygments.lexers.theorem.LeanLexer -pygments.lexers.templates.SmartyLexer -pygments.lexers.templates.VelocityLexer -pygments.lexers.templates.DjangoLexer -pygments.lexers.templates.MyghtyLexer -pygments.lexers.templates.MasonLexer -pygments.lexers.templates.MakoLexer -pygments.lexers.templates.CheetahLexer -pygments.lexers.templates.GenshiTextLexer -pygments.lexers.templates.GenshiMarkupLexer -pygments.lexers.templates.JspRootLexer -pygments.lexers.templates.EvoqueLexer -pygments.lexers.templates.ColdfusionLexer -pygments.lexers.templates.ColdfusionMarkupLexer -pygments.lexers.templates.TeaTemplateRootLexer -pygments.lexers.templates.HandlebarsLexer -pygments.lexers.templates.LiquidLexer -pygments.lexers.templates.TwigLexer -pygments.lexers.templates.Angular2Lexer -pygments.lexers.urbi.UrbiscriptLexer -pygments.lexers.typoscript.TypoScriptCssDataLexer -pygments.lexers.typoscript.TypoScriptHtmlDataLexer -pygments.lexers.typoscript.TypoScriptLexer -pygments.lexers.varnish.VCLLexer -pygments.lexers.verification.BoogieLexer -pygments.lexers.verification.SilverLexer -pygments.lexers.x10.X10Lexer -pygments.lexers.whiley.WhileyLexer -pygments.lexers.xorg.XorgLexer -pygments.lexers.webmisc.DuelLexer -pygments.lexers.webmisc.XQueryLexer -pygments.lexers.webmisc.QmlLexer -pygments.lexers.webmisc.CirruLexer -pygments.lexers.webmisc.SlimLexer diff --git a/vendor/github.com/alecthomas/chroma/regexp.go b/vendor/github.com/alecthomas/chroma/regexp.go deleted file mode 100644 index 7c2fb0bb..00000000 --- a/vendor/github.com/alecthomas/chroma/regexp.go +++ /dev/null @@ -1,439 +0,0 @@ -package chroma - -import ( - "fmt" - "os" - "regexp" - "strings" - "sync" - "unicode/utf8" - - "github.com/dlclark/regexp2" -) - -// A Rule is the fundamental matching unit of the Regex lexer state machine. -type Rule struct { - Pattern string - Type Emitter - Mutator Mutator -} - -// An Emitter takes group matches and returns tokens. -type Emitter interface { - // Emit tokens for the given regex groups. - Emit(groups []string, lexer Lexer) Iterator -} - -// EmitterFunc is a function that is an Emitter. -type EmitterFunc func(groups []string, lexer Lexer) Iterator - -// Emit tokens for groups. -func (e EmitterFunc) Emit(groups []string, lexer Lexer) Iterator { return e(groups, lexer) } - -// ByGroups emits a token for each matching group in the rule's regex. -func ByGroups(emitters ...Emitter) Emitter { - return EmitterFunc(func(groups []string, lexer Lexer) Iterator { - iterators := make([]Iterator, 0, len(groups)-1) - if len(emitters) != len(groups)-1 { - iterators = append(iterators, Error.Emit(groups, lexer)) - // panic(errors.Errorf("number of groups %q does not match number of emitters %v", groups, emitters)) - } else { - for i, group := range groups[1:] { - iterators = append(iterators, emitters[i].Emit([]string{group}, lexer)) - } - } - return Concaterator(iterators...) - }) -} - -// UsingByGroup emits tokens for the matched groups in the regex using a -// "sublexer". Used when lexing code blocks where the name of a sublexer is -// contained within the block, for example on a Markdown text block or SQL -// language block. -// -// The sublexer will be retrieved using sublexerGetFunc (typically -// internal.Get), using the captured value from the matched sublexerNameGroup. -// -// If sublexerGetFunc returns a non-nil lexer for the captured sublexerNameGroup, -// then tokens for the matched codeGroup will be emitted using the retrieved -// lexer. Otherwise, if the sublexer is nil, then tokens will be emitted from -// the passed emitter. -// -// Example: -// -// var Markdown = internal.Register(MustNewLexer( -// &Config{ -// Name: "markdown", -// Aliases: []string{"md", "mkd"}, -// Filenames: []string{"*.md", "*.mkd", "*.markdown"}, -// MimeTypes: []string{"text/x-markdown"}, -// }, -// Rules{ -// "root": { -// {"^(```)(\\w+)(\\n)([\\w\\W]*?)(^```$)", -// UsingByGroup( -// internal.Get, -// 2, 4, -// String, String, String, Text, String, -// ), -// nil, -// }, -// }, -// }, -// )) -// -// See the lexers/m/markdown.go for the complete example. -// -// Note: panic's if the number emitters does not equal the number of matched -// groups in the regex. -func UsingByGroup(sublexerGetFunc func(string) Lexer, sublexerNameGroup, codeGroup int, emitters ...Emitter) Emitter { - return EmitterFunc(func(groups []string, lexer Lexer) Iterator { - // bounds check - if len(emitters) != len(groups)-1 { - panic("UsingByGroup expects number of emitters to be the same as len(groups)-1") - } - - // grab sublexer - sublexer := sublexerGetFunc(groups[sublexerNameGroup]) - - // build iterators - iterators := make([]Iterator, len(groups)-1) - for i, group := range groups[1:] { - if i == codeGroup-1 && sublexer != nil { - var err error - iterators[i], err = sublexer.Tokenise(nil, groups[codeGroup]) - if err != nil { - panic(err) - } - } else { - iterators[i] = emitters[i].Emit([]string{group}, lexer) - } - } - - return Concaterator(iterators...) - }) -} - -// Using returns an Emitter that uses a given Lexer for parsing and emitting. -func Using(lexer Lexer) Emitter { - return EmitterFunc(func(groups []string, _ Lexer) Iterator { - it, err := lexer.Tokenise(&TokeniseOptions{State: "root", Nested: true}, groups[0]) - if err != nil { - panic(err) - } - return it - }) -} - -// UsingSelf is like Using, but uses the current Lexer. -func UsingSelf(state string) Emitter { - return EmitterFunc(func(groups []string, lexer Lexer) Iterator { - it, err := lexer.Tokenise(&TokeniseOptions{State: state, Nested: true}, groups[0]) - if err != nil { - panic(err) - } - return it - }) -} - -// Words creates a regex that matches any of the given literal words. -func Words(prefix, suffix string, words ...string) string { - for i, word := range words { - words[i] = regexp.QuoteMeta(word) - } - return prefix + `(` + strings.Join(words, `|`) + `)` + suffix -} - -// Tokenise text using lexer, returning tokens as a slice. -func Tokenise(lexer Lexer, options *TokeniseOptions, text string) ([]Token, error) { - var out []Token - it, err := lexer.Tokenise(options, text) - if err != nil { - return nil, err - } - for t := it(); t != EOF; t = it() { - out = append(out, t) - } - return out, nil -} - -// Rules maps from state to a sequence of Rules. -type Rules map[string][]Rule - -// Clone returns a clone of the Rules. -func (r Rules) Clone() Rules { - out := map[string][]Rule{} - for key, rules := range r { - out[key] = make([]Rule, len(rules)) - copy(out[key], rules) - } - return out -} - -// MustNewLexer creates a new Lexer or panics. -func MustNewLexer(config *Config, rules Rules) *RegexLexer { - lexer, err := NewLexer(config, rules) - if err != nil { - panic(err) - } - return lexer -} - -// NewLexer creates a new regex-based Lexer. -// -// "rules" is a state machine transitition map. Each key is a state. Values are sets of rules -// that match input, optionally modify lexer state, and output tokens. -func NewLexer(config *Config, rules Rules) (*RegexLexer, error) { - if config == nil { - config = &Config{} - } - if _, ok := rules["root"]; !ok { - return nil, fmt.Errorf("no \"root\" state") - } - compiledRules := map[string][]*CompiledRule{} - for state, rules := range rules { - compiledRules[state] = nil - for _, rule := range rules { - flags := "" - if !config.NotMultiline { - flags += "m" - } - if config.CaseInsensitive { - flags += "i" - } - if config.DotAll { - flags += "s" - } - compiledRules[state] = append(compiledRules[state], &CompiledRule{Rule: rule, flags: flags}) - } - } - return &RegexLexer{ - config: config, - rules: compiledRules, - }, nil -} - -// Trace enables debug tracing. -func (r *RegexLexer) Trace(trace bool) *RegexLexer { - r.trace = trace - return r -} - -// A CompiledRule is a Rule with a pre-compiled regex. -// -// Note that regular expressions are lazily compiled on first use of the lexer. -type CompiledRule struct { - Rule - Regexp *regexp2.Regexp - flags string -} - -// CompiledRules is a map of rule name to sequence of compiled rules in that rule. -type CompiledRules map[string][]*CompiledRule - -// LexerState contains the state for a single lex. -type LexerState struct { - Lexer *RegexLexer - Text []rune - Pos int - Rules CompiledRules - Stack []string - State string - Rule int - // Group matches. - Groups []string - // Custum context for mutators. - MutatorContext map[interface{}]interface{} - iteratorStack []Iterator - options *TokeniseOptions -} - -// Set mutator context. -func (l *LexerState) Set(key interface{}, value interface{}) { - l.MutatorContext[key] = value -} - -// Get mutator context. -func (l *LexerState) Get(key interface{}) interface{} { - return l.MutatorContext[key] -} - -// Iterator returns the next Token from the lexer. -func (l *LexerState) Iterator() Token { // nolint: gocognit - for l.Pos < len(l.Text) && len(l.Stack) > 0 { - // Exhaust the iterator stack, if any. - for len(l.iteratorStack) > 0 { - n := len(l.iteratorStack) - 1 - t := l.iteratorStack[n]() - if t == EOF { - l.iteratorStack = l.iteratorStack[:n] - continue - } - return t - } - - l.State = l.Stack[len(l.Stack)-1] - if l.Lexer.trace { - fmt.Fprintf(os.Stderr, "%s: pos=%d, text=%q\n", l.State, l.Pos, string(l.Text[l.Pos:])) - } - selectedRule, ok := l.Rules[l.State] - if !ok { - panic("unknown state " + l.State) - } - ruleIndex, rule, groups := matchRules(l.Text, l.Pos, selectedRule) - // No match. - if groups == nil { - // From Pygments :\ - // - // If the RegexLexer encounters a newline that is flagged as an error token, the stack is - // emptied and the lexer continues scanning in the 'root' state. This can help producing - // error-tolerant highlighting for erroneous input, e.g. when a single-line string is not - // closed. - if l.Text[l.Pos] == '\n' && l.State != l.options.State { - l.Stack = []string{l.options.State} - continue - } - l.Pos++ - return Token{Error, string(l.Text[l.Pos-1 : l.Pos])} - } - l.Rule = ruleIndex - l.Groups = groups - l.Pos += utf8.RuneCountInString(groups[0]) - if rule.Mutator != nil { - if err := rule.Mutator.Mutate(l); err != nil { - panic(err) - } - } - if rule.Type != nil { - l.iteratorStack = append(l.iteratorStack, rule.Type.Emit(l.Groups, l.Lexer)) - } - } - // Exhaust the IteratorStack, if any. - // Duplicate code, but eh. - for len(l.iteratorStack) > 0 { - n := len(l.iteratorStack) - 1 - t := l.iteratorStack[n]() - if t == EOF { - l.iteratorStack = l.iteratorStack[:n] - continue - } - return t - } - - // If we get to here and we still have text, return it as an error. - if l.Pos != len(l.Text) && len(l.Stack) == 0 { - value := string(l.Text[l.Pos:]) - l.Pos = len(l.Text) - return Token{Type: Error, Value: value} - } - return EOF -} - -// RegexLexer is the default lexer implementation used in Chroma. -type RegexLexer struct { - config *Config - analyser func(text string) float32 - trace bool - - mu sync.Mutex - compiled bool - rules map[string][]*CompiledRule -} - -// SetAnalyser sets the analyser function used to perform content inspection. -func (r *RegexLexer) SetAnalyser(analyser func(text string) float32) *RegexLexer { - r.analyser = analyser - return r -} - -func (r *RegexLexer) AnalyseText(text string) float32 { // nolint - if r.analyser != nil { - return r.analyser(text) - } - return 0.0 -} - -func (r *RegexLexer) Config() *Config { // nolint - return r.config -} - -// Regex compilation is deferred until the lexer is used. This is to avoid significant init() time costs. -func (r *RegexLexer) maybeCompile() (err error) { - r.mu.Lock() - defer r.mu.Unlock() - if r.compiled { - return nil - } - for state, rules := range r.rules { - for i, rule := range rules { - if rule.Regexp == nil { - pattern := "(?:" + rule.Pattern + ")" - if rule.flags != "" { - pattern = "(?" + rule.flags + ")" + pattern - } - pattern = `\G` + pattern - rule.Regexp, err = regexp2.Compile(pattern, 0) - if err != nil { - return fmt.Errorf("failed to compile rule %s.%d: %s", state, i, err) - } - } - } - } -restart: - seen := map[LexerMutator]bool{} - for state := range r.rules { - for i := 0; i < len(r.rules[state]); i++ { - rule := r.rules[state][i] - if compile, ok := rule.Mutator.(LexerMutator); ok { - if seen[compile] { - return fmt.Errorf("saw mutator %T twice; this should not happen", compile) - } - seen[compile] = true - if err := compile.MutateLexer(r.rules, state, i); err != nil { - return err - } - // Process the rules again in case the mutator added/removed rules. - // - // This sounds bad, but shouldn't be significant in practice. - goto restart - } - } - } - r.compiled = true - return nil -} - -func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { // nolint - if err := r.maybeCompile(); err != nil { - return nil, err - } - if options == nil { - options = defaultOptions - } - if !options.Nested && r.config.EnsureNL && !strings.HasSuffix(text, "\n") { - text += "\n" - } - state := &LexerState{ - options: options, - Lexer: r, - Text: []rune(text), - Stack: []string{options.State}, - Rules: r.rules, - MutatorContext: map[interface{}]interface{}{}, - } - return state.Iterator, nil -} - -func matchRules(text []rune, pos int, rules []*CompiledRule) (int, *CompiledRule, []string) { - for i, rule := range rules { - match, err := rule.Regexp.FindRunesMatchStartingAt(text, pos) - if match != nil && err == nil && match.Index == pos { - groups := []string{} - for _, g := range match.Groups() { - groups = append(groups, g.String()) - } - return i, rule, groups - } - } - return 0, &CompiledRule{}, nil -} diff --git a/vendor/github.com/alecthomas/chroma/remap.go b/vendor/github.com/alecthomas/chroma/remap.go deleted file mode 100644 index cfb5c381..00000000 --- a/vendor/github.com/alecthomas/chroma/remap.go +++ /dev/null @@ -1,80 +0,0 @@ -package chroma - -type remappingLexer struct { - lexer Lexer - mapper func(Token) []Token -} - -// RemappingLexer remaps a token to a set of, potentially empty, tokens. -func RemappingLexer(lexer Lexer, mapper func(Token) []Token) Lexer { - return &remappingLexer{lexer, mapper} -} - -func (r *remappingLexer) Config() *Config { - return r.lexer.Config() -} - -func (r *remappingLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { - it, err := r.lexer.Tokenise(options, text) - if err != nil { - return nil, err - } - var buffer []Token - return func() Token { - for { - if len(buffer) > 0 { - t := buffer[0] - buffer = buffer[1:] - return t - } - t := it() - if t == EOF { - return t - } - buffer = r.mapper(t) - } - }, nil -} - -// TypeMapping defines type maps for the TypeRemappingLexer. -type TypeMapping []struct { - From, To TokenType - Words []string -} - -// TypeRemappingLexer remaps types of tokens coming from a parent Lexer. -// -// eg. Map "defvaralias" tokens of type NameVariable to NameFunction: -// -// mapping := TypeMapping{ -// {NameVariable, NameFunction, []string{"defvaralias"}, -// } -// lexer = TypeRemappingLexer(lexer, mapping) -func TypeRemappingLexer(lexer Lexer, mapping TypeMapping) Lexer { - // Lookup table for fast remapping. - lut := map[TokenType]map[string]TokenType{} - for _, rt := range mapping { - km, ok := lut[rt.From] - if !ok { - km = map[string]TokenType{} - lut[rt.From] = km - } - if len(rt.Words) == 0 { - km[""] = rt.To - } else { - for _, k := range rt.Words { - km[k] = rt.To - } - } - } - return RemappingLexer(lexer, func(t Token) []Token { - if k, ok := lut[t.Type]; ok { - if tt, ok := k[t.Value]; ok { - t.Type = tt - } else if tt, ok := k[""]; ok { - t.Type = tt - } - } - return []Token{t} - }) -} diff --git a/vendor/github.com/alecthomas/chroma/style.go b/vendor/github.com/alecthomas/chroma/style.go deleted file mode 100644 index dce9e0a7..00000000 --- a/vendor/github.com/alecthomas/chroma/style.go +++ /dev/null @@ -1,342 +0,0 @@ -package chroma - -import ( - "fmt" - "strings" -) - -// Trilean value for StyleEntry value inheritance. -type Trilean uint8 - -// Trilean states. -const ( - Pass Trilean = iota - Yes - No -) - -func (t Trilean) String() string { - switch t { - case Yes: - return "Yes" - case No: - return "No" - default: - return "Pass" - } -} - -// Prefix returns s with "no" as a prefix if Trilean is no. -func (t Trilean) Prefix(s string) string { - if t == Yes { - return s - } else if t == No { - return "no" + s - } - return "" -} - -// A StyleEntry in the Style map. -type StyleEntry struct { - // Hex colours. - Colour Colour - Background Colour - Border Colour - - Bold Trilean - Italic Trilean - Underline Trilean - NoInherit bool -} - -func (s StyleEntry) String() string { - out := []string{} - if s.Bold != Pass { - out = append(out, s.Bold.Prefix("bold")) - } - if s.Italic != Pass { - out = append(out, s.Italic.Prefix("italic")) - } - if s.Underline != Pass { - out = append(out, s.Underline.Prefix("underline")) - } - if s.NoInherit { - out = append(out, "noinherit") - } - if s.Colour.IsSet() { - out = append(out, s.Colour.String()) - } - if s.Background.IsSet() { - out = append(out, "bg:"+s.Background.String()) - } - if s.Border.IsSet() { - out = append(out, "border:"+s.Border.String()) - } - return strings.Join(out, " ") -} - -// Sub subtracts e from s where elements match. -func (s StyleEntry) Sub(e StyleEntry) StyleEntry { - out := StyleEntry{} - if e.Colour != s.Colour { - out.Colour = s.Colour - } - if e.Background != s.Background { - out.Background = s.Background - } - if e.Bold != s.Bold { - out.Bold = s.Bold - } - if e.Italic != s.Italic { - out.Italic = s.Italic - } - if e.Underline != s.Underline { - out.Underline = s.Underline - } - if e.Border != s.Border { - out.Border = s.Border - } - return out -} - -// Inherit styles from ancestors. -// -// Ancestors should be provided from oldest to newest. -func (s StyleEntry) Inherit(ancestors ...StyleEntry) StyleEntry { - out := s - for i := len(ancestors) - 1; i >= 0; i-- { - if out.NoInherit { - return out - } - ancestor := ancestors[i] - if !out.Colour.IsSet() { - out.Colour = ancestor.Colour - } - if !out.Background.IsSet() { - out.Background = ancestor.Background - } - if !out.Border.IsSet() { - out.Border = ancestor.Border - } - if out.Bold == Pass { - out.Bold = ancestor.Bold - } - if out.Italic == Pass { - out.Italic = ancestor.Italic - } - if out.Underline == Pass { - out.Underline = ancestor.Underline - } - } - return out -} - -func (s StyleEntry) IsZero() bool { - return s.Colour == 0 && s.Background == 0 && s.Border == 0 && s.Bold == Pass && s.Italic == Pass && - s.Underline == Pass && !s.NoInherit -} - -// A StyleBuilder is a mutable structure for building styles. -// -// Once built, a Style is immutable. -type StyleBuilder struct { - entries map[TokenType]string - name string - parent *Style -} - -func NewStyleBuilder(name string) *StyleBuilder { - return &StyleBuilder{name: name, entries: map[TokenType]string{}} -} - -func (s *StyleBuilder) AddAll(entries StyleEntries) *StyleBuilder { - for ttype, entry := range entries { - s.entries[ttype] = entry - } - return s -} - -func (s *StyleBuilder) Get(ttype TokenType) StyleEntry { - // This is less than ideal, but it's the price for having to check errors on each Add(). - entry, _ := ParseStyleEntry(s.entries[ttype]) - return entry.Inherit(s.parent.Get(ttype)) -} - -// Add an entry to the Style map. -// -// See http://pygments.org/docs/styles/#style-rules for details. -func (s *StyleBuilder) Add(ttype TokenType, entry string) *StyleBuilder { // nolint: gocyclo - s.entries[ttype] = entry - return s -} - -func (s *StyleBuilder) AddEntry(ttype TokenType, entry StyleEntry) *StyleBuilder { - s.entries[ttype] = entry.String() - return s -} - -func (s *StyleBuilder) Build() (*Style, error) { - style := &Style{ - Name: s.name, - entries: map[TokenType]StyleEntry{}, - parent: s.parent, - } - for ttype, descriptor := range s.entries { - entry, err := ParseStyleEntry(descriptor) - if err != nil { - return nil, fmt.Errorf("invalid entry for %s: %s", ttype, err) - } - style.entries[ttype] = entry - } - return style, nil -} - -// StyleEntries mapping TokenType to colour definition. -type StyleEntries map[TokenType]string - -// NewStyle creates a new style definition. -func NewStyle(name string, entries StyleEntries) (*Style, error) { - return NewStyleBuilder(name).AddAll(entries).Build() -} - -// MustNewStyle creates a new style or panics. -func MustNewStyle(name string, entries StyleEntries) *Style { - style, err := NewStyle(name, entries) - if err != nil { - panic(err) - } - return style -} - -// A Style definition. -// -// See http://pygments.org/docs/styles/ for details. Semantics are intended to be identical. -type Style struct { - Name string - entries map[TokenType]StyleEntry - parent *Style -} - -// Types that are styled. -func (s *Style) Types() []TokenType { - dedupe := map[TokenType]bool{} - for tt := range s.entries { - dedupe[tt] = true - } - if s.parent != nil { - for _, tt := range s.parent.Types() { - dedupe[tt] = true - } - } - out := make([]TokenType, 0, len(dedupe)) - for tt := range dedupe { - out = append(out, tt) - } - return out -} - -// Builder creates a mutable builder from this Style. -// -// The builder can then be safely modified. This is a cheap operation. -func (s *Style) Builder() *StyleBuilder { - return &StyleBuilder{ - name: s.Name, - entries: map[TokenType]string{}, - parent: s, - } -} - -// Has checks if an exact style entry match exists for a token type. -// -// This is distinct from Get() which will merge parent tokens. -func (s *Style) Has(ttype TokenType) bool { - return !s.get(ttype).IsZero() || s.synthesisable(ttype) -} - -// Get a style entry. Will try sub-category or category if an exact match is not found, and -// finally return the Background. -func (s *Style) Get(ttype TokenType) StyleEntry { - return s.get(ttype).Inherit( - s.get(Background), - s.get(Text), - s.get(ttype.Category()), - s.get(ttype.SubCategory())) -} - -func (s *Style) get(ttype TokenType) StyleEntry { - out := s.entries[ttype] - if out.IsZero() && s.synthesisable(ttype) { - out = s.synthesise(ttype) - } - if out.IsZero() && s.parent != nil { - return s.parent.get(ttype) - } - return out -} - -func (s *Style) synthesise(ttype TokenType) StyleEntry { - bg := s.get(Background) - text := StyleEntry{Colour: bg.Colour} - text.Colour = text.Colour.BrightenOrDarken(0.5) - - switch ttype { - // If we don't have a line highlight colour, make one that is 10% brighter/darker than the background. - case LineHighlight: - return StyleEntry{Background: bg.Background.BrightenOrDarken(0.1)} - - // If we don't have line numbers, use the text colour but 20% brighter/darker - case LineNumbers, LineNumbersTable: - return text - } - return StyleEntry{} -} - -func (s *Style) synthesisable(ttype TokenType) bool { - return ttype == LineHighlight || ttype == LineNumbers || ttype == LineNumbersTable -} - -// ParseStyleEntry parses a Pygments style entry. -func ParseStyleEntry(entry string) (StyleEntry, error) { // nolint: gocyclo - out := StyleEntry{} - parts := strings.Fields(entry) - for _, part := range parts { - switch { - case part == "italic": - out.Italic = Yes - case part == "noitalic": - out.Italic = No - case part == "bold": - out.Bold = Yes - case part == "nobold": - out.Bold = No - case part == "underline": - out.Underline = Yes - case part == "nounderline": - out.Underline = No - case part == "inherit": - out.NoInherit = false - case part == "noinherit": - out.NoInherit = true - case part == "bg:": - out.Background = 0 - case strings.HasPrefix(part, "bg:#"): - out.Background = ParseColour(part[3:]) - if !out.Background.IsSet() { - return StyleEntry{}, fmt.Errorf("invalid background colour %q", part) - } - case strings.HasPrefix(part, "border:#"): - out.Border = ParseColour(part[7:]) - if !out.Border.IsSet() { - return StyleEntry{}, fmt.Errorf("invalid border colour %q", part) - } - case strings.HasPrefix(part, "#"): - out.Colour = ParseColour(part) - if !out.Colour.IsSet() { - return StyleEntry{}, fmt.Errorf("invalid colour %q", part) - } - default: - return StyleEntry{}, fmt.Errorf("unknown style element %q", part) - } - } - return out, nil -} diff --git a/vendor/github.com/alecthomas/chroma/styles/abap.go b/vendor/github.com/alecthomas/chroma/styles/abap.go deleted file mode 100644 index b6d07fb2..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/abap.go +++ /dev/null @@ -1,18 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Abap style. -var Abap = Register(chroma.MustNewStyle("abap", chroma.StyleEntries{ - chroma.Comment: "italic #888", - chroma.CommentSpecial: "#888", - chroma.Keyword: "#00f", - chroma.OperatorWord: "#00f", - chroma.Name: "#000", - chroma.LiteralNumber: "#3af", - chroma.LiteralString: "#5a2", - chroma.Error: "#F00", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/algol.go b/vendor/github.com/alecthomas/chroma/styles/algol.go deleted file mode 100644 index 1e8a7b44..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/algol.go +++ /dev/null @@ -1,25 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Algol style. -var Algol = Register(chroma.MustNewStyle("algol", chroma.StyleEntries{ - chroma.Comment: "italic #888", - chroma.CommentPreproc: "bold noitalic #888", - chroma.CommentSpecial: "bold noitalic #888", - chroma.Keyword: "underline bold", - chroma.KeywordDeclaration: "italic", - chroma.NameBuiltin: "bold italic", - chroma.NameBuiltinPseudo: "bold italic", - chroma.NameNamespace: "bold italic #666", - chroma.NameClass: "bold italic #666", - chroma.NameFunction: "bold italic #666", - chroma.NameVariable: "bold italic #666", - chroma.NameConstant: "bold italic #666", - chroma.OperatorWord: "bold", - chroma.LiteralString: "italic #666", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/algol_nu.go b/vendor/github.com/alecthomas/chroma/styles/algol_nu.go deleted file mode 100644 index f8c6f177..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/algol_nu.go +++ /dev/null @@ -1,25 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// AlgolNu style. -var AlgolNu = Register(chroma.MustNewStyle("algol_nu", chroma.StyleEntries{ - chroma.Comment: "italic #888", - chroma.CommentPreproc: "bold noitalic #888", - chroma.CommentSpecial: "bold noitalic #888", - chroma.Keyword: "bold", - chroma.KeywordDeclaration: "italic", - chroma.NameBuiltin: "bold italic", - chroma.NameBuiltinPseudo: "bold italic", - chroma.NameNamespace: "bold italic #666", - chroma.NameClass: "bold italic #666", - chroma.NameFunction: "bold italic #666", - chroma.NameVariable: "bold italic #666", - chroma.NameConstant: "bold italic #666", - chroma.OperatorWord: "bold", - chroma.LiteralString: "italic #666", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/api.go b/vendor/github.com/alecthomas/chroma/styles/api.go deleted file mode 100644 index f3ce6739..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/api.go +++ /dev/null @@ -1,37 +0,0 @@ -package styles - -import ( - "sort" - - "github.com/alecthomas/chroma" -) - -// Registry of Styles. -var Registry = map[string]*chroma.Style{} - -// Fallback style. Reassign to change the default fallback style. -var Fallback = SwapOff - -// Register a chroma.Style. -func Register(style *chroma.Style) *chroma.Style { - Registry[style.Name] = style - return style -} - -// Names of all available styles. -func Names() []string { - out := []string{} - for name := range Registry { - out = append(out, name) - } - sort.Strings(out) - return out -} - -// Get named style, or Fallback. -func Get(name string) *chroma.Style { - if style, ok := Registry[name]; ok { - return style - } - return Fallback -} diff --git a/vendor/github.com/alecthomas/chroma/styles/arduino.go b/vendor/github.com/alecthomas/chroma/styles/arduino.go deleted file mode 100644 index 9e48fb4a..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/arduino.go +++ /dev/null @@ -1,25 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Arduino style. -var Arduino = Register(chroma.MustNewStyle("arduino", chroma.StyleEntries{ - chroma.Error: "#a61717", - chroma.Comment: "#95a5a6", - chroma.CommentPreproc: "#728E00", - chroma.Keyword: "#728E00", - chroma.KeywordConstant: "#00979D", - chroma.KeywordPseudo: "#00979D", - chroma.KeywordReserved: "#00979D", - chroma.KeywordType: "#00979D", - chroma.Operator: "#728E00", - chroma.Name: "#434f54", - chroma.NameBuiltin: "#728E00", - chroma.NameFunction: "#D35400", - chroma.NameOther: "#728E00", - chroma.LiteralNumber: "#8A7B52", - chroma.LiteralString: "#7F8C8D", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/autumn.go b/vendor/github.com/alecthomas/chroma/styles/autumn.go deleted file mode 100644 index 3966372b..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/autumn.go +++ /dev/null @@ -1,43 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Autumn style. -var Autumn = Register(chroma.MustNewStyle("autumn", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #aaaaaa", - chroma.CommentPreproc: "noitalic #4c8317", - chroma.CommentSpecial: "italic #0000aa", - chroma.Keyword: "#0000aa", - chroma.KeywordType: "#00aaaa", - chroma.OperatorWord: "#0000aa", - chroma.NameBuiltin: "#00aaaa", - chroma.NameFunction: "#00aa00", - chroma.NameClass: "underline #00aa00", - chroma.NameNamespace: "underline #00aaaa", - chroma.NameVariable: "#aa0000", - chroma.NameConstant: "#aa0000", - chroma.NameEntity: "bold #800", - chroma.NameAttribute: "#1e90ff", - chroma.NameTag: "bold #1e90ff", - chroma.NameDecorator: "#888888", - chroma.LiteralString: "#aa5500", - chroma.LiteralStringSymbol: "#0000aa", - chroma.LiteralStringRegex: "#009999", - chroma.LiteralNumber: "#009999", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#aa0000", - chroma.GenericInserted: "#00aa00", - chroma.GenericError: "#aa0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#555555", - chroma.GenericOutput: "#888888", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.Error: "#F00 bg:#FAA", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/borland.go b/vendor/github.com/alecthomas/chroma/styles/borland.go deleted file mode 100644 index 9c0fff6f..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/borland.go +++ /dev/null @@ -1,33 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Borland style. -var Borland = Register(chroma.MustNewStyle("borland", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #008800", - chroma.CommentPreproc: "noitalic #008080", - chroma.CommentSpecial: "noitalic bold", - chroma.LiteralString: "#0000FF", - chroma.LiteralStringChar: "#800080", - chroma.LiteralNumber: "#0000FF", - chroma.Keyword: "bold #000080", - chroma.OperatorWord: "bold", - chroma.NameTag: "bold #000080", - chroma.NameAttribute: "#FF0000", - chroma.GenericHeading: "#999999", - chroma.GenericSubheading: "#aaaaaa", - chroma.GenericDeleted: "bg:#ffdddd #000000", - chroma.GenericInserted: "bg:#ddffdd #000000", - chroma.GenericError: "#aa0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#555555", - chroma.GenericOutput: "#888888", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#e3d2d2 #a61717", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/bw.go b/vendor/github.com/alecthomas/chroma/styles/bw.go deleted file mode 100644 index 3e800d5a..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/bw.go +++ /dev/null @@ -1,30 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// BlackWhite style. -var BlackWhite = Register(chroma.MustNewStyle("bw", chroma.StyleEntries{ - chroma.Comment: "italic", - chroma.CommentPreproc: "noitalic", - chroma.Keyword: "bold", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "nobold", - chroma.OperatorWord: "bold", - chroma.NameClass: "bold", - chroma.NameNamespace: "bold", - chroma.NameException: "bold", - chroma.NameEntity: "bold", - chroma.NameTag: "bold", - chroma.LiteralString: "italic", - chroma.LiteralStringInterpol: "bold", - chroma.LiteralStringEscape: "bold", - chroma.GenericHeading: "bold", - chroma.GenericSubheading: "bold", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/colorful.go b/vendor/github.com/alecthomas/chroma/styles/colorful.go deleted file mode 100644 index dc77c5bf..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/colorful.go +++ /dev/null @@ -1,59 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Colorful style. -var Colorful = Register(chroma.MustNewStyle("colorful", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "#888", - chroma.CommentPreproc: "#579", - chroma.CommentSpecial: "bold #cc0000", - chroma.Keyword: "bold #080", - chroma.KeywordPseudo: "#038", - chroma.KeywordType: "#339", - chroma.Operator: "#333", - chroma.OperatorWord: "bold #000", - chroma.NameBuiltin: "#007020", - chroma.NameFunction: "bold #06B", - chroma.NameClass: "bold #B06", - chroma.NameNamespace: "bold #0e84b5", - chroma.NameException: "bold #F00", - chroma.NameVariable: "#963", - chroma.NameVariableInstance: "#33B", - chroma.NameVariableClass: "#369", - chroma.NameVariableGlobal: "bold #d70", - chroma.NameConstant: "bold #036", - chroma.NameLabel: "bold #970", - chroma.NameEntity: "bold #800", - chroma.NameAttribute: "#00C", - chroma.NameTag: "#070", - chroma.NameDecorator: "bold #555", - chroma.LiteralString: "bg:#fff0f0", - chroma.LiteralStringChar: "#04D bg:", - chroma.LiteralStringDoc: "#D42 bg:", - chroma.LiteralStringInterpol: "bg:#eee", - chroma.LiteralStringEscape: "bold #666", - chroma.LiteralStringRegex: "bg:#fff0ff #000", - chroma.LiteralStringSymbol: "#A60 bg:", - chroma.LiteralStringOther: "#D20", - chroma.LiteralNumber: "bold #60E", - chroma.LiteralNumberInteger: "bold #00D", - chroma.LiteralNumberFloat: "bold #60E", - chroma.LiteralNumberHex: "bold #058", - chroma.LiteralNumberOct: "bold #40E", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#A00000", - chroma.GenericInserted: "#00A000", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #c65d09", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - chroma.Error: "#F00 bg:#FAA", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/dracula.go b/vendor/github.com/alecthomas/chroma/styles/dracula.go deleted file mode 100644 index 46e9d5b5..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/dracula.go +++ /dev/null @@ -1,81 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Dracula Style -var Dracula = Register(chroma.MustNewStyle("dracula", chroma.StyleEntries{ - chroma.Comment: "#6272a4", - chroma.CommentHashbang: "#6272a4", - chroma.CommentMultiline: "#6272a4", - chroma.CommentPreproc: "#ff79c6", - chroma.CommentSingle: "#6272a4", - chroma.CommentSpecial: "#6272a4", - chroma.Generic: "#f8f8f2", - chroma.GenericDeleted: "#8b080b", - chroma.GenericEmph: "#f8f8f2 underline", - chroma.GenericError: "#f8f8f2", - chroma.GenericHeading: "#f8f8f2 bold", - chroma.GenericInserted: "#f8f8f2 bold", - chroma.GenericOutput: "#44475a", - chroma.GenericPrompt: "#f8f8f2", - chroma.GenericStrong: "#f8f8f2", - chroma.GenericSubheading: "#f8f8f2 bold", - chroma.GenericTraceback: "#f8f8f2", - chroma.GenericUnderline: "underline", - chroma.Error: "#f8f8f2", - chroma.Keyword: "#ff79c6", - chroma.KeywordConstant: "#ff79c6", - chroma.KeywordDeclaration: "#8be9fd italic", - chroma.KeywordNamespace: "#ff79c6", - chroma.KeywordPseudo: "#ff79c6", - chroma.KeywordReserved: "#ff79c6", - chroma.KeywordType: "#8be9fd", - chroma.Literal: "#f8f8f2", - chroma.LiteralDate: "#f8f8f2", - chroma.Name: "#f8f8f2", - chroma.NameAttribute: "#50fa7b", - chroma.NameBuiltin: "#8be9fd italic", - chroma.NameBuiltinPseudo: "#f8f8f2", - chroma.NameClass: "#50fa7b", - chroma.NameConstant: "#f8f8f2", - chroma.NameDecorator: "#f8f8f2", - chroma.NameEntity: "#f8f8f2", - chroma.NameException: "#f8f8f2", - chroma.NameFunction: "#50fa7b", - chroma.NameLabel: "#8be9fd italic", - chroma.NameNamespace: "#f8f8f2", - chroma.NameOther: "#f8f8f2", - chroma.NameTag: "#ff79c6", - chroma.NameVariable: "#8be9fd italic", - chroma.NameVariableClass: "#8be9fd italic", - chroma.NameVariableGlobal: "#8be9fd italic", - chroma.NameVariableInstance: "#8be9fd italic", - chroma.LiteralNumber: "#bd93f9", - chroma.LiteralNumberBin: "#bd93f9", - chroma.LiteralNumberFloat: "#bd93f9", - chroma.LiteralNumberHex: "#bd93f9", - chroma.LiteralNumberInteger: "#bd93f9", - chroma.LiteralNumberIntegerLong: "#bd93f9", - chroma.LiteralNumberOct: "#bd93f9", - chroma.Operator: "#ff79c6", - chroma.OperatorWord: "#ff79c6", - chroma.Other: "#f8f8f2", - chroma.Punctuation: "#f8f8f2", - chroma.LiteralString: "#f1fa8c", - chroma.LiteralStringBacktick: "#f1fa8c", - chroma.LiteralStringChar: "#f1fa8c", - chroma.LiteralStringDoc: "#f1fa8c", - chroma.LiteralStringDouble: "#f1fa8c", - chroma.LiteralStringEscape: "#f1fa8c", - chroma.LiteralStringHeredoc: "#f1fa8c", - chroma.LiteralStringInterpol: "#f1fa8c", - chroma.LiteralStringOther: "#f1fa8c", - chroma.LiteralStringRegex: "#f1fa8c", - chroma.LiteralStringSingle: "#f1fa8c", - chroma.LiteralStringSymbol: "#f1fa8c", - chroma.Text: "#f8f8f2", - chroma.TextWhitespace: "#f8f8f2", - chroma.Background: " bg:#282a36", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/emacs.go b/vendor/github.com/alecthomas/chroma/styles/emacs.go deleted file mode 100644 index 4835abd7..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/emacs.go +++ /dev/null @@ -1,51 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Emacs style. -var Emacs = Register(chroma.MustNewStyle("emacs", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #008800", - chroma.CommentPreproc: "noitalic", - chroma.CommentSpecial: "noitalic bold", - chroma.Keyword: "bold #AA22FF", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "bold #00BB00", - chroma.Operator: "#666666", - chroma.OperatorWord: "bold #AA22FF", - chroma.NameBuiltin: "#AA22FF", - chroma.NameFunction: "#00A000", - chroma.NameClass: "#0000FF", - chroma.NameNamespace: "bold #0000FF", - chroma.NameException: "bold #D2413A", - chroma.NameVariable: "#B8860B", - chroma.NameConstant: "#880000", - chroma.NameLabel: "#A0A000", - chroma.NameEntity: "bold #999999", - chroma.NameAttribute: "#BB4444", - chroma.NameTag: "bold #008000", - chroma.NameDecorator: "#AA22FF", - chroma.LiteralString: "#BB4444", - chroma.LiteralStringDoc: "italic", - chroma.LiteralStringInterpol: "bold #BB6688", - chroma.LiteralStringEscape: "bold #BB6622", - chroma.LiteralStringRegex: "#BB6688", - chroma.LiteralStringSymbol: "#B8860B", - chroma.LiteralStringOther: "#008000", - chroma.LiteralNumber: "#666666", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#A00000", - chroma.GenericInserted: "#00A000", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #000080", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#f8f8f8", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/friendly.go b/vendor/github.com/alecthomas/chroma/styles/friendly.go deleted file mode 100644 index ad02341d..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/friendly.go +++ /dev/null @@ -1,51 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Friendly style. -var Friendly = Register(chroma.MustNewStyle("friendly", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #60a0b0", - chroma.CommentPreproc: "noitalic #007020", - chroma.CommentSpecial: "noitalic bg:#fff0f0", - chroma.Keyword: "bold #007020", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "nobold #902000", - chroma.Operator: "#666666", - chroma.OperatorWord: "bold #007020", - chroma.NameBuiltin: "#007020", - chroma.NameFunction: "#06287e", - chroma.NameClass: "bold #0e84b5", - chroma.NameNamespace: "bold #0e84b5", - chroma.NameException: "#007020", - chroma.NameVariable: "#bb60d5", - chroma.NameConstant: "#60add5", - chroma.NameLabel: "bold #002070", - chroma.NameEntity: "bold #d55537", - chroma.NameAttribute: "#4070a0", - chroma.NameTag: "bold #062873", - chroma.NameDecorator: "bold #555555", - chroma.LiteralString: "#4070a0", - chroma.LiteralStringDoc: "italic", - chroma.LiteralStringInterpol: "italic #70a0d0", - chroma.LiteralStringEscape: "bold #4070a0", - chroma.LiteralStringRegex: "#235388", - chroma.LiteralStringSymbol: "#517918", - chroma.LiteralStringOther: "#c65d09", - chroma.LiteralNumber: "#40a070", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#A00000", - chroma.GenericInserted: "#00A000", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #c65d09", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#f0f0f0", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/fruity.go b/vendor/github.com/alecthomas/chroma/styles/fruity.go deleted file mode 100644 index c2577fa2..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/fruity.go +++ /dev/null @@ -1,26 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Fruity style. -var Fruity = Register(chroma.MustNewStyle("fruity", chroma.StyleEntries{ - chroma.TextWhitespace: "#888888", - chroma.Background: "#ffffff bg:#111111", - chroma.GenericOutput: "#444444 bg:#222222", - chroma.Keyword: "#fb660a bold", - chroma.KeywordPseudo: "nobold", - chroma.LiteralNumber: "#0086f7 bold", - chroma.NameTag: "#fb660a bold", - chroma.NameVariable: "#fb660a", - chroma.Comment: "#008800 bg:#0f140f italic", - chroma.NameAttribute: "#ff0086 bold", - chroma.LiteralString: "#0086d2", - chroma.NameFunction: "#ff0086 bold", - chroma.GenericHeading: "#ffffff bold", - chroma.KeywordType: "#cdcaa9 bold", - chroma.GenericSubheading: "#ffffff bold", - chroma.NameConstant: "#0086d2", - chroma.CommentPreproc: "#ff0007 bold", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/github.go b/vendor/github.com/alecthomas/chroma/styles/github.go deleted file mode 100644 index 7ef2481c..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/github.go +++ /dev/null @@ -1,51 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// GitHub style. -var GitHub = Register(chroma.MustNewStyle("github", chroma.StyleEntries{ - chroma.CommentMultiline: "italic #999988", - chroma.CommentPreproc: "bold #999999", - chroma.CommentSingle: "italic #999988", - chroma.CommentSpecial: "bold italic #999999", - chroma.Comment: "italic #999988", - chroma.Error: "bg:#e3d2d2 #a61717", - chroma.GenericDeleted: "bg:#ffdddd #000000", - chroma.GenericEmph: "italic #000000", - chroma.GenericError: "#aa0000", - chroma.GenericHeading: "#999999", - chroma.GenericInserted: "bg:#ddffdd #000000", - chroma.GenericOutput: "#888888", - chroma.GenericPrompt: "#555555", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "#aaaaaa", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.KeywordType: "bold #445588", - chroma.Keyword: "bold #000000", - chroma.LiteralNumber: "#009999", - chroma.LiteralStringRegex: "#009926", - chroma.LiteralStringSymbol: "#990073", - chroma.LiteralString: "#d14", - chroma.NameAttribute: "#008080", - chroma.NameBuiltinPseudo: "#999999", - chroma.NameBuiltin: "#0086B3", - chroma.NameClass: "bold #445588", - chroma.NameConstant: "#008080", - chroma.NameDecorator: "bold #3c5d5d", - chroma.NameEntity: "#800080", - chroma.NameException: "bold #990000", - chroma.NameFunction: "bold #990000", - chroma.NameLabel: "bold #990000", - chroma.NameNamespace: "#555555", - chroma.NameTag: "#000080", - chroma.NameVariableClass: "#008080", - chroma.NameVariableGlobal: "#008080", - chroma.NameVariableInstance: "#008080", - chroma.NameVariable: "#008080", - chroma.Operator: "bold #000000", - chroma.TextWhitespace: "#bbbbbb", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/igor.go b/vendor/github.com/alecthomas/chroma/styles/igor.go deleted file mode 100644 index 6a6d4cd0..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/igor.go +++ /dev/null @@ -1,16 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Igor style. -var Igor = Register(chroma.MustNewStyle("igor", chroma.StyleEntries{ - chroma.Comment: "italic #FF0000", - chroma.Keyword: "#0000FF", - chroma.NameFunction: "#C34E00", - chroma.NameDecorator: "#CC00A3", - chroma.NameClass: "#007575", - chroma.LiteralString: "#009C00", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/lovelace.go b/vendor/github.com/alecthomas/chroma/styles/lovelace.go deleted file mode 100644 index 074cc089..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/lovelace.go +++ /dev/null @@ -1,60 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Lovelace style. -var Lovelace = Register(chroma.MustNewStyle("lovelace", chroma.StyleEntries{ - chroma.TextWhitespace: "#a89028", - chroma.Comment: "italic #888888", - chroma.CommentHashbang: "#287088", - chroma.CommentMultiline: "#888888", - chroma.CommentPreproc: "noitalic #289870", - chroma.Keyword: "#2838b0", - chroma.KeywordConstant: "italic #444444", - chroma.KeywordDeclaration: "italic", - chroma.KeywordType: "italic", - chroma.Operator: "#666666", - chroma.OperatorWord: "#a848a8", - chroma.Punctuation: "#888888", - chroma.NameAttribute: "#388038", - chroma.NameBuiltin: "#388038", - chroma.NameBuiltinPseudo: "italic", - chroma.NameClass: "#287088", - chroma.NameConstant: "#b85820", - chroma.NameDecorator: "#287088", - chroma.NameEntity: "#709030", - chroma.NameException: "#908828", - chroma.NameFunction: "#785840", - chroma.NameFunctionMagic: "#b85820", - chroma.NameLabel: "#289870", - chroma.NameNamespace: "#289870", - chroma.NameTag: "#2838b0", - chroma.NameVariable: "#b04040", - chroma.NameVariableGlobal: "#908828", - chroma.NameVariableMagic: "#b85820", - chroma.LiteralString: "#b83838", - chroma.LiteralStringAffix: "#444444", - chroma.LiteralStringChar: "#a848a8", - chroma.LiteralStringDelimiter: "#b85820", - chroma.LiteralStringDoc: "italic #b85820", - chroma.LiteralStringEscape: "#709030", - chroma.LiteralStringInterpol: "underline", - chroma.LiteralStringOther: "#a848a8", - chroma.LiteralStringRegex: "#a848a8", - chroma.LiteralNumber: "#444444", - chroma.GenericDeleted: "#c02828", - chroma.GenericEmph: "italic", - chroma.GenericError: "#c02828", - chroma.GenericHeading: "#666666", - chroma.GenericSubheading: "#444444", - chroma.GenericInserted: "#388038", - chroma.GenericOutput: "#666666", - chroma.GenericPrompt: "#444444", - chroma.GenericStrong: "bold", - chroma.GenericTraceback: "#2838b0", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#a848a8", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/manni.go b/vendor/github.com/alecthomas/chroma/styles/manni.go deleted file mode 100644 index 9942e7d0..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/manni.go +++ /dev/null @@ -1,51 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Manni style. -var Manni = Register(chroma.MustNewStyle("manni", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #0099FF", - chroma.CommentPreproc: "noitalic #009999", - chroma.CommentSpecial: "bold", - chroma.Keyword: "bold #006699", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "#007788", - chroma.Operator: "#555555", - chroma.OperatorWord: "bold #000000", - chroma.NameBuiltin: "#336666", - chroma.NameFunction: "#CC00FF", - chroma.NameClass: "bold #00AA88", - chroma.NameNamespace: "bold #00CCFF", - chroma.NameException: "bold #CC0000", - chroma.NameVariable: "#003333", - chroma.NameConstant: "#336600", - chroma.NameLabel: "#9999FF", - chroma.NameEntity: "bold #999999", - chroma.NameAttribute: "#330099", - chroma.NameTag: "bold #330099", - chroma.NameDecorator: "#9999FF", - chroma.LiteralString: "#CC3300", - chroma.LiteralStringDoc: "italic", - chroma.LiteralStringInterpol: "#AA0000", - chroma.LiteralStringEscape: "bold #CC3300", - chroma.LiteralStringRegex: "#33AAAA", - chroma.LiteralStringSymbol: "#FFCC33", - chroma.LiteralStringOther: "#CC3300", - chroma.LiteralNumber: "#FF6600", - chroma.GenericHeading: "bold #003300", - chroma.GenericSubheading: "bold #003300", - chroma.GenericDeleted: "border:#CC0000 bg:#FFCCCC", - chroma.GenericInserted: "border:#00CC00 bg:#CCFFCC", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #000099", - chroma.GenericOutput: "#AAAAAA", - chroma.GenericTraceback: "#99CC66", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#FFAAAA #AA0000", - chroma.Background: " bg:#f0f3f3", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/monokai.go b/vendor/github.com/alecthomas/chroma/styles/monokai.go deleted file mode 100644 index 2586795a..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/monokai.go +++ /dev/null @@ -1,36 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Monokai style. -var Monokai = Register(chroma.MustNewStyle("monokai", chroma.StyleEntries{ - chroma.Text: "#f8f8f2", - chroma.Error: "#960050 bg:#1e0010", - chroma.Comment: "#75715e", - chroma.Keyword: "#66d9ef", - chroma.KeywordNamespace: "#f92672", - chroma.Operator: "#f92672", - chroma.Punctuation: "#f8f8f2", - chroma.Name: "#f8f8f2", - chroma.NameAttribute: "#a6e22e", - chroma.NameClass: "#a6e22e", - chroma.NameConstant: "#66d9ef", - chroma.NameDecorator: "#a6e22e", - chroma.NameException: "#a6e22e", - chroma.NameFunction: "#a6e22e", - chroma.NameOther: "#a6e22e", - chroma.NameTag: "#f92672", - chroma.LiteralNumber: "#ae81ff", - chroma.Literal: "#ae81ff", - chroma.LiteralDate: "#e6db74", - chroma.LiteralString: "#e6db74", - chroma.LiteralStringEscape: "#ae81ff", - chroma.GenericDeleted: "#f92672", - chroma.GenericEmph: "italic", - chroma.GenericInserted: "#a6e22e", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "#75715e", - chroma.Background: "bg:#272822", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/monokailight.go b/vendor/github.com/alecthomas/chroma/styles/monokailight.go deleted file mode 100644 index 61818a68..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/monokailight.go +++ /dev/null @@ -1,33 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// MonokaiLight style. -var MonokaiLight = Register(chroma.MustNewStyle("monokailight", chroma.StyleEntries{ - chroma.Text: "#272822", - chroma.Error: "#960050 bg:#1e0010", - chroma.Comment: "#75715e", - chroma.Keyword: "#00a8c8", - chroma.KeywordNamespace: "#f92672", - chroma.Operator: "#f92672", - chroma.Punctuation: "#111111", - chroma.Name: "#111111", - chroma.NameAttribute: "#75af00", - chroma.NameClass: "#75af00", - chroma.NameConstant: "#00a8c8", - chroma.NameDecorator: "#75af00", - chroma.NameException: "#75af00", - chroma.NameFunction: "#75af00", - chroma.NameOther: "#75af00", - chroma.NameTag: "#f92672", - chroma.LiteralNumber: "#ae81ff", - chroma.Literal: "#ae81ff", - chroma.LiteralDate: "#d88200", - chroma.LiteralString: "#d88200", - chroma.LiteralStringEscape: "#8045FF", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.Background: " bg:#fafafa", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/murphy.go b/vendor/github.com/alecthomas/chroma/styles/murphy.go deleted file mode 100644 index 90e83c76..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/murphy.go +++ /dev/null @@ -1,59 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Murphy style. -var Murphy = Register(chroma.MustNewStyle("murphy", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "#666 italic", - chroma.CommentPreproc: "#579 noitalic", - chroma.CommentSpecial: "#c00 bold", - chroma.Keyword: "bold #289", - chroma.KeywordPseudo: "#08f", - chroma.KeywordType: "#66f", - chroma.Operator: "#333", - chroma.OperatorWord: "bold #000", - chroma.NameBuiltin: "#072", - chroma.NameFunction: "bold #5ed", - chroma.NameClass: "bold #e9e", - chroma.NameNamespace: "bold #0e84b5", - chroma.NameException: "bold #F00", - chroma.NameVariable: "#036", - chroma.NameVariableInstance: "#aaf", - chroma.NameVariableClass: "#ccf", - chroma.NameVariableGlobal: "#f84", - chroma.NameConstant: "bold #5ed", - chroma.NameLabel: "bold #970", - chroma.NameEntity: "#800", - chroma.NameAttribute: "#007", - chroma.NameTag: "#070", - chroma.NameDecorator: "bold #555", - chroma.LiteralString: "bg:#e0e0ff", - chroma.LiteralStringChar: "#88F bg:", - chroma.LiteralStringDoc: "#D42 bg:", - chroma.LiteralStringInterpol: "bg:#eee", - chroma.LiteralStringEscape: "bold #666", - chroma.LiteralStringRegex: "bg:#e0e0ff #000", - chroma.LiteralStringSymbol: "#fc8 bg:", - chroma.LiteralStringOther: "#f88", - chroma.LiteralNumber: "bold #60E", - chroma.LiteralNumberInteger: "bold #66f", - chroma.LiteralNumberFloat: "bold #60E", - chroma.LiteralNumberHex: "bold #058", - chroma.LiteralNumberOct: "bold #40E", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#A00000", - chroma.GenericInserted: "#00A000", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #c65d09", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - chroma.Error: "#F00 bg:#FAA", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/native.go b/vendor/github.com/alecthomas/chroma/styles/native.go deleted file mode 100644 index 9fae09ac..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/native.go +++ /dev/null @@ -1,42 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Native style. -var Native = Register(chroma.MustNewStyle("native", chroma.StyleEntries{ - chroma.Background: "#d0d0d0 bg:#202020", - chroma.TextWhitespace: "#666666", - chroma.Comment: "italic #999999", - chroma.CommentPreproc: "noitalic bold #cd2828", - chroma.CommentSpecial: "noitalic bold #e50808 bg:#520000", - chroma.Keyword: "bold #6ab825", - chroma.KeywordPseudo: "nobold", - chroma.OperatorWord: "bold #6ab825", - chroma.LiteralString: "#ed9d13", - chroma.LiteralStringOther: "#ffa500", - chroma.LiteralNumber: "#3677a9", - chroma.NameBuiltin: "#24909d", - chroma.NameVariable: "#40ffff", - chroma.NameConstant: "#40ffff", - chroma.NameClass: "underline #447fcf", - chroma.NameFunction: "#447fcf", - chroma.NameNamespace: "underline #447fcf", - chroma.NameException: "#bbbbbb", - chroma.NameTag: "bold #6ab825", - chroma.NameAttribute: "#bbbbbb", - chroma.NameDecorator: "#ffa500", - chroma.GenericHeading: "bold #ffffff", - chroma.GenericSubheading: "underline #ffffff", - chroma.GenericDeleted: "#d22323", - chroma.GenericInserted: "#589819", - chroma.GenericError: "#d22323", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#aaaaaa", - chroma.GenericOutput: "#cccccc", - chroma.GenericTraceback: "#d22323", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#e3d2d2 #a61717", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/paraiso-dark.go b/vendor/github.com/alecthomas/chroma/styles/paraiso-dark.go deleted file mode 100644 index c8cf4731..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/paraiso-dark.go +++ /dev/null @@ -1,44 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// ParaisoDark style. -var ParaisoDark = Register(chroma.MustNewStyle("paraiso-dark", chroma.StyleEntries{ - chroma.Text: "#e7e9db", - chroma.Error: "#ef6155", - chroma.Comment: "#776e71", - chroma.Keyword: "#815ba4", - chroma.KeywordNamespace: "#5bc4bf", - chroma.KeywordType: "#fec418", - chroma.Operator: "#5bc4bf", - chroma.Punctuation: "#e7e9db", - chroma.Name: "#e7e9db", - chroma.NameAttribute: "#06b6ef", - chroma.NameClass: "#fec418", - chroma.NameConstant: "#ef6155", - chroma.NameDecorator: "#5bc4bf", - chroma.NameException: "#ef6155", - chroma.NameFunction: "#06b6ef", - chroma.NameNamespace: "#fec418", - chroma.NameOther: "#06b6ef", - chroma.NameTag: "#5bc4bf", - chroma.NameVariable: "#ef6155", - chroma.LiteralNumber: "#f99b15", - chroma.Literal: "#f99b15", - chroma.LiteralDate: "#48b685", - chroma.LiteralString: "#48b685", - chroma.LiteralStringChar: "#e7e9db", - chroma.LiteralStringDoc: "#776e71", - chroma.LiteralStringEscape: "#f99b15", - chroma.LiteralStringInterpol: "#f99b15", - chroma.GenericDeleted: "#ef6155", - chroma.GenericEmph: "italic", - chroma.GenericHeading: "bold #e7e9db", - chroma.GenericInserted: "#48b685", - chroma.GenericPrompt: "bold #776e71", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "bold #5bc4bf", - chroma.Background: "bg:#2f1e2e", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/paraiso-light.go b/vendor/github.com/alecthomas/chroma/styles/paraiso-light.go deleted file mode 100644 index b514dfa1..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/paraiso-light.go +++ /dev/null @@ -1,44 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// ParaisoLight style. -var ParaisoLight = Register(chroma.MustNewStyle("paraiso-light", chroma.StyleEntries{ - chroma.Text: "#2f1e2e", - chroma.Error: "#ef6155", - chroma.Comment: "#8d8687", - chroma.Keyword: "#815ba4", - chroma.KeywordNamespace: "#5bc4bf", - chroma.KeywordType: "#fec418", - chroma.Operator: "#5bc4bf", - chroma.Punctuation: "#2f1e2e", - chroma.Name: "#2f1e2e", - chroma.NameAttribute: "#06b6ef", - chroma.NameClass: "#fec418", - chroma.NameConstant: "#ef6155", - chroma.NameDecorator: "#5bc4bf", - chroma.NameException: "#ef6155", - chroma.NameFunction: "#06b6ef", - chroma.NameNamespace: "#fec418", - chroma.NameOther: "#06b6ef", - chroma.NameTag: "#5bc4bf", - chroma.NameVariable: "#ef6155", - chroma.LiteralNumber: "#f99b15", - chroma.Literal: "#f99b15", - chroma.LiteralDate: "#48b685", - chroma.LiteralString: "#48b685", - chroma.LiteralStringChar: "#2f1e2e", - chroma.LiteralStringDoc: "#8d8687", - chroma.LiteralStringEscape: "#f99b15", - chroma.LiteralStringInterpol: "#f99b15", - chroma.GenericDeleted: "#ef6155", - chroma.GenericEmph: "italic", - chroma.GenericHeading: "bold #2f1e2e", - chroma.GenericInserted: "#48b685", - chroma.GenericPrompt: "bold #8d8687", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "bold #5bc4bf", - chroma.Background: "bg:#e7e9db", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/pastie.go b/vendor/github.com/alecthomas/chroma/styles/pastie.go deleted file mode 100644 index 9a685443..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/pastie.go +++ /dev/null @@ -1,52 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Pastie style. -var Pastie = Register(chroma.MustNewStyle("pastie", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "#888888", - chroma.CommentPreproc: "bold #cc0000", - chroma.CommentSpecial: "bg:#fff0f0 bold #cc0000", - chroma.LiteralString: "bg:#fff0f0 #dd2200", - chroma.LiteralStringRegex: "bg:#fff0ff #008800", - chroma.LiteralStringOther: "bg:#f0fff0 #22bb22", - chroma.LiteralStringSymbol: "#aa6600", - chroma.LiteralStringInterpol: "#3333bb", - chroma.LiteralStringEscape: "#0044dd", - chroma.OperatorWord: "#008800", - chroma.Keyword: "bold #008800", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "#888888", - chroma.NameClass: "bold #bb0066", - chroma.NameException: "bold #bb0066", - chroma.NameFunction: "bold #0066bb", - chroma.NameProperty: "bold #336699", - chroma.NameNamespace: "bold #bb0066", - chroma.NameBuiltin: "#003388", - chroma.NameVariable: "#336699", - chroma.NameVariableClass: "#336699", - chroma.NameVariableInstance: "#3333bb", - chroma.NameVariableGlobal: "#dd7700", - chroma.NameConstant: "bold #003366", - chroma.NameTag: "bold #bb0066", - chroma.NameAttribute: "#336699", - chroma.NameDecorator: "#555555", - chroma.NameLabel: "italic #336699", - chroma.LiteralNumber: "bold #0000DD", - chroma.GenericHeading: "#333", - chroma.GenericSubheading: "#666", - chroma.GenericDeleted: "bg:#ffdddd #000000", - chroma.GenericInserted: "bg:#ddffdd #000000", - chroma.GenericError: "#aa0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#555555", - chroma.GenericOutput: "#888888", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#e3d2d2 #a61717", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/perldoc.go b/vendor/github.com/alecthomas/chroma/styles/perldoc.go deleted file mode 100644 index e1372fdf..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/perldoc.go +++ /dev/null @@ -1,44 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Perldoc style. -var Perldoc = Register(chroma.MustNewStyle("perldoc", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "#228B22", - chroma.CommentPreproc: "#1e889b", - chroma.CommentSpecial: "#8B008B bold", - chroma.LiteralString: "#CD5555", - chroma.LiteralStringHeredoc: "#1c7e71 italic", - chroma.LiteralStringRegex: "#1c7e71", - chroma.LiteralStringOther: "#cb6c20", - chroma.LiteralNumber: "#B452CD", - chroma.OperatorWord: "#8B008B", - chroma.Keyword: "#8B008B bold", - chroma.KeywordType: "#00688B", - chroma.NameClass: "#008b45 bold", - chroma.NameException: "#008b45 bold", - chroma.NameFunction: "#008b45", - chroma.NameNamespace: "#008b45 underline", - chroma.NameVariable: "#00688B", - chroma.NameConstant: "#00688B", - chroma.NameDecorator: "#707a7c", - chroma.NameTag: "#8B008B bold", - chroma.NameAttribute: "#658b00", - chroma.NameBuiltin: "#658b00", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#aa0000", - chroma.GenericInserted: "#00aa00", - chroma.GenericError: "#aa0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#555555", - chroma.GenericOutput: "#888888", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#e3d2d2 #a61717", - chroma.Background: " bg:#eeeedd", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/pygments.go b/vendor/github.com/alecthomas/chroma/styles/pygments.go deleted file mode 100644 index 327033b7..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/pygments.go +++ /dev/null @@ -1,55 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Pygments default theme. -var Pygments = Register(chroma.MustNewStyle("pygments", chroma.StyleEntries{ - chroma.Whitespace: "#bbbbbb", - chroma.Comment: "italic #408080", - chroma.CommentPreproc: "noitalic #BC7A00", - - chroma.Keyword: "bold #008000", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "nobold #B00040", - - chroma.Operator: "#666666", - chroma.OperatorWord: "bold #AA22FF", - - chroma.NameBuiltin: "#008000", - chroma.NameFunction: "#0000FF", - chroma.NameClass: "bold #0000FF", - chroma.NameNamespace: "bold #0000FF", - chroma.NameException: "bold #D2413A", - chroma.NameVariable: "#19177C", - chroma.NameConstant: "#880000", - chroma.NameLabel: "#A0A000", - chroma.NameEntity: "bold #999999", - chroma.NameAttribute: "#7D9029", - chroma.NameTag: "bold #008000", - chroma.NameDecorator: "#AA22FF", - - chroma.String: "#BA2121", - chroma.StringDoc: "italic", - chroma.StringInterpol: "bold #BB6688", - chroma.StringEscape: "bold #BB6622", - chroma.StringRegex: "#BB6688", - chroma.StringSymbol: "#19177C", - chroma.StringOther: "#008000", - chroma.Number: "#666666", - - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#A00000", - chroma.GenericInserted: "#00A000", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #000080", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - - chroma.Error: "border:#FF0000", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/rainbow_dash.go b/vendor/github.com/alecthomas/chroma/styles/rainbow_dash.go deleted file mode 100644 index 37d66ca2..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/rainbow_dash.go +++ /dev/null @@ -1,47 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// RainbowDash style. -var RainbowDash = Register(chroma.MustNewStyle("rainbow_dash", chroma.StyleEntries{ - chroma.Comment: "italic #0080ff", - chroma.CommentPreproc: "noitalic", - chroma.CommentSpecial: "bold", - chroma.Error: "bg:#cc0000 #ffffff", - chroma.GenericDeleted: "border:#c5060b bg:#ffcccc", - chroma.GenericEmph: "italic", - chroma.GenericError: "#ff0000", - chroma.GenericHeading: "bold #2c5dcd", - chroma.GenericInserted: "border:#00cc00 bg:#ccffcc", - chroma.GenericOutput: "#aaaaaa", - chroma.GenericPrompt: "bold #2c5dcd", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "bold #2c5dcd", - chroma.GenericTraceback: "#c5060b", - chroma.GenericUnderline: "underline", - chroma.Keyword: "bold #2c5dcd", - chroma.KeywordPseudo: "nobold", - chroma.KeywordType: "#5918bb", - chroma.NameAttribute: "italic #2c5dcd", - chroma.NameBuiltin: "bold #5918bb", - chroma.NameClass: "underline", - chroma.NameConstant: "#318495", - chroma.NameDecorator: "bold #ff8000", - chroma.NameEntity: "bold #5918bb", - chroma.NameException: "bold #5918bb", - chroma.NameFunction: "bold #ff8000", - chroma.NameTag: "bold #2c5dcd", - chroma.LiteralNumber: "bold #5918bb", - chroma.Operator: "#2c5dcd", - chroma.OperatorWord: "bold", - chroma.LiteralString: "#00cc66", - chroma.LiteralStringDoc: "italic", - chroma.LiteralStringEscape: "bold #c5060b", - chroma.LiteralStringOther: "#318495", - chroma.LiteralStringSymbol: "bold #c5060b", - chroma.Text: "#4d4d4d", - chroma.TextWhitespace: "#cbcbcb", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/rrt.go b/vendor/github.com/alecthomas/chroma/styles/rrt.go deleted file mode 100644 index 2ccf2cad..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/rrt.go +++ /dev/null @@ -1,20 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Rrt style. -var Rrt = Register(chroma.MustNewStyle("rrt", chroma.StyleEntries{ - chroma.CommentPreproc: "#e5e5e5", - chroma.Comment: "#00ff00", - chroma.KeywordType: "#ee82ee", - chroma.Keyword: "#ff0000", - chroma.LiteralNumber: "#ff6600", - chroma.LiteralStringSymbol: "#ff6600", - chroma.LiteralString: "#87ceeb", - chroma.NameFunction: "#ffff00", - chroma.NameConstant: "#7fffd4", - chroma.NameVariable: "#eedd82", - chroma.Background: "#f8f8f2 bg:#000000", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/solarized-dark.go b/vendor/github.com/alecthomas/chroma/styles/solarized-dark.go deleted file mode 100644 index 2724df24..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/solarized-dark.go +++ /dev/null @@ -1,46 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// SolarizedDark style. -var SolarizedDark = Register(chroma.MustNewStyle("solarized-dark", chroma.StyleEntries{ - chroma.Keyword: "#719e07", - chroma.KeywordConstant: "#CB4B16", - chroma.KeywordDeclaration: "#268BD2", - chroma.KeywordReserved: "#268BD2", - chroma.KeywordType: "#DC322F", - chroma.NameAttribute: "#93A1A1", - chroma.NameBuiltin: "#B58900", - chroma.NameBuiltinPseudo: "#268BD2", - chroma.NameClass: "#268BD2", - chroma.NameConstant: "#CB4B16", - chroma.NameDecorator: "#268BD2", - chroma.NameEntity: "#CB4B16", - chroma.NameException: "#CB4B16", - chroma.NameFunction: "#268BD2", - chroma.NameTag: "#268BD2", - chroma.NameVariable: "#268BD2", - chroma.LiteralString: "#2AA198", - chroma.LiteralStringBacktick: "#586E75", - chroma.LiteralStringChar: "#2AA198", - chroma.LiteralStringDoc: "#93A1A1", - chroma.LiteralStringEscape: "#CB4B16", - chroma.LiteralStringHeredoc: "#93A1A1", - chroma.LiteralStringRegex: "#DC322F", - chroma.LiteralNumber: "#2AA198", - chroma.Operator: "#719e07", - chroma.Comment: "#586E75", - chroma.CommentPreproc: "#719e07", - chroma.CommentSpecial: "#719e07", - chroma.GenericDeleted: "#DC322F", - chroma.GenericEmph: "italic", - chroma.GenericError: "#DC322F bold", - chroma.GenericHeading: "#CB4B16", - chroma.GenericInserted: "#719e07", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "#268BD2", - chroma.Background: "#93A1A1 bg:#002B36", - chroma.Other: "#CB4B16", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/solarized-dark256.go b/vendor/github.com/alecthomas/chroma/styles/solarized-dark256.go deleted file mode 100644 index a24ddc15..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/solarized-dark256.go +++ /dev/null @@ -1,48 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// SolarizedDark256 style. -var SolarizedDark256 = Register(chroma.MustNewStyle("solarized-dark256", chroma.StyleEntries{ - chroma.Keyword: "#5f8700", - chroma.KeywordConstant: "#d75f00", - chroma.KeywordDeclaration: "#0087ff", - chroma.KeywordNamespace: "#d75f00", - chroma.KeywordReserved: "#0087ff", - chroma.KeywordType: "#af0000", - chroma.NameAttribute: "#8a8a8a", - chroma.NameBuiltin: "#0087ff", - chroma.NameBuiltinPseudo: "#0087ff", - chroma.NameClass: "#0087ff", - chroma.NameConstant: "#d75f00", - chroma.NameDecorator: "#0087ff", - chroma.NameEntity: "#d75f00", - chroma.NameException: "#af8700", - chroma.NameFunction: "#0087ff", - chroma.NameTag: "#0087ff", - chroma.NameVariable: "#0087ff", - chroma.LiteralString: "#00afaf", - chroma.LiteralStringBacktick: "#4e4e4e", - chroma.LiteralStringChar: "#00afaf", - chroma.LiteralStringDoc: "#00afaf", - chroma.LiteralStringEscape: "#af0000", - chroma.LiteralStringHeredoc: "#00afaf", - chroma.LiteralStringRegex: "#af0000", - chroma.LiteralNumber: "#00afaf", - chroma.Operator: "#8a8a8a", - chroma.OperatorWord: "#5f8700", - chroma.Comment: "#4e4e4e", - chroma.CommentPreproc: "#5f8700", - chroma.CommentSpecial: "#5f8700", - chroma.GenericDeleted: "#af0000", - chroma.GenericEmph: "italic", - chroma.GenericError: "#af0000 bold", - chroma.GenericHeading: "#d75f00", - chroma.GenericInserted: "#5f8700", - chroma.GenericStrong: "bold", - chroma.GenericSubheading: "#0087ff", - chroma.Background: "#8a8a8a bg:#1c1c1c", - chroma.Other: "#d75f00", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/solarized-light.go b/vendor/github.com/alecthomas/chroma/styles/solarized-light.go deleted file mode 100644 index b6d5234a..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/solarized-light.go +++ /dev/null @@ -1,24 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// SolarizedLight style. -var SolarizedLight = Register(chroma.MustNewStyle("solarized-light", chroma.StyleEntries{ - chroma.Text: "bg: #eee8d5 #586e75", - chroma.Keyword: "#859900", - chroma.KeywordConstant: "bold", - chroma.KeywordNamespace: "#dc322f bold", - chroma.KeywordType: "bold", - chroma.Name: "#268bd2", - chroma.NameBuiltin: "#cb4b16", - chroma.NameClass: "#cb4b16", - chroma.NameTag: "bold", - chroma.Literal: "#2aa198", - chroma.LiteralNumber: "bold", - chroma.OperatorWord: "#859900", - chroma.Comment: "#93a1a1 italic", - chroma.Generic: "#d33682", - chroma.Background: " bg:#eee8d5", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/swapoff.go b/vendor/github.com/alecthomas/chroma/styles/swapoff.go deleted file mode 100644 index e4daae61..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/swapoff.go +++ /dev/null @@ -1,25 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// SwapOff theme. -var SwapOff = Register(chroma.MustNewStyle("swapoff", chroma.StyleEntries{ - chroma.Background: "#lightgray bg:#black", - chroma.Number: "bold #ansiyellow", - chroma.Comment: "#ansiteal", - chroma.CommentPreproc: "bold #ansigreen", - chroma.String: "bold #ansiturquoise", - chroma.Keyword: "bold #ansiwhite", - chroma.NameKeyword: "bold #ansiwhite", - chroma.NameBuiltin: "bold #ansiwhite", - chroma.GenericHeading: "bold", - chroma.GenericSubheading: "bold", - chroma.GenericStrong: "bold", - chroma.GenericUnderline: "underline", - chroma.NameTag: "bold", - chroma.NameAttribute: "#ansiteal", - chroma.Error: "#ansired", - chroma.LiteralDate: "bold #ansiyellow", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/tango.go b/vendor/github.com/alecthomas/chroma/styles/tango.go deleted file mode 100644 index ae1afe06..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/tango.go +++ /dev/null @@ -1,79 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Tango style. -var Tango = Register(chroma.MustNewStyle("tango", chroma.StyleEntries{ - chroma.TextWhitespace: "underline #f8f8f8", - chroma.Error: "#a40000 border:#ef2929", - chroma.Other: "#000000", - chroma.Comment: "italic #8f5902", - chroma.CommentMultiline: "italic #8f5902", - chroma.CommentPreproc: "italic #8f5902", - chroma.CommentSingle: "italic #8f5902", - chroma.CommentSpecial: "italic #8f5902", - chroma.Keyword: "bold #204a87", - chroma.KeywordConstant: "bold #204a87", - chroma.KeywordDeclaration: "bold #204a87", - chroma.KeywordNamespace: "bold #204a87", - chroma.KeywordPseudo: "bold #204a87", - chroma.KeywordReserved: "bold #204a87", - chroma.KeywordType: "bold #204a87", - chroma.Operator: "bold #ce5c00", - chroma.OperatorWord: "bold #204a87", - chroma.Punctuation: "bold #000000", - chroma.Name: "#000000", - chroma.NameAttribute: "#c4a000", - chroma.NameBuiltin: "#204a87", - chroma.NameBuiltinPseudo: "#3465a4", - chroma.NameClass: "#000000", - chroma.NameConstant: "#000000", - chroma.NameDecorator: "bold #5c35cc", - chroma.NameEntity: "#ce5c00", - chroma.NameException: "bold #cc0000", - chroma.NameFunction: "#000000", - chroma.NameProperty: "#000000", - chroma.NameLabel: "#f57900", - chroma.NameNamespace: "#000000", - chroma.NameOther: "#000000", - chroma.NameTag: "bold #204a87", - chroma.NameVariable: "#000000", - chroma.NameVariableClass: "#000000", - chroma.NameVariableGlobal: "#000000", - chroma.NameVariableInstance: "#000000", - chroma.LiteralNumber: "bold #0000cf", - chroma.LiteralNumberFloat: "bold #0000cf", - chroma.LiteralNumberHex: "bold #0000cf", - chroma.LiteralNumberInteger: "bold #0000cf", - chroma.LiteralNumberIntegerLong: "bold #0000cf", - chroma.LiteralNumberOct: "bold #0000cf", - chroma.Literal: "#000000", - chroma.LiteralDate: "#000000", - chroma.LiteralString: "#4e9a06", - chroma.LiteralStringBacktick: "#4e9a06", - chroma.LiteralStringChar: "#4e9a06", - chroma.LiteralStringDoc: "italic #8f5902", - chroma.LiteralStringDouble: "#4e9a06", - chroma.LiteralStringEscape: "#4e9a06", - chroma.LiteralStringHeredoc: "#4e9a06", - chroma.LiteralStringInterpol: "#4e9a06", - chroma.LiteralStringOther: "#4e9a06", - chroma.LiteralStringRegex: "#4e9a06", - chroma.LiteralStringSingle: "#4e9a06", - chroma.LiteralStringSymbol: "#4e9a06", - chroma.Generic: "#000000", - chroma.GenericDeleted: "#a40000", - chroma.GenericEmph: "italic #000000", - chroma.GenericError: "#ef2929", - chroma.GenericHeading: "bold #000080", - chroma.GenericInserted: "#00A000", - chroma.GenericOutput: "italic #000000", - chroma.GenericPrompt: "#8f5902", - chroma.GenericStrong: "bold #000000", - chroma.GenericSubheading: "bold #800080", - chroma.GenericTraceback: "bold #a40000", - chroma.GenericUnderline: "underline", - chroma.Background: " bg:#f8f8f8", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/trac.go b/vendor/github.com/alecthomas/chroma/styles/trac.go deleted file mode 100644 index 3b09c44e..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/trac.go +++ /dev/null @@ -1,42 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Trac style. -var Trac = Register(chroma.MustNewStyle("trac", chroma.StyleEntries{ - chroma.TextWhitespace: "#bbbbbb", - chroma.Comment: "italic #999988", - chroma.CommentPreproc: "bold noitalic #999999", - chroma.CommentSpecial: "bold #999999", - chroma.Operator: "bold", - chroma.LiteralString: "#bb8844", - chroma.LiteralStringRegex: "#808000", - chroma.LiteralNumber: "#009999", - chroma.Keyword: "bold", - chroma.KeywordType: "#445588", - chroma.NameBuiltin: "#999999", - chroma.NameFunction: "bold #990000", - chroma.NameClass: "bold #445588", - chroma.NameException: "bold #990000", - chroma.NameNamespace: "#555555", - chroma.NameVariable: "#008080", - chroma.NameConstant: "#008080", - chroma.NameTag: "#000080", - chroma.NameAttribute: "#008080", - chroma.NameEntity: "#800080", - chroma.GenericHeading: "#999999", - chroma.GenericSubheading: "#aaaaaa", - chroma.GenericDeleted: "bg:#ffdddd #000000", - chroma.GenericInserted: "bg:#ddffdd #000000", - chroma.GenericError: "#aa0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "#555555", - chroma.GenericOutput: "#888888", - chroma.GenericTraceback: "#aa0000", - chroma.GenericUnderline: "underline", - chroma.Error: "bg:#e3d2d2 #a61717", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/vim.go b/vendor/github.com/alecthomas/chroma/styles/vim.go deleted file mode 100644 index 6296042c..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/vim.go +++ /dev/null @@ -1,36 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Vim style. -var Vim = Register(chroma.MustNewStyle("vim", chroma.StyleEntries{ - chroma.Background: "#cccccc bg:#000000", - chroma.Comment: "#000080", - chroma.CommentSpecial: "bold #cd0000", - chroma.Keyword: "#cdcd00", - chroma.KeywordDeclaration: "#00cd00", - chroma.KeywordNamespace: "#cd00cd", - chroma.KeywordType: "#00cd00", - chroma.Operator: "#3399cc", - chroma.OperatorWord: "#cdcd00", - chroma.NameClass: "#00cdcd", - chroma.NameBuiltin: "#cd00cd", - chroma.NameException: "bold #666699", - chroma.NameVariable: "#00cdcd", - chroma.LiteralString: "#cd0000", - chroma.LiteralNumber: "#cd00cd", - chroma.GenericHeading: "bold #000080", - chroma.GenericSubheading: "bold #800080", - chroma.GenericDeleted: "#cd0000", - chroma.GenericInserted: "#00cd00", - chroma.GenericError: "#FF0000", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold #000080", - chroma.GenericOutput: "#888", - chroma.GenericTraceback: "#04D", - chroma.GenericUnderline: "underline", - chroma.Error: "border:#FF0000", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/vs.go b/vendor/github.com/alecthomas/chroma/styles/vs.go deleted file mode 100644 index acbcb915..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/vs.go +++ /dev/null @@ -1,23 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// VisualStudio style. -var VisualStudio = Register(chroma.MustNewStyle("vs", chroma.StyleEntries{ - chroma.Comment: "#008000", - chroma.CommentPreproc: "#0000ff", - chroma.Keyword: "#0000ff", - chroma.OperatorWord: "#0000ff", - chroma.KeywordType: "#2b91af", - chroma.NameClass: "#2b91af", - chroma.LiteralString: "#a31515", - chroma.GenericHeading: "bold", - chroma.GenericSubheading: "bold", - chroma.GenericEmph: "italic", - chroma.GenericStrong: "bold", - chroma.GenericPrompt: "bold", - chroma.Error: "border:#FF0000", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/styles/xcode.go b/vendor/github.com/alecthomas/chroma/styles/xcode.go deleted file mode 100644 index 115cf71c..00000000 --- a/vendor/github.com/alecthomas/chroma/styles/xcode.go +++ /dev/null @@ -1,29 +0,0 @@ -package styles - -import ( - "github.com/alecthomas/chroma" -) - -// Xcode style. -var Xcode = Register(chroma.MustNewStyle("xcode", chroma.StyleEntries{ - chroma.Comment: "#177500", - chroma.CommentPreproc: "#633820", - chroma.LiteralString: "#C41A16", - chroma.LiteralStringChar: "#2300CE", - chroma.Operator: "#000000", - chroma.Keyword: "#A90D91", - chroma.Name: "#000000", - chroma.NameAttribute: "#836C28", - chroma.NameClass: "#3F6E75", - chroma.NameFunction: "#000000", - chroma.NameBuiltin: "#A90D91", - chroma.NameBuiltinPseudo: "#5B269A", - chroma.NameVariable: "#000000", - chroma.NameTag: "#000000", - chroma.NameDecorator: "#000000", - chroma.NameLabel: "#000000", - chroma.Literal: "#1C01CE", - chroma.LiteralNumber: "#1C01CE", - chroma.Error: "#000000", - chroma.Background: " bg:#ffffff", -})) diff --git a/vendor/github.com/alecthomas/chroma/table.py b/vendor/github.com/alecthomas/chroma/table.py deleted file mode 100644 index 1caa7cc5..00000000 --- a/vendor/github.com/alecthomas/chroma/table.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 -from collections import defaultdict -from subprocess import check_output - -lines = check_output(["go", "run", "./cmd/chroma/main.go", "--list"]).decode('utf-8').splitlines() -lines = [line.strip() for line in lines if line.startswith(" ") and not line.startswith(" ")] -lines = sorted(lines, key=lambda l: l.lower()) - -table = defaultdict(list) - -for line in lines: - table[line[0].upper()].append(line) - -for key, value in table.items(): - print("{} | {}".format(key, ', '.join(value))) diff --git a/vendor/github.com/alecthomas/chroma/tokentype_string.go b/vendor/github.com/alecthomas/chroma/tokentype_string.go deleted file mode 100644 index 6fe38674..00000000 --- a/vendor/github.com/alecthomas/chroma/tokentype_string.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by "stringer -type TokenType"; DO NOT EDIT. - -package chroma - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Background - -1] - _ = x[LineNumbers - -2] - _ = x[LineNumbersTable - -3] - _ = x[LineHighlight - -4] - _ = x[LineTable - -5] - _ = x[LineTableTD - -6] - _ = x[Error - -7] - _ = x[Other - -8] - _ = x[None - -9] - _ = x[EOFType-0] - _ = x[Keyword-1000] - _ = x[KeywordConstant-1001] - _ = x[KeywordDeclaration-1002] - _ = x[KeywordNamespace-1003] - _ = x[KeywordPseudo-1004] - _ = x[KeywordReserved-1005] - _ = x[KeywordType-1006] - _ = x[Name-2000] - _ = x[NameAttribute-2001] - _ = x[NameBuiltin-2002] - _ = x[NameBuiltinPseudo-2003] - _ = x[NameClass-2004] - _ = x[NameConstant-2005] - _ = x[NameDecorator-2006] - _ = x[NameEntity-2007] - _ = x[NameException-2008] - _ = x[NameFunction-2009] - _ = x[NameFunctionMagic-2010] - _ = x[NameKeyword-2011] - _ = x[NameLabel-2012] - _ = x[NameNamespace-2013] - _ = x[NameOperator-2014] - _ = x[NameOther-2015] - _ = x[NamePseudo-2016] - _ = x[NameProperty-2017] - _ = x[NameTag-2018] - _ = x[NameVariable-2019] - _ = x[NameVariableAnonymous-2020] - _ = x[NameVariableClass-2021] - _ = x[NameVariableGlobal-2022] - _ = x[NameVariableInstance-2023] - _ = x[NameVariableMagic-2024] - _ = x[Literal-3000] - _ = x[LiteralDate-3001] - _ = x[LiteralOther-3002] - _ = x[LiteralString-3100] - _ = x[LiteralStringAffix-3101] - _ = x[LiteralStringAtom-3102] - _ = x[LiteralStringBacktick-3103] - _ = x[LiteralStringBoolean-3104] - _ = x[LiteralStringChar-3105] - _ = x[LiteralStringDelimiter-3106] - _ = x[LiteralStringDoc-3107] - _ = x[LiteralStringDouble-3108] - _ = x[LiteralStringEscape-3109] - _ = x[LiteralStringHeredoc-3110] - _ = x[LiteralStringInterpol-3111] - _ = x[LiteralStringName-3112] - _ = x[LiteralStringOther-3113] - _ = x[LiteralStringRegex-3114] - _ = x[LiteralStringSingle-3115] - _ = x[LiteralStringSymbol-3116] - _ = x[LiteralNumber-3200] - _ = x[LiteralNumberBin-3201] - _ = x[LiteralNumberFloat-3202] - _ = x[LiteralNumberHex-3203] - _ = x[LiteralNumberInteger-3204] - _ = x[LiteralNumberIntegerLong-3205] - _ = x[LiteralNumberOct-3206] - _ = x[Operator-4000] - _ = x[OperatorWord-4001] - _ = x[Punctuation-5000] - _ = x[Comment-6000] - _ = x[CommentHashbang-6001] - _ = x[CommentMultiline-6002] - _ = x[CommentSingle-6003] - _ = x[CommentSpecial-6004] - _ = x[CommentPreproc-6100] - _ = x[CommentPreprocFile-6101] - _ = x[Generic-7000] - _ = x[GenericDeleted-7001] - _ = x[GenericEmph-7002] - _ = x[GenericError-7003] - _ = x[GenericHeading-7004] - _ = x[GenericInserted-7005] - _ = x[GenericOutput-7006] - _ = x[GenericPrompt-7007] - _ = x[GenericStrong-7008] - _ = x[GenericSubheading-7009] - _ = x[GenericTraceback-7010] - _ = x[GenericUnderline-7011] - _ = x[Text-8000] - _ = x[TextWhitespace-8001] - _ = x[TextSymbol-8002] - _ = x[TextPunctuation-8003] -} - -const _TokenType_name = "NoneOtherErrorLineTableTDLineTableLineHighlightLineNumbersTableLineNumbersBackgroundEOFTypeKeywordKeywordConstantKeywordDeclarationKeywordNamespaceKeywordPseudoKeywordReservedKeywordTypeNameNameAttributeNameBuiltinNameBuiltinPseudoNameClassNameConstantNameDecoratorNameEntityNameExceptionNameFunctionNameFunctionMagicNameKeywordNameLabelNameNamespaceNameOperatorNameOtherNamePseudoNamePropertyNameTagNameVariableNameVariableAnonymousNameVariableClassNameVariableGlobalNameVariableInstanceNameVariableMagicLiteralLiteralDateLiteralOtherLiteralStringLiteralStringAffixLiteralStringAtomLiteralStringBacktickLiteralStringBooleanLiteralStringCharLiteralStringDelimiterLiteralStringDocLiteralStringDoubleLiteralStringEscapeLiteralStringHeredocLiteralStringInterpolLiteralStringNameLiteralStringOtherLiteralStringRegexLiteralStringSingleLiteralStringSymbolLiteralNumberLiteralNumberBinLiteralNumberFloatLiteralNumberHexLiteralNumberIntegerLiteralNumberIntegerLongLiteralNumberOctOperatorOperatorWordPunctuationCommentCommentHashbangCommentMultilineCommentSingleCommentSpecialCommentPreprocCommentPreprocFileGenericGenericDeletedGenericEmphGenericErrorGenericHeadingGenericInsertedGenericOutputGenericPromptGenericStrongGenericSubheadingGenericTracebackGenericUnderlineTextTextWhitespaceTextSymbolTextPunctuation" - -var _TokenType_map = map[TokenType]string{ - -9: _TokenType_name[0:4], - -8: _TokenType_name[4:9], - -7: _TokenType_name[9:14], - -6: _TokenType_name[14:25], - -5: _TokenType_name[25:34], - -4: _TokenType_name[34:47], - -3: _TokenType_name[47:63], - -2: _TokenType_name[63:74], - -1: _TokenType_name[74:84], - 0: _TokenType_name[84:91], - 1000: _TokenType_name[91:98], - 1001: _TokenType_name[98:113], - 1002: _TokenType_name[113:131], - 1003: _TokenType_name[131:147], - 1004: _TokenType_name[147:160], - 1005: _TokenType_name[160:175], - 1006: _TokenType_name[175:186], - 2000: _TokenType_name[186:190], - 2001: _TokenType_name[190:203], - 2002: _TokenType_name[203:214], - 2003: _TokenType_name[214:231], - 2004: _TokenType_name[231:240], - 2005: _TokenType_name[240:252], - 2006: _TokenType_name[252:265], - 2007: _TokenType_name[265:275], - 2008: _TokenType_name[275:288], - 2009: _TokenType_name[288:300], - 2010: _TokenType_name[300:317], - 2011: _TokenType_name[317:328], - 2012: _TokenType_name[328:337], - 2013: _TokenType_name[337:350], - 2014: _TokenType_name[350:362], - 2015: _TokenType_name[362:371], - 2016: _TokenType_name[371:381], - 2017: _TokenType_name[381:393], - 2018: _TokenType_name[393:400], - 2019: _TokenType_name[400:412], - 2020: _TokenType_name[412:433], - 2021: _TokenType_name[433:450], - 2022: _TokenType_name[450:468], - 2023: _TokenType_name[468:488], - 2024: _TokenType_name[488:505], - 3000: _TokenType_name[505:512], - 3001: _TokenType_name[512:523], - 3002: _TokenType_name[523:535], - 3100: _TokenType_name[535:548], - 3101: _TokenType_name[548:566], - 3102: _TokenType_name[566:583], - 3103: _TokenType_name[583:604], - 3104: _TokenType_name[604:624], - 3105: _TokenType_name[624:641], - 3106: _TokenType_name[641:663], - 3107: _TokenType_name[663:679], - 3108: _TokenType_name[679:698], - 3109: _TokenType_name[698:717], - 3110: _TokenType_name[717:737], - 3111: _TokenType_name[737:758], - 3112: _TokenType_name[758:775], - 3113: _TokenType_name[775:793], - 3114: _TokenType_name[793:811], - 3115: _TokenType_name[811:830], - 3116: _TokenType_name[830:849], - 3200: _TokenType_name[849:862], - 3201: _TokenType_name[862:878], - 3202: _TokenType_name[878:896], - 3203: _TokenType_name[896:912], - 3204: _TokenType_name[912:932], - 3205: _TokenType_name[932:956], - 3206: _TokenType_name[956:972], - 4000: _TokenType_name[972:980], - 4001: _TokenType_name[980:992], - 5000: _TokenType_name[992:1003], - 6000: _TokenType_name[1003:1010], - 6001: _TokenType_name[1010:1025], - 6002: _TokenType_name[1025:1041], - 6003: _TokenType_name[1041:1054], - 6004: _TokenType_name[1054:1068], - 6100: _TokenType_name[1068:1082], - 6101: _TokenType_name[1082:1100], - 7000: _TokenType_name[1100:1107], - 7001: _TokenType_name[1107:1121], - 7002: _TokenType_name[1121:1132], - 7003: _TokenType_name[1132:1144], - 7004: _TokenType_name[1144:1158], - 7005: _TokenType_name[1158:1173], - 7006: _TokenType_name[1173:1186], - 7007: _TokenType_name[1186:1199], - 7008: _TokenType_name[1199:1212], - 7009: _TokenType_name[1212:1229], - 7010: _TokenType_name[1229:1245], - 7011: _TokenType_name[1245:1261], - 8000: _TokenType_name[1261:1265], - 8001: _TokenType_name[1265:1279], - 8002: _TokenType_name[1279:1289], - 8003: _TokenType_name[1289:1304], -} - -func (i TokenType) String() string { - if str, ok := _TokenType_map[i]; ok { - return str - } - return "TokenType(" + strconv.FormatInt(int64(i), 10) + ")" -} diff --git a/vendor/github.com/alecthomas/chroma/types.go b/vendor/github.com/alecthomas/chroma/types.go deleted file mode 100644 index b102f308..00000000 --- a/vendor/github.com/alecthomas/chroma/types.go +++ /dev/null @@ -1,347 +0,0 @@ -package chroma - -import ( - "encoding/json" - "fmt" -) - -//go:generate stringer -type TokenType - -// TokenType is the type of token to highlight. -// -// It is also an Emitter, emitting a single token of itself -type TokenType int - -func (t TokenType) MarshalJSON() ([]byte, error) { return json.Marshal(t.String()) } -func (t *TokenType) UnmarshalJSON(data []byte) error { - key := "" - err := json.Unmarshal(data, &key) - if err != nil { - return err - } - for tt, text := range _TokenType_map { - if text == key { - *t = tt - return nil - } - } - return fmt.Errorf("unknown TokenType %q", data) -} - -// Set of TokenTypes. -// -// Categories of types are grouped in ranges of 1000, while sub-categories are in ranges of 100. For -// example, the literal category is in the range 3000-3999. The sub-category for literal strings is -// in the range 3100-3199. - -// Meta token types. -const ( - // Default background style. - Background TokenType = -1 - iota - // Line numbers in output. - LineNumbers - // Line numbers in output when in table. - LineNumbersTable - // Line higlight style. - LineHighlight - // Line numbers table wrapper style. - LineTable - // Line numbers table TD wrapper style. - LineTableTD - // Input that could not be tokenised. - Error - // Other is used by the Delegate lexer to indicate which tokens should be handled by the delegate. - Other - // No highlighting. - None - // Used as an EOF marker / nil token - EOFType TokenType = 0 -) - -// Keywords. -const ( - Keyword TokenType = 1000 + iota - KeywordConstant - KeywordDeclaration - KeywordNamespace - KeywordPseudo - KeywordReserved - KeywordType -) - -// Names. -const ( - Name TokenType = 2000 + iota - NameAttribute - NameBuiltin - NameBuiltinPseudo - NameClass - NameConstant - NameDecorator - NameEntity - NameException - NameFunction - NameFunctionMagic - NameKeyword - NameLabel - NameNamespace - NameOperator - NameOther - NamePseudo - NameProperty - NameTag - NameVariable - NameVariableAnonymous - NameVariableClass - NameVariableGlobal - NameVariableInstance - NameVariableMagic -) - -// Literals. -const ( - Literal TokenType = 3000 + iota - LiteralDate - LiteralOther -) - -// Strings. -const ( - LiteralString TokenType = 3100 + iota - LiteralStringAffix - LiteralStringAtom - LiteralStringBacktick - LiteralStringBoolean - LiteralStringChar - LiteralStringDelimiter - LiteralStringDoc - LiteralStringDouble - LiteralStringEscape - LiteralStringHeredoc - LiteralStringInterpol - LiteralStringName - LiteralStringOther - LiteralStringRegex - LiteralStringSingle - LiteralStringSymbol -) - -// Literals. -const ( - LiteralNumber TokenType = 3200 + iota - LiteralNumberBin - LiteralNumberFloat - LiteralNumberHex - LiteralNumberInteger - LiteralNumberIntegerLong - LiteralNumberOct -) - -// Operators. -const ( - Operator TokenType = 4000 + iota - OperatorWord -) - -// Punctuation. -const ( - Punctuation TokenType = 5000 + iota -) - -// Comments. -const ( - Comment TokenType = 6000 + iota - CommentHashbang - CommentMultiline - CommentSingle - CommentSpecial -) - -// Preprocessor "comments". -const ( - CommentPreproc TokenType = 6100 + iota - CommentPreprocFile -) - -// Generic tokens. -const ( - Generic TokenType = 7000 + iota - GenericDeleted - GenericEmph - GenericError - GenericHeading - GenericInserted - GenericOutput - GenericPrompt - GenericStrong - GenericSubheading - GenericTraceback - GenericUnderline -) - -// Text. -const ( - Text TokenType = 8000 + iota - TextWhitespace - TextSymbol - TextPunctuation -) - -// Aliases. -const ( - Whitespace = TextWhitespace - - Date = LiteralDate - - String = LiteralString - StringAffix = LiteralStringAffix - StringBacktick = LiteralStringBacktick - StringChar = LiteralStringChar - StringDelimiter = LiteralStringDelimiter - StringDoc = LiteralStringDoc - StringDouble = LiteralStringDouble - StringEscape = LiteralStringEscape - StringHeredoc = LiteralStringHeredoc - StringInterpol = LiteralStringInterpol - StringOther = LiteralStringOther - StringRegex = LiteralStringRegex - StringSingle = LiteralStringSingle - StringSymbol = LiteralStringSymbol - - Number = LiteralNumber - NumberBin = LiteralNumberBin - NumberFloat = LiteralNumberFloat - NumberHex = LiteralNumberHex - NumberInteger = LiteralNumberInteger - NumberIntegerLong = LiteralNumberIntegerLong - NumberOct = LiteralNumberOct -) - -var ( - StandardTypes = map[TokenType]string{ - Background: "chroma", - LineNumbers: "ln", - LineNumbersTable: "lnt", - LineHighlight: "hl", - LineTable: "lntable", - LineTableTD: "lntd", - Text: "", - Whitespace: "w", - Error: "err", - Other: "x", - // I have no idea what this is used for... - // Escape: "esc", - - Keyword: "k", - KeywordConstant: "kc", - KeywordDeclaration: "kd", - KeywordNamespace: "kn", - KeywordPseudo: "kp", - KeywordReserved: "kr", - KeywordType: "kt", - - Name: "n", - NameAttribute: "na", - NameBuiltin: "nb", - NameBuiltinPseudo: "bp", - NameClass: "nc", - NameConstant: "no", - NameDecorator: "nd", - NameEntity: "ni", - NameException: "ne", - NameFunction: "nf", - NameFunctionMagic: "fm", - NameProperty: "py", - NameLabel: "nl", - NameNamespace: "nn", - NameOther: "nx", - NameTag: "nt", - NameVariable: "nv", - NameVariableClass: "vc", - NameVariableGlobal: "vg", - NameVariableInstance: "vi", - NameVariableMagic: "vm", - - Literal: "l", - LiteralDate: "ld", - - String: "s", - StringAffix: "sa", - StringBacktick: "sb", - StringChar: "sc", - StringDelimiter: "dl", - StringDoc: "sd", - StringDouble: "s2", - StringEscape: "se", - StringHeredoc: "sh", - StringInterpol: "si", - StringOther: "sx", - StringRegex: "sr", - StringSingle: "s1", - StringSymbol: "ss", - - Number: "m", - NumberBin: "mb", - NumberFloat: "mf", - NumberHex: "mh", - NumberInteger: "mi", - NumberIntegerLong: "il", - NumberOct: "mo", - - Operator: "o", - OperatorWord: "ow", - - Punctuation: "p", - - Comment: "c", - CommentHashbang: "ch", - CommentMultiline: "cm", - CommentPreproc: "cp", - CommentPreprocFile: "cpf", - CommentSingle: "c1", - CommentSpecial: "cs", - - Generic: "g", - GenericDeleted: "gd", - GenericEmph: "ge", - GenericError: "gr", - GenericHeading: "gh", - GenericInserted: "gi", - GenericOutput: "go", - GenericPrompt: "gp", - GenericStrong: "gs", - GenericSubheading: "gu", - GenericTraceback: "gt", - GenericUnderline: "gl", - } -) - -func (t TokenType) Parent() TokenType { - if t%100 != 0 { - return t / 100 * 100 - } - if t%1000 != 0 { - return t / 1000 * 1000 - } - return 0 -} - -func (t TokenType) Category() TokenType { - return t / 1000 * 1000 -} - -func (t TokenType) SubCategory() TokenType { - return t / 100 * 100 -} - -func (t TokenType) InCategory(other TokenType) bool { - return t/1000 == other/1000 -} - -func (t TokenType) InSubCategory(other TokenType) bool { - return t/100 == other/100 -} - -func (t TokenType) Emit(groups []string, lexer Lexer) Iterator { - return Literator(Token{Type: t, Value: groups[0]}) -} diff --git a/vendor/github.com/andybalholm/cascadia/.travis.yml b/vendor/github.com/andybalholm/cascadia/.travis.yml deleted file mode 100644 index 6f227517..00000000 --- a/vendor/github.com/andybalholm/cascadia/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -go: - - 1.3 - - 1.4 - -install: - - go get github.com/andybalholm/cascadia - -script: - - go test -v - -notifications: - email: false diff --git a/vendor/github.com/andybalholm/cascadia/LICENSE b/vendor/github.com/andybalholm/cascadia/LICENSE deleted file mode 100644 index ee5ad35a..00000000 --- a/vendor/github.com/andybalholm/cascadia/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011 Andy Balholm. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/andybalholm/cascadia/README.md b/vendor/github.com/andybalholm/cascadia/README.md deleted file mode 100644 index 9021cb92..00000000 --- a/vendor/github.com/andybalholm/cascadia/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# cascadia - -[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) - -The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. - -To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. diff --git a/vendor/github.com/andybalholm/cascadia/go.mod b/vendor/github.com/andybalholm/cascadia/go.mod deleted file mode 100644 index e6febbbf..00000000 --- a/vendor/github.com/andybalholm/cascadia/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module "github.com/andybalholm/cascadia" - -require "golang.org/x/net" v0.0.0-20180218175443-cbe0f9307d01 diff --git a/vendor/github.com/andybalholm/cascadia/parser.go b/vendor/github.com/andybalholm/cascadia/parser.go deleted file mode 100644 index 495db9cc..00000000 --- a/vendor/github.com/andybalholm/cascadia/parser.go +++ /dev/null @@ -1,835 +0,0 @@ -// Package cascadia is an implementation of CSS selectors. -package cascadia - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" - - "golang.org/x/net/html" -) - -// a parser for CSS selectors -type parser struct { - s string // the source text - i int // the current position -} - -// parseEscape parses a backslash escape. -func (p *parser) parseEscape() (result string, err error) { - if len(p.s) < p.i+2 || p.s[p.i] != '\\' { - return "", errors.New("invalid escape sequence") - } - - start := p.i + 1 - c := p.s[start] - switch { - case c == '\r' || c == '\n' || c == '\f': - return "", errors.New("escaped line ending outside string") - case hexDigit(c): - // unicode escape (hex) - var i int - for i = start; i < p.i+6 && i < len(p.s) && hexDigit(p.s[i]); i++ { - // empty - } - v, _ := strconv.ParseUint(p.s[start:i], 16, 21) - if len(p.s) > i { - switch p.s[i] { - case '\r': - i++ - if len(p.s) > i && p.s[i] == '\n' { - i++ - } - case ' ', '\t', '\n', '\f': - i++ - } - } - p.i = i - return string(rune(v)), nil - } - - // Return the literal character after the backslash. - result = p.s[start : start+1] - p.i += 2 - return result, nil -} - -func hexDigit(c byte) bool { - return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F' -} - -// nameStart returns whether c can be the first character of an identifier -// (not counting an initial hyphen, or an escape sequence). -func nameStart(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 -} - -// nameChar returns whether c can be a character within an identifier -// (not counting an escape sequence). -func nameChar(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 || - c == '-' || '0' <= c && c <= '9' -} - -// parseIdentifier parses an identifier. -func (p *parser) parseIdentifier() (result string, err error) { - startingDash := false - if len(p.s) > p.i && p.s[p.i] == '-' { - startingDash = true - p.i++ - } - - if len(p.s) <= p.i { - return "", errors.New("expected identifier, found EOF instead") - } - - if c := p.s[p.i]; !(nameStart(c) || c == '\\') { - return "", fmt.Errorf("expected identifier, found %c instead", c) - } - - result, err = p.parseName() - if startingDash && err == nil { - result = "-" + result - } - return -} - -// parseName parses a name (which is like an identifier, but doesn't have -// extra restrictions on the first character). -func (p *parser) parseName() (result string, err error) { - i := p.i -loop: - for i < len(p.s) { - c := p.s[i] - switch { - case nameChar(c): - start := i - for i < len(p.s) && nameChar(p.s[i]) { - i++ - } - result += p.s[start:i] - case c == '\\': - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - default: - break loop - } - } - - if result == "" { - return "", errors.New("expected name, found EOF instead") - } - - p.i = i - return result, nil -} - -// parseString parses a single- or double-quoted string. -func (p *parser) parseString() (result string, err error) { - i := p.i - if len(p.s) < i+2 { - return "", errors.New("expected string, found EOF instead") - } - - quote := p.s[i] - i++ - -loop: - for i < len(p.s) { - switch p.s[i] { - case '\\': - if len(p.s) > i+1 { - switch c := p.s[i+1]; c { - case '\r': - if len(p.s) > i+2 && p.s[i+2] == '\n' { - i += 3 - continue loop - } - fallthrough - case '\n', '\f': - i += 2 - continue loop - } - } - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - case quote: - break loop - case '\r', '\n', '\f': - return "", errors.New("unexpected end of line in string") - default: - start := i - for i < len(p.s) { - if c := p.s[i]; c == quote || c == '\\' || c == '\r' || c == '\n' || c == '\f' { - break - } - i++ - } - result += p.s[start:i] - } - } - - if i >= len(p.s) { - return "", errors.New("EOF in string") - } - - // Consume the final quote. - i++ - - p.i = i - return result, nil -} - -// parseRegex parses a regular expression; the end is defined by encountering an -// unmatched closing ')' or ']' which is not consumed -func (p *parser) parseRegex() (rx *regexp.Regexp, err error) { - i := p.i - if len(p.s) < i+2 { - return nil, errors.New("expected regular expression, found EOF instead") - } - - // number of open parens or brackets; - // when it becomes negative, finished parsing regex - open := 0 - -loop: - for i < len(p.s) { - switch p.s[i] { - case '(', '[': - open++ - case ')', ']': - open-- - if open < 0 { - break loop - } - } - i++ - } - - if i >= len(p.s) { - return nil, errors.New("EOF in regular expression") - } - rx, err = regexp.Compile(p.s[p.i:i]) - p.i = i - return rx, err -} - -// skipWhitespace consumes whitespace characters and comments. -// It returns true if there was actually anything to skip. -func (p *parser) skipWhitespace() bool { - i := p.i - for i < len(p.s) { - switch p.s[i] { - case ' ', '\t', '\r', '\n', '\f': - i++ - continue - case '/': - if strings.HasPrefix(p.s[i:], "/*") { - end := strings.Index(p.s[i+len("/*"):], "*/") - if end != -1 { - i += end + len("/**/") - continue - } - } - } - break - } - - if i > p.i { - p.i = i - return true - } - - return false -} - -// consumeParenthesis consumes an opening parenthesis and any following -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeParenthesis() bool { - if p.i < len(p.s) && p.s[p.i] == '(' { - p.i++ - p.skipWhitespace() - return true - } - return false -} - -// consumeClosingParenthesis consumes a closing parenthesis and any preceding -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeClosingParenthesis() bool { - i := p.i - p.skipWhitespace() - if p.i < len(p.s) && p.s[p.i] == ')' { - p.i++ - return true - } - p.i = i - return false -} - -// parseTypeSelector parses a type selector (one that matches by tag name). -func (p *parser) parseTypeSelector() (result Selector, err error) { - tag, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - return typeSelector(tag), nil -} - -// parseIDSelector parses a selector that matches by id attribute. -func (p *parser) parseIDSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected id selector (#id), found EOF instead") - } - if p.s[p.i] != '#' { - return nil, fmt.Errorf("expected id selector (#id), found '%c' instead", p.s[p.i]) - } - - p.i++ - id, err := p.parseName() - if err != nil { - return nil, err - } - - return attributeEqualsSelector("id", id), nil -} - -// parseClassSelector parses a selector that matches by class attribute. -func (p *parser) parseClassSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected class selector (.class), found EOF instead") - } - if p.s[p.i] != '.' { - return nil, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i]) - } - - p.i++ - class, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - return attributeIncludesSelector("class", class), nil -} - -// parseAttributeSelector parses a selector that matches by attribute value. -func (p *parser) parseAttributeSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected attribute selector ([attribute]), found EOF instead") - } - if p.s[p.i] != '[' { - return nil, fmt.Errorf("expected attribute selector ([attribute]), found '%c' instead", p.s[p.i]) - } - - p.i++ - p.skipWhitespace() - key, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - - if p.s[p.i] == ']' { - p.i++ - return attributeExistsSelector(key), nil - } - - if p.i+2 >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - - op := p.s[p.i : p.i+2] - if op[0] == '=' { - op = "=" - } else if op[1] != '=' { - return nil, fmt.Errorf(`expected equality operator, found "%s" instead`, op) - } - p.i += len(op) - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - var val string - var rx *regexp.Regexp - if op == "#=" { - rx, err = p.parseRegex() - } else { - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - } - if err != nil { - return nil, err - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - if p.s[p.i] != ']' { - return nil, fmt.Errorf("expected ']', found '%c' instead", p.s[p.i]) - } - p.i++ - - switch op { - case "=": - return attributeEqualsSelector(key, val), nil - case "!=": - return attributeNotEqualSelector(key, val), nil - case "~=": - return attributeIncludesSelector(key, val), nil - case "|=": - return attributeDashmatchSelector(key, val), nil - case "^=": - return attributePrefixSelector(key, val), nil - case "$=": - return attributeSuffixSelector(key, val), nil - case "*=": - return attributeSubstringSelector(key, val), nil - case "#=": - return attributeRegexSelector(key, rx), nil - } - - return nil, fmt.Errorf("attribute operator %q is not supported", op) -} - -var errExpectedParenthesis = errors.New("expected '(' but didn't find it") -var errExpectedClosingParenthesis = errors.New("expected ')' but didn't find it") -var errUnmatchedParenthesis = errors.New("unmatched '('") - -// parsePseudoclassSelector parses a pseudoclass selector like :not(p). -func (p *parser) parsePseudoclassSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected pseudoclass selector (:pseudoclass), found EOF instead") - } - if p.s[p.i] != ':' { - return nil, fmt.Errorf("expected attribute selector (:pseudoclass), found '%c' instead", p.s[p.i]) - } - - p.i++ - name, err := p.parseIdentifier() - if err != nil { - return nil, err - } - name = toLowerASCII(name) - - switch name { - case "not", "has", "haschild": - if !p.consumeParenthesis() { - return nil, errExpectedParenthesis - } - sel, parseErr := p.parseSelectorGroup() - if parseErr != nil { - return nil, parseErr - } - if !p.consumeClosingParenthesis() { - return nil, errExpectedClosingParenthesis - } - - switch name { - case "not": - return negatedSelector(sel), nil - case "has": - return hasDescendantSelector(sel), nil - case "haschild": - return hasChildSelector(sel), nil - } - - case "contains", "containsown": - if !p.consumeParenthesis() { - return nil, errExpectedParenthesis - } - if p.i == len(p.s) { - return nil, errUnmatchedParenthesis - } - var val string - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - if err != nil { - return nil, err - } - val = strings.ToLower(val) - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return nil, errExpectedClosingParenthesis - } - - switch name { - case "contains": - return textSubstrSelector(val), nil - case "containsown": - return ownTextSubstrSelector(val), nil - } - - case "matches", "matchesown": - if !p.consumeParenthesis() { - return nil, errExpectedParenthesis - } - rx, err := p.parseRegex() - if err != nil { - return nil, err - } - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return nil, errExpectedClosingParenthesis - } - - switch name { - case "matches": - return textRegexSelector(rx), nil - case "matchesown": - return ownTextRegexSelector(rx), nil - } - - case "nth-child", "nth-last-child", "nth-of-type", "nth-last-of-type": - if !p.consumeParenthesis() { - return nil, errExpectedParenthesis - } - a, b, err := p.parseNth() - if err != nil { - return nil, err - } - if !p.consumeClosingParenthesis() { - return nil, errExpectedClosingParenthesis - } - if a == 0 { - switch name { - case "nth-child": - return simpleNthChildSelector(b, false), nil - case "nth-of-type": - return simpleNthChildSelector(b, true), nil - case "nth-last-child": - return simpleNthLastChildSelector(b, false), nil - case "nth-last-of-type": - return simpleNthLastChildSelector(b, true), nil - } - } - return nthChildSelector(a, b, - name == "nth-last-child" || name == "nth-last-of-type", - name == "nth-of-type" || name == "nth-last-of-type"), - nil - - case "first-child": - return simpleNthChildSelector(1, false), nil - case "last-child": - return simpleNthLastChildSelector(1, false), nil - case "first-of-type": - return simpleNthChildSelector(1, true), nil - case "last-of-type": - return simpleNthLastChildSelector(1, true), nil - case "only-child": - return onlyChildSelector(false), nil - case "only-of-type": - return onlyChildSelector(true), nil - case "input": - return inputSelector, nil - case "empty": - return emptyElementSelector, nil - case "root": - return rootSelector, nil - } - - return nil, fmt.Errorf("unknown pseudoclass :%s", name) -} - -// parseInteger parses a decimal integer. -func (p *parser) parseInteger() (int, error) { - i := p.i - start := i - for i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' { - i++ - } - if i == start { - return 0, errors.New("expected integer, but didn't find it") - } - p.i = i - - val, err := strconv.Atoi(p.s[start:i]) - if err != nil { - return 0, err - } - - return val, nil -} - -// parseNth parses the argument for :nth-child (normally of the form an+b). -func (p *parser) parseNth() (a, b int, err error) { - // initial state - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '-': - p.i++ - goto negativeA - case '+': - p.i++ - goto positiveA - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - goto positiveA - case 'n', 'N': - a = 1 - p.i++ - goto readN - case 'o', 'O', 'e', 'E': - id, nameErr := p.parseName() - if nameErr != nil { - return 0, 0, nameErr - } - id = toLowerASCII(id) - if id == "odd" { - return 2, 1, nil - } - if id == "even" { - return 2, 0, nil - } - return 0, 0, fmt.Errorf("expected 'odd' or 'even', but found '%s' instead", id) - default: - goto invalid - } - -positiveA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - goto readA - case 'n', 'N': - a = 1 - p.i++ - goto readN - default: - goto invalid - } - -negativeA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - a = -a - goto readA - case 'n', 'N': - a = -1 - p.i++ - goto readN - default: - goto invalid - } - -readA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case 'n', 'N': - p.i++ - goto readN - default: - // The number we read as a is actually b. - return 0, a, nil - } - -readN: - p.skipWhitespace() - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '+': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, b, nil - case '-': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, -b, nil - default: - return a, 0, nil - } - -eof: - return 0, 0, errors.New("unexpected EOF while attempting to parse expression of form an+b") - -invalid: - return 0, 0, errors.New("unexpected character while attempting to parse expression of form an+b") -} - -// parseSimpleSelectorSequence parses a selector sequence that applies to -// a single element. -func (p *parser) parseSimpleSelectorSequence() (Selector, error) { - var result Selector - - if p.i >= len(p.s) { - return nil, errors.New("expected selector, found EOF instead") - } - - switch p.s[p.i] { - case '*': - // It's the universal selector. Just skip over it, since it doesn't affect the meaning. - p.i++ - case '#', '.', '[', ':': - // There's no type selector. Wait to process the other till the main loop. - default: - r, err := p.parseTypeSelector() - if err != nil { - return nil, err - } - result = r - } - -loop: - for p.i < len(p.s) { - var ns Selector - var err error - switch p.s[p.i] { - case '#': - ns, err = p.parseIDSelector() - case '.': - ns, err = p.parseClassSelector() - case '[': - ns, err = p.parseAttributeSelector() - case ':': - ns, err = p.parsePseudoclassSelector() - default: - break loop - } - if err != nil { - return nil, err - } - if result == nil { - result = ns - } else { - result = intersectionSelector(result, ns) - } - } - - if result == nil { - result = func(n *html.Node) bool { - return n.Type == html.ElementNode - } - } - - return result, nil -} - -// parseSelector parses a selector that may include combinators. -func (p *parser) parseSelector() (result Selector, err error) { - p.skipWhitespace() - result, err = p.parseSimpleSelectorSequence() - if err != nil { - return - } - - for { - var combinator byte - if p.skipWhitespace() { - combinator = ' ' - } - if p.i >= len(p.s) { - return - } - - switch p.s[p.i] { - case '+', '>', '~': - combinator = p.s[p.i] - p.i++ - p.skipWhitespace() - case ',', ')': - // These characters can't begin a selector, but they can legally occur after one. - return - } - - if combinator == 0 { - return - } - - c, err := p.parseSimpleSelectorSequence() - if err != nil { - return nil, err - } - - switch combinator { - case ' ': - result = descendantSelector(result, c) - case '>': - result = childSelector(result, c) - case '+': - result = siblingSelector(result, c, true) - case '~': - result = siblingSelector(result, c, false) - } - } - - panic("unreachable") -} - -// parseSelectorGroup parses a group of selectors, separated by commas. -func (p *parser) parseSelectorGroup() (result Selector, err error) { - result, err = p.parseSelector() - if err != nil { - return - } - - for p.i < len(p.s) { - if p.s[p.i] != ',' { - return result, nil - } - p.i++ - c, err := p.parseSelector() - if err != nil { - return nil, err - } - result = unionSelector(result, c) - } - - return -} diff --git a/vendor/github.com/andybalholm/cascadia/selector.go b/vendor/github.com/andybalholm/cascadia/selector.go deleted file mode 100644 index 9fb05ccb..00000000 --- a/vendor/github.com/andybalholm/cascadia/selector.go +++ /dev/null @@ -1,622 +0,0 @@ -package cascadia - -import ( - "bytes" - "fmt" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -// the Selector type, and functions for creating them - -// A Selector is a function which tells whether a node matches or not. -type Selector func(*html.Node) bool - -// hasChildMatch returns whether n has any child that matches a. -func hasChildMatch(n *html.Node, a Selector) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a(c) { - return true - } - } - return false -} - -// hasDescendantMatch performs a depth-first search of n's descendants, -// testing whether any of them match a. It returns true as soon as a match is -// found, or false if no match is found. -func hasDescendantMatch(n *html.Node, a Selector) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a(c) || (c.Type == html.ElementNode && hasDescendantMatch(c, a)) { - return true - } - } - return false -} - -// Compile parses a selector and returns, if successful, a Selector object -// that can be used to match against html.Node objects. -func Compile(sel string) (Selector, error) { - p := &parser{s: sel} - compiled, err := p.parseSelectorGroup() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// MustCompile is like Compile, but panics instead of returning an error. -func MustCompile(sel string) Selector { - compiled, err := Compile(sel) - if err != nil { - panic(err) - } - return compiled -} - -// MatchAll returns a slice of the nodes that match the selector, -// from n and its children. -func (s Selector) MatchAll(n *html.Node) []*html.Node { - return s.matchAllInto(n, nil) -} - -func (s Selector) matchAllInto(n *html.Node, storage []*html.Node) []*html.Node { - if s(n) { - storage = append(storage, n) - } - - for child := n.FirstChild; child != nil; child = child.NextSibling { - storage = s.matchAllInto(child, storage) - } - - return storage -} - -// Match returns true if the node matches the selector. -func (s Selector) Match(n *html.Node) bool { - return s(n) -} - -// MatchFirst returns the first node that matches s, from n and its children. -func (s Selector) MatchFirst(n *html.Node) *html.Node { - if s.Match(n) { - return n - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - m := s.MatchFirst(c) - if m != nil { - return m - } - } - return nil -} - -// Filter returns the nodes in nodes that match the selector. -func (s Selector) Filter(nodes []*html.Node) (result []*html.Node) { - for _, n := range nodes { - if s(n) { - result = append(result, n) - } - } - return result -} - -// typeSelector returns a Selector that matches elements with a given tag name. -func typeSelector(tag string) Selector { - tag = toLowerASCII(tag) - return func(n *html.Node) bool { - return n.Type == html.ElementNode && n.Data == tag - } -} - -// toLowerASCII returns s with all ASCII capital letters lowercased. -func toLowerASCII(s string) string { - var b []byte - for i := 0; i < len(s); i++ { - if c := s[i]; 'A' <= c && c <= 'Z' { - if b == nil { - b = make([]byte, len(s)) - copy(b, s) - } - b[i] = s[i] + ('a' - 'A') - } - } - - if b == nil { - return s - } - - return string(b) -} - -// attributeSelector returns a Selector that matches elements -// where the attribute named key satisifes the function f. -func attributeSelector(key string, f func(string) bool) Selector { - key = toLowerASCII(key) - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - for _, a := range n.Attr { - if a.Key == key && f(a.Val) { - return true - } - } - return false - } -} - -// attributeExistsSelector returns a Selector that matches elements that have -// an attribute named key. -func attributeExistsSelector(key string) Selector { - return attributeSelector(key, func(string) bool { return true }) -} - -// attributeEqualsSelector returns a Selector that matches elements where -// the attribute named key has the value val. -func attributeEqualsSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - return s == val - }) -} - -// attributeNotEqualSelector returns a Selector that matches elements where -// the attribute named key does not have the value val. -func attributeNotEqualSelector(key, val string) Selector { - key = toLowerASCII(key) - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - for _, a := range n.Attr { - if a.Key == key && a.Val == val { - return false - } - } - return true - } -} - -// attributeIncludesSelector returns a Selector that matches elements where -// the attribute named key is a whitespace-separated list that includes val. -func attributeIncludesSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - for s != "" { - i := strings.IndexAny(s, " \t\r\n\f") - if i == -1 { - return s == val - } - if s[:i] == val { - return true - } - s = s[i+1:] - } - return false - }) -} - -// attributeDashmatchSelector returns a Selector that matches elements where -// the attribute named key equals val or starts with val plus a hyphen. -func attributeDashmatchSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - if s == val { - return true - } - if len(s) <= len(val) { - return false - } - if s[:len(val)] == val && s[len(val)] == '-' { - return true - } - return false - }) -} - -// attributePrefixSelector returns a Selector that matches elements where -// the attribute named key starts with val. -func attributePrefixSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - return strings.HasPrefix(s, val) - }) -} - -// attributeSuffixSelector returns a Selector that matches elements where -// the attribute named key ends with val. -func attributeSuffixSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - return strings.HasSuffix(s, val) - }) -} - -// attributeSubstringSelector returns a Selector that matches nodes where -// the attribute named key contains val. -func attributeSubstringSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - return strings.Contains(s, val) - }) -} - -// attributeRegexSelector returns a Selector that matches nodes where -// the attribute named key matches the regular expression rx -func attributeRegexSelector(key string, rx *regexp.Regexp) Selector { - return attributeSelector(key, - func(s string) bool { - return rx.MatchString(s) - }) -} - -// intersectionSelector returns a selector that matches nodes that match -// both a and b. -func intersectionSelector(a, b Selector) Selector { - return func(n *html.Node) bool { - return a(n) && b(n) - } -} - -// unionSelector returns a selector that matches elements that match -// either a or b. -func unionSelector(a, b Selector) Selector { - return func(n *html.Node) bool { - return a(n) || b(n) - } -} - -// negatedSelector returns a selector that matches elements that do not match a. -func negatedSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return !a(n) - } -} - -// writeNodeText writes the text contained in n and its descendants to b. -func writeNodeText(n *html.Node, b *bytes.Buffer) { - switch n.Type { - case html.TextNode: - b.WriteString(n.Data) - case html.ElementNode: - for c := n.FirstChild; c != nil; c = c.NextSibling { - writeNodeText(c, b) - } - } -} - -// nodeText returns the text contained in n and its descendants. -func nodeText(n *html.Node) string { - var b bytes.Buffer - writeNodeText(n, &b) - return b.String() -} - -// nodeOwnText returns the contents of the text nodes that are direct -// children of n. -func nodeOwnText(n *html.Node) string { - var b bytes.Buffer - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.TextNode { - b.WriteString(c.Data) - } - } - return b.String() -} - -// textSubstrSelector returns a selector that matches nodes that -// contain the given text. -func textSubstrSelector(val string) Selector { - return func(n *html.Node) bool { - text := strings.ToLower(nodeText(n)) - return strings.Contains(text, val) - } -} - -// ownTextSubstrSelector returns a selector that matches nodes that -// directly contain the given text -func ownTextSubstrSelector(val string) Selector { - return func(n *html.Node) bool { - text := strings.ToLower(nodeOwnText(n)) - return strings.Contains(text, val) - } -} - -// textRegexSelector returns a selector that matches nodes whose text matches -// the specified regular expression -func textRegexSelector(rx *regexp.Regexp) Selector { - return func(n *html.Node) bool { - return rx.MatchString(nodeText(n)) - } -} - -// ownTextRegexSelector returns a selector that matches nodes whose text -// directly matches the specified regular expression -func ownTextRegexSelector(rx *regexp.Regexp) Selector { - return func(n *html.Node) bool { - return rx.MatchString(nodeOwnText(n)) - } -} - -// hasChildSelector returns a selector that matches elements -// with a child that matches a. -func hasChildSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return hasChildMatch(n, a) - } -} - -// hasDescendantSelector returns a selector that matches elements -// with any descendant that matches a. -func hasDescendantSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return hasDescendantMatch(n, a) - } -} - -// nthChildSelector returns a selector that implements :nth-child(an+b). -// If last is true, implements :nth-last-child instead. -// If ofType is true, implements :nth-of-type instead. -func nthChildSelector(a, b int, last, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - i := -1 - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - i = count - if !last { - break - } - } - } - - if i == -1 { - // This shouldn't happen, since n should always be one of its parent's children. - return false - } - - if last { - i = count - i + 1 - } - - i -= b - if a == 0 { - return i == 0 - } - - return i%a == 0 && i/a >= 0 - } -} - -// simpleNthChildSelector returns a selector that implements :nth-child(b). -// If ofType is true, implements :nth-of-type instead. -func simpleNthChildSelector(b int, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false - } -} - -// simpleNthLastChildSelector returns a selector that implements -// :nth-last-child(b). If ofType is true, implements :nth-last-of-type -// instead. -func simpleNthLastChildSelector(b int, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.LastChild; c != nil; c = c.PrevSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false - } -} - -// onlyChildSelector returns a selector that implements :only-child. -// If ofType is true, it implements :only-of-type instead. -func onlyChildSelector(ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) { - continue - } - count++ - if count > 1 { - return false - } - } - - return count == 1 - } -} - -// inputSelector is a Selector that matches input, select, textarea and button elements. -func inputSelector(n *html.Node) bool { - return n.Type == html.ElementNode && (n.Data == "input" || n.Data == "select" || n.Data == "textarea" || n.Data == "button") -} - -// emptyElementSelector is a Selector that matches empty elements. -func emptyElementSelector(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - switch c.Type { - case html.ElementNode, html.TextNode: - return false - } - } - - return true -} - -// descendantSelector returns a Selector that matches an element if -// it matches d and has an ancestor that matches a. -func descendantSelector(a, d Selector) Selector { - return func(n *html.Node) bool { - if !d(n) { - return false - } - - for p := n.Parent; p != nil; p = p.Parent { - if a(p) { - return true - } - } - - return false - } -} - -// childSelector returns a Selector that matches an element if -// it matches d and its parent matches a. -func childSelector(a, d Selector) Selector { - return func(n *html.Node) bool { - return d(n) && n.Parent != nil && a(n.Parent) - } -} - -// siblingSelector returns a Selector that matches an element -// if it matches s2 and in is preceded by an element that matches s1. -// If adjacent is true, the sibling must be immediately before the element. -func siblingSelector(s1, s2 Selector, adjacent bool) Selector { - return func(n *html.Node) bool { - if !s2(n) { - return false - } - - if adjacent { - for n = n.PrevSibling; n != nil; n = n.PrevSibling { - if n.Type == html.TextNode || n.Type == html.CommentNode { - continue - } - return s1(n) - } - return false - } - - // Walk backwards looking for element that matches s1 - for c := n.PrevSibling; c != nil; c = c.PrevSibling { - if s1(c) { - return true - } - } - - return false - } -} - -// rootSelector implements :root -func rootSelector(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - if n.Parent == nil { - return false - } - return n.Parent.Type == html.DocumentNode -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/.gitignore b/vendor/github.com/andygrunwald/go-gerrit/.gitignore deleted file mode 100644 index 4c7d39ea..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/coverage.txt \ No newline at end of file diff --git a/vendor/github.com/andygrunwald/go-gerrit/.travis.yml b/vendor/github.com/andygrunwald/go-gerrit/.travis.yml deleted file mode 100644 index fb073553..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -sudo: false - -go: - - "1.12.x" - - "1.11.x" - - "1.10.x" - -before_install: - - make deps - -script: - - make - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/andygrunwald/go-gerrit/CHANGELOG.md b/vendor/github.com/andygrunwald/go-gerrit/CHANGELOG.md deleted file mode 100644 index 2052a6c5..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/CHANGELOG.md +++ /dev/null @@ -1,105 +0,0 @@ -# Changelog - -This is a high level log of changes, bugfixes, enhancements, etc -that have taken place between releases. Later versions are shown -first. For more complete details see -[the releases on GitHub.](https://github.com/andygrunwald/go-gerrit/releases) - -## Versions - -### Latest - -### 0.5.2 - -* Fix panic in checkAuth() if Gerrit is down #42 -* Implement ListVotes(), DeleteVotes() and add missing tests - -### 0.5.1 - -* Added the `AbandonChange`, `RebaseChange`, `RestoreChange` and - `RevertChange` functions. - -### 0.5.0 - -**WARNING**: This release includes breaking changes. - -* [BREAKING CHANGE] The SetReview function was returning the wrong - entity type. (#40) - -### 0.4.0 - -**WARNING**: This release includes breaking changes. - -* [BREAKING CHANGE] - Added gometalinter to the build and fixed problems - discovered by the linters. - * Comment and error string fixes. - * Numerous lint and styling fixes. - * Ensured error values are being properly checked where appropriate. - * Addition of missing documentation - * Removed filePath parameter from DeleteChangeEdit which was unused and - unnecessary for the request. - * Fixed CherryPickRevision and IncludeGroups functions which didn't pass - along the provided input structs into the request. -* Go 1.5 has been removed from testing on Travis. The linters introduced in - 0.4.0 do not support this version, Go 1.5 is lacking security updates and - most Linux distros have moved beyond Go 1.5 now. -* Add Go 1.9 to the Travis matrix. -* Fixed an issue where urls containing certain characters in the credentials - could cause NewClient() to use an invalid url. Something like `/`, which - Gerrit could use for generated passwords, for example would break url.Parse's - expectations. - -### 0.3.0 - -**WARNING**: This release includes breaking changes. - -* [BREAKING CHANGE] Fix Changes.PublishDraftChange to accept a notify parameter. -* [BREAKING CHANGE] Fix PublishChangeEdit to accept a notify parameter. -* [BREAKING CHANGE] Fix ChangeFileContentInChangeEdit to allow the file content - to be included in the request. -* Fix the url being used by CreateChange -* Fix type serialization of EventInfo.PatchSet.Number so it's consistent. -* Fix Changes.AddReviewer so it passes along the reviewer to the request. -* Simplify and optimize RemoveMagicPrefixLine - -### 0.2.0 - -**WARNING**: This release includes breaking changes. - -* [BREAKING CHANGE] Several bugfixes to GetEvents: - * Update EventInfo to handle the changeKey field and apply - the proper type for the Project field - * Provide a means to ignore marshaling errors - * Update GetEvents() to return the failed lines and remove - the pointer to the return value because it's unnecessary. -* [BREAKING CHANGE] In ec28f77 `ChangeInfo.Labels` has been changed to map - to fix #21. - - -### 0.1.1 - -* Minor fix to SubmitChange to use the `http.StatusConflict` constant - instead of a hard coded value when comparing response codes. -* Updated AccountInfo.AccountID to be omitted of empty (such as when - used in ApprovalInfo). -* + and : in url parameters for queries are no longer escaped. This was - causing `400 Bad Request` to be returned when the + symbol was - included as part of the query. To match behavior with Gerrit's search - handling, the : symbol was also excluded. -* Fixed documentation for NewClient and moved fmt.Errorf call from - inside the function to a `ErrNoInstanceGiven` variable so it's - easier to compare against. -* Updated internal function digestAuthHeader to return exported errors - (ErrWWWAuthenticateHeader*) rather than calling fmt.Errorf. This makes - it easier to test against externally and also fixes a lint issue too. -* Updated NewClient function to handle credentials in the url. -* Added the missing `Submitted` field to `ChangeInfo`. -* Added the missing `URL` field to `ChangeInfo` which is usually included - as part of an event from the events-log plugin. - -### 0.1.0 - -* The first official release -* Implemented digest auth and several fixes for it. -* Ensured Content-Type is included in all requests -* Fixed several internal bugs as well as a few documentation issues diff --git a/vendor/github.com/andygrunwald/go-gerrit/LICENSE b/vendor/github.com/andygrunwald/go-gerrit/LICENSE deleted file mode 100644 index 692f6bea..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Andy Grunwald - -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. - diff --git a/vendor/github.com/andygrunwald/go-gerrit/Makefile b/vendor/github.com/andygrunwald/go-gerrit/Makefile deleted file mode 100644 index 82f6ff2d..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -.PHONY: fmt vet lint check test -PACKAGES = $(shell go list ./...) -PACKAGE_DIRS = $(shell go list -f '{{ .Dir }}' ./...) - -check: test vet lint - -test: - go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... - -vet: - go vet $(PACKAGES) || (go clean $(PACKAGES); go vet $(PACKAGES)) - -lint: - gometalinter --config gometalinter.json ./... - -fmt: - go fmt $(PACKAGES) - goimports -w $(PACKAGE_DIRS) - -deps: - go get -t -v ./... - go get github.com/axw/gocov/gocov - go get golang.org/x/tools/cmd/cover - [ -f $(GOPATH)/bin/gometalinter ] || go get -u github.com/alecthomas/gometalinter - [ -f $(GOPATH)/bin/goimports ] || go get golang.org/x/tools/cmd/goimports - gometalinter --install diff --git a/vendor/github.com/andygrunwald/go-gerrit/README.md b/vendor/github.com/andygrunwald/go-gerrit/README.md deleted file mode 100644 index 8f8849d1..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/README.md +++ /dev/null @@ -1,270 +0,0 @@ -# go-gerrit - -[![GoDoc](https://godoc.org/github.com/andygrunwald/go-gerrit?status.svg)](https://godoc.org/github.com/andygrunwald/go-gerrit) -[![Build Status](https://travis-ci.org/andygrunwald/go-gerrit.svg?branch=master)](https://travis-ci.org/andygrunwald/go-gerrit) -[![Go Report Card](https://goreportcard.com/badge/github.com/andygrunwald/go-gerrit)](https://goreportcard.com/report/github.com/andygrunwald/go-gerrit) -[![codecov](https://codecov.io/gh/andygrunwald/go-gerrit/branch/master/graph/badge.svg)](https://codecov.io/gh/andygrunwald/go-gerrit) - -go-gerrit is a [Go(lang)](https://golang.org/) client library for accessing the [Gerrit Code Review](https://www.gerritcodereview.com/) API. - -![go-gerrit - Go(lang) client/library for Gerrit Code Review](./img/logo.png "go-gerrit - Go(lang) client/library for Gerrit Code Review") - -## Features - -* [Authentication](https://godoc.org/github.com/andygrunwald/go-gerrit#AuthenticationService) (HTTP Basic, HTTP Digest, HTTP Cookie) -* Every API Endpoint like Gerrit - * [/access/](https://godoc.org/github.com/andygrunwald/go-gerrit#AccessService) - * [/accounts/](https://godoc.org/github.com/andygrunwald/go-gerrit#AccountsService) - * [/changes/](https://godoc.org/github.com/andygrunwald/go-gerrit#ChangesService) - * [/config/](https://godoc.org/github.com/andygrunwald/go-gerrit#ConfigService) - * [/groups/](https://godoc.org/github.com/andygrunwald/go-gerrit#GroupsService) - * [/plugins/](https://godoc.org/github.com/andygrunwald/go-gerrit#PluginsService) - * [/projects/](https://godoc.org/github.com/andygrunwald/go-gerrit#ProjectsService) -* Supports optional plugin APIs such as - * events-log - [About](https://gerrit.googlesource.com/plugins/events-log/+/master/src/main/resources/Documentation/about.md), [REST API](https://gerrit.googlesource.com/plugins/events-log/+/master/src/main/resources/Documentation/rest-api-events.md) - - -## Installation - -go-gerrit requires Go version 1.10 or greater. - -It is go gettable ... - -```sh -$ go get github.com/andygrunwald/go-gerrit -``` - -... (optional) to run checks and tests: - -**Tests Only** - -```sh -$ cd $GOPATH/src/github.com/andygrunwald/go-gerrit -$ go test -v -``` - -**Checks, Tests, Linters, etc** - -```sh -$ cd $GOPATH/src/github.com/andygrunwald/go-gerrit -$ make -``` - -## API / Usage - -Please have a look at the [GoDoc documentation](https://godoc.org/github.com/andygrunwald/go-gerrit) for a detailed API description. - -The [Gerrit Code Review - REST API](https://gerrit-review.googlesource.com/Documentation/rest-api.html) was the base document. - -### Authentication - -Gerrit support multiple ways for [authentication](https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication). - -#### HTTP Basic - -Some Gerrit instances (like [TYPO3](https://review.typo3.org/)) has [auth.gitBasicAuth](https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#auth.gitBasicAuth) activated. -With this you can authenticate with HTTP Basic like this: - -```go -instance := "https://review.typo3.org/" -client, _ := gerrit.NewClient(instance, nil) -client.Authentication.SetBasicAuth("andy.grunwald", "my secrect password") - -self, _, _ := client.Accounts.GetAccount("self") - -fmt.Printf("Username: %s", self.Name) - -// Username: Andy Grunwald -``` - -If you get an `401 Unauthorized`, check your Account Settings and have a look at the `HTTP Password` configuration. - -#### HTTP Digest - -Some Gerrit instances (like [Wikimedia](https://gerrit.wikimedia.org/)) has [Digest access authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) activated. - -```go -instance := "https://gerrit.wikimedia.org/r/" -client, _ := gerrit.NewClient(instance, nil) -client.Authentication.SetDigestAuth("andy.grunwald", "my secrect http password") - -self, resp, err := client.Accounts.GetAccount("self") - -fmt.Printf("Username: %s", self.Name) - -// Username: Andy Grunwald -``` - -If digest auth is not supported by the choosen Gerrit instance, an error like `WWW-Authenticate header type is not Digest` is thrown. - -If you get an `401 Unauthorized`, check your Account Settings and have a look at the `HTTP Password` configuration. - -#### HTTP Cookie - -Some Gerrit instances hosted like the one hosted googlesource.com (e.g. [Go(lang)](https://go-review.googlesource.com/), [Android](https://android-review.googlesource.com/) or [Gerrit](https://gerrit-review.googlesource.com/)) support HTTP Cookie authentication. - -You need the cookie name and the cookie value. -You can get them by click on "Settings > HTTP Password > Obtain Password" in your Gerrit instance. - -There you can receive your values. -The cookie name will be (mostly) `o` (if hosted on googlesource.com). -Your cookie secret will be something like `git-your@email.com=SomeHash...`. - -```go -instance := "https://gerrit-review.googlesource.com/" -client, _ := gerrit.NewClient(instance, nil) -client.Authentication.SetCookieAuth("o", "my-cookie-secret") - -self, _, _ := client.Accounts.GetAccount("self") - -fmt.Printf("Username: %s", self.Name) - -// Username: Andy G. -``` - -### More more more - -In the examples chapter below you will find a few more examples. -If you miss one or got a question how to do something please [open a new issue](https://github.com/andygrunwald/go-gerrit/issues/new) with your question. -We will be happy to answer them. - -## Examples - -Further a few examples how the API can be used. -A few more examples are available in the [GoDoc examples section](https://godoc.org/github.com/andygrunwald/go-gerrit#pkg-examples). - -### Get version of Gerrit instance - -Receive the version of the [Gerrit instance used by the Gerrit team](https://gerrit-review.googlesource.com/) for development: - -```go -package main - -import ( - "fmt" - "github.com/andygrunwald/go-gerrit" -) - -func main() { - instance := "https://gerrit-review.googlesource.com/" - client, err := gerrit.NewClient(instance, nil) - if err != nil { - panic(err) - } - - v, _, err := client.Config.GetVersion() - - fmt.Printf("Version: %s", v) - - // Version: 2.12.2-2512-g0b1bccd -} -``` - -### Get all public projects - -List all projects from [Chromium](https://chromium-review.googlesource.com/): - -```go -package main - -import ( - "fmt" - "github.com/andygrunwald/go-gerrit" -) - -func main() { - instance := "https://chromium-review.googlesource.com/" - client, err := gerrit.NewClient(instance, nil) - if err != nil { - panic(err) - } - - opt := &gerrit.ProjectOptions{ - Description: true, - } - projects, _, err := client.Projects.ListProjects(opt) - for name, p := range *projects { - fmt.Printf("%s - State: %s\n", name, p.State) - } - - // chromiumos/platform/depthcharge - State: ACTIVE - // external/github.com/maruel/subcommands - State: ACTIVE - // external/junit - State: ACTIVE - // ... -} -``` - -### Query changes - -Get some changes of the [kernel/common project](https://android-review.googlesource.com/#/q/project:kernel/common) from the [Android](http://source.android.com/) [Gerrit Review System](https://android-review.googlesource.com/). - -```go -package main - -import ( - "fmt" - "github.com/andygrunwald/go-gerrit" -) - -func main() { - instance := "https://android-review.googlesource.com/" - client, err := gerrit.NewClient(instance, nil) - if err != nil { - panic(err) - } - - opt := &gerrit.QueryChangeOptions{} - opt.Query = []string{"project:kernel/common"} - opt.AdditionalFields = []string{"LABELS"} - changes, _, err := client.Changes.QueryChanges(opt) - - for _, change := range *changes { - fmt.Printf("Project: %s -> %s -> %s%d\n", change.Project, change.Subject, instance, change.Number) - } - - // Project: kernel/common -> android: binder: Fix BR_ERROR usage and change LSM denials to use it. -> https://android-review.googlesource.com/150839 - // Project: kernel/common -> android: binder: fix duplicate error return. -> https://android-review.googlesource.com/155031 - // Project: kernel/common -> dm-verity: Add modes and emit uevent on corrupted blocks -> https://android-review.googlesource.com/169572 - // ... -} -``` - -## FAQ - -### How is the source code organized? - -The source code organisation was inspired by [go-github by Google](https://github.com/google/go-github). - -Every REST API Endpoint (e.g. [/access/](https://gerrit-review.googlesource.com/Documentation/rest-api-access.html) or [/changes/](https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html)) is coupled in a service (e.g. [AccessService in access.go](./access.go) or [ChangesService in changes.go](./changes.go)). -Every service is part of [gerrit.Client](./gerrit.go) as a member variable. - -gerrit.Client can provide basic helper functions to avoid unnecessary code duplications such as building a new request, parse responses and so on. - -Based on this structure implementing a new API functionality is straight forwarded. Here is an example of *ChangeService.DeleteTopic* / [DELETE /changes/{change-id}/topic](https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-topic): - -```go -func (s *ChangesService) DeleteTopic(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/topic", changeID) - return s.client.DeleteRequest(u, nil) -} -``` - -### What about the version compatibility with Gerrit? - -The library was implemented based on the REST API of Gerrit version 2.11.3-1230-gb8336f1 and tested against this version. - -This library might be working with older versions as well. -If you notice an incompatibility [open a new issue](https://github.com/andygrunwald/go-gerrit/issues/new) or try to fix it. -We welcome contribution! - - -### What about adding code to support the REST API of an optional plugin? - -It will depend on the plugin, you are welcome to [open a new issue](https://github.com/andygrunwald/go-gerrit/issues/new) first to propose the idea if you wish. -As an example the addition of support for events-log plugin was supported because the plugin itself is fairly -popular and the structures that the REST API uses could also be used by `gerrit stream-events`. - - -## License - -This project is released under the terms of the [MIT license](http://en.wikipedia.org/wiki/MIT_License). diff --git a/vendor/github.com/andygrunwald/go-gerrit/access.go b/vendor/github.com/andygrunwald/go-gerrit/access.go deleted file mode 100644 index d3237a8c..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/access.go +++ /dev/null @@ -1,74 +0,0 @@ -package gerrit - -// AccessService contains Access Right related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html -type AccessService struct { - client *Client -} - -// AccessSectionInfo describes the access rights that are assigned on a ref. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#access-section-info -type AccessSectionInfo struct { - Permissions map[string]PermissionInfo `json:"permissions"` -} - -// PermissionInfo entity contains information about an assigned permission. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#permission-info -type PermissionInfo struct { - Label string `json:"label,omitempty"` - Exclusive bool `json:"exclusive"` - Rules map[string]PermissionRuleInfo `json:"rules"` -} - -// PermissionRuleInfo entity contains information about a permission rule that is assigned to group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#permission-rule-info -type PermissionRuleInfo struct { - // TODO Possible values for action: ALLOW, DENY or BLOCK, INTERACTIVE and BATCH - Action string `json:"action"` - Force bool `json:"force"` - Min int `json:"min"` - Max int `json:"max"` -} - -// ProjectAccessInfo entity contains information about the access rights for a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#project-access-info -type ProjectAccessInfo struct { - Revision string `json:"revision"` - InheritsFrom ProjectInfo `json:"inherits_from"` - Local map[string]AccessSectionInfo `json:"local"` - IsOwner bool `json:"is_owner"` - OwnerOf []string `json:"owner_of"` - CanUpload bool `json:"can_upload"` - CanAdd bool `json:"can_add"` - ConfigVisible bool `json:"config_visible"` -} - -// ListAccessRightsOptions specifies the parameters to the AccessService.ListAccessRights. -type ListAccessRightsOptions struct { - // The projects for which the access rights should be returned must be specified as project options. - // The project can be specified multiple times. - Project []string `url:"project,omitempty"` -} - -// ListAccessRights lists the access rights for projects. -// As result a map is returned that maps the project name to ProjectAccessInfo entities. -// The entries in the map are sorted by project name. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-access.html#list-access -func (s *AccessService) ListAccessRights(opt *ListAccessRightsOptions) (*map[string]ProjectAccessInfo, *Response, error) { - u := "access/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - v := new(map[string]ProjectAccessInfo) - resp, err := s.client.Call("GET", u, nil, v) - return v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/accounts.go b/vendor/github.com/andygrunwald/go-gerrit/accounts.go deleted file mode 100644 index 3f828635..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/accounts.go +++ /dev/null @@ -1,874 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// AccountsService contains Account related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html -type AccountsService struct { - client *Client -} - -// AccountInfo entity contains information about an account. -type AccountInfo struct { - AccountID int `json:"_account_id,omitempty"` - Name string `json:"name,omitempty"` - Email string `json:"email,omitempty"` - Username string `json:"username,omitempty"` - - // Avatars lists avatars of various sizes for the account. - // This field is only populated if the avatars plugin is enabled. - Avatars []struct { - URL string `json:"url,omitempty"` - Height int `json:"height,omitempty"` - } `json:"avatars,omitempty"` -} - -// SSHKeyInfo entity contains information about an SSH key of a user. -type SSHKeyInfo struct { - Seq int `json:"seq"` - SSHPublicKey string `json:"ssh_public_key"` - EncodedKey string `json:"encoded_key"` - Algorithm string `json:"algorithm"` - Comment string `json:"comment,omitempty"` - Valid bool `json:"valid"` -} - -// UsernameInput entity contains information for setting the username for an account. -type UsernameInput struct { - Username string `json:"username"` -} - -// QueryLimitInfo entity contains information about the Query Limit of a user. -type QueryLimitInfo struct { - Min int `json:"min"` - Max int `json:"max"` -} - -// HTTPPasswordInput entity contains information for setting/generating an HTTP password. -type HTTPPasswordInput struct { - Generate bool `json:"generate,omitempty"` - HTTPPassword string `json:"http_password,omitempty"` -} - -// GpgKeysInput entity contains information for adding/deleting GPG keys. -type GpgKeysInput struct { - Add []string `json:"add"` - Delete []string `json:"delete"` -} - -// GpgKeyInfo entity contains information about a GPG public key. -type GpgKeyInfo struct { - ID string `json:"id,omitempty"` - Fingerprint string `json:"fingerprint,omitempty"` - UserIDs []string `json:"user_ids,omitempty"` - Key string `json:"key,omitempty"` -} - -// EmailInput entity contains information for registering a new email address. -type EmailInput struct { - Email string `json:"email"` - Preferred bool `json:"preferred,omitempty"` - NoConfirmation bool `json:"no_confirmation,omitempty"` -} - -// EmailInfo entity contains information about an email address of a user. -type EmailInfo struct { - Email string `json:"email"` - Preferred bool `json:"preferred,omitempty"` - PendingConfirmation bool `json:"pending_confirmation,omitempty"` -} - -// AccountInput entity contains information for the creation of a new account. -type AccountInput struct { - Username string `json:"username,omitempty"` - Name string `json:"name,omitempty"` - Email string `json:"email,omitempty"` - SSHKey string `json:"ssh_key,omitempty"` - HTTPPassword string `json:"http_password,omitempty"` - Groups []string `json:"groups,omitempty"` -} - -// AccountDetailInfo entity contains detailed information about an account. -type AccountDetailInfo struct { - AccountInfo - RegisteredOn Timestamp `json:"registered_on"` -} - -// AccountNameInput entity contains information for setting a name for an account. -type AccountNameInput struct { - Name string `json:"name,omitempty"` -} - -// AccountCapabilityInfo entity contains information about the global capabilities of a user. -type AccountCapabilityInfo struct { - AccessDatabase bool `json:"accessDatabase,omitempty"` - AdministrateServer bool `json:"administrateServer,omitempty"` - CreateAccount bool `json:"createAccount,omitempty"` - CreateGroup bool `json:"createGroup,omitempty"` - CreateProject bool `json:"createProject,omitempty"` - EmailReviewers bool `json:"emailReviewers,omitempty"` - FlushCaches bool `json:"flushCaches,omitempty"` - KillTask bool `json:"killTask,omitempty"` - MaintainServer bool `json:"maintainServer,omitempty"` - Priority string `json:"priority,omitempty"` - QueryLimit QueryLimitInfo `json:"queryLimit"` - RunAs bool `json:"runAs,omitempty"` - RunGC bool `json:"runGC,omitempty"` - StreamEvents bool `json:"streamEvents,omitempty"` - ViewAllAccounts bool `json:"viewAllAccounts,omitempty"` - ViewCaches bool `json:"viewCaches,omitempty"` - ViewConnections bool `json:"viewConnections,omitempty"` - ViewPlugins bool `json:"viewPlugins,omitempty"` - ViewQueue bool `json:"viewQueue,omitempty"` -} - -// DiffPreferencesInfo entity contains information about the diff preferences of a user. -type DiffPreferencesInfo struct { - Context int `json:"context"` - Theme string `json:"theme"` - ExpandAllComments bool `json:"expand_all_comments,omitempty"` - IgnoreWhitespace string `json:"ignore_whitespace"` - IntralineDifference bool `json:"intraline_difference,omitempty"` - LineLength int `json:"line_length"` - ManualReview bool `json:"manual_review,omitempty"` - RetainHeader bool `json:"retain_header,omitempty"` - ShowLineEndings bool `json:"show_line_endings,omitempty"` - ShowTabs bool `json:"show_tabs,omitempty"` - ShowWhitespaceErrors bool `json:"show_whitespace_errors,omitempty"` - SkipDeleted bool `json:"skip_deleted,omitempty"` - SkipUncommented bool `json:"skip_uncommented,omitempty"` - SyntaxHighlighting bool `json:"syntax_highlighting,omitempty"` - HideTopMenu bool `json:"hide_top_menu,omitempty"` - AutoHideDiffTableHeader bool `json:"auto_hide_diff_table_header,omitempty"` - HideLineNumbers bool `json:"hide_line_numbers,omitempty"` - TabSize int `json:"tab_size"` - HideEmptyPane bool `json:"hide_empty_pane,omitempty"` -} - -// DiffPreferencesInput entity contains information for setting the diff preferences of a user. -// Fields which are not set will not be updated. -type DiffPreferencesInput struct { - Context int `json:"context,omitempty"` - ExpandAllComments bool `json:"expand_all_comments,omitempty"` - IgnoreWhitespace string `json:"ignore_whitespace,omitempty"` - IntralineDifference bool `json:"intraline_difference,omitempty"` - LineLength int `json:"line_length,omitempty"` - ManualReview bool `json:"manual_review,omitempty"` - RetainHeader bool `json:"retain_header,omitempty"` - ShowLineEndings bool `json:"show_line_endings,omitempty"` - ShowTabs bool `json:"show_tabs,omitempty"` - ShowWhitespaceErrors bool `json:"show_whitespace_errors,omitempty"` - SkipDeleted bool `json:"skip_deleted,omitempty"` - SkipUncommented bool `json:"skip_uncommented,omitempty"` - SyntaxHighlighting bool `json:"syntax_highlighting,omitempty"` - HideTopMenu bool `json:"hide_top_menu,omitempty"` - AutoHideDiffTableHeader bool `json:"auto_hide_diff_table_header,omitempty"` - HideLineNumbers bool `json:"hide_line_numbers,omitempty"` - TabSize int `json:"tab_size,omitempty"` -} - -// PreferencesInfo entity contains information about a user’s preferences. -type PreferencesInfo struct { - ChangesPerPage int `json:"changes_per_page"` - ShowSiteHeader bool `json:"show_site_header,omitempty"` - UseFlashClipboard bool `json:"use_flash_clipboard,omitempty"` - DownloadScheme string `json:"download_scheme"` - DownloadCommand string `json:"download_command"` - CopySelfOnEmail bool `json:"copy_self_on_email,omitempty"` - DateFormat string `json:"date_format"` - TimeFormat string `json:"time_format"` - RelativeDateInChangeTable bool `json:"relative_date_in_change_table,omitempty"` - SizeBarInChangeTable bool `json:"size_bar_in_change_table,omitempty"` - LegacycidInChangeTable bool `json:"legacycid_in_change_table,omitempty"` - MuteCommonPathPrefixes bool `json:"mute_common_path_prefixes,omitempty"` - ReviewCategoryStrategy string `json:"review_category_strategy"` - DiffView string `json:"diff_view"` - My []TopMenuItemInfo `json:"my"` - URLAliases string `json:"url_aliases,omitempty"` -} - -// PreferencesInput entity contains information for setting the user preferences. -// Fields which are not set will not be updated. -type PreferencesInput struct { - ChangesPerPage int `json:"changes_per_page,omitempty"` - ShowSiteHeader bool `json:"show_site_header,omitempty"` - UseFlashClipboard bool `json:"use_flash_clipboard,omitempty"` - DownloadScheme string `json:"download_scheme,omitempty"` - DownloadCommand string `json:"download_command,omitempty"` - CopySelfOnEmail bool `json:"copy_self_on_email,omitempty"` - DateFormat string `json:"date_format,omitempty"` - TimeFormat string `json:"time_format,omitempty"` - RelativeDateInChangeTable bool `json:"relative_date_in_change_table,omitempty"` - SizeBarInChangeTable bool `json:"size_bar_in_change_table,omitempty"` - LegacycidInChangeTable bool `json:"legacycid_in_change_table,omitempty"` - MuteCommonPathPrefixes bool `json:"mute_common_path_prefixes,omitempty"` - ReviewCategoryStrategy string `json:"review_category_strategy,omitempty"` - DiffView string `json:"diff_view,omitempty"` - My []TopMenuItemInfo `json:"my,omitempty"` - URLAliases string `json:"url_aliases,omitempty"` -} - -// CapabilityOptions specifies the parameters to filter for capabilities. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-capabilities -type CapabilityOptions struct { - // To filter the set of global capabilities the q parameter can be used. - // Filtering may decrease the response time by avoiding looking at every possible alternative for the caller. - Filter []string `url:"q,omitempty"` -} - -// GetAccount returns an account as an AccountInfo entity. -// If account is "self" the current authenticated account will be returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account -func (s *AccountsService) GetAccount(account string) (*AccountInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s", account) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetAccountDetails retrieves the details of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-detail -func (s *AccountsService) GetAccountDetails(accountID string) (*AccountDetailInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/detail", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(AccountDetailInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetAccountName retrieves the full name of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account-name -func (s *AccountsService) GetAccountName(accountID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/name", accountID) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetUsername retrieves the username of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-username -func (s *AccountsService) GetUsername(accountID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/username", accountID) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetHTTPPassword retrieves the HTTP password of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-http-password -func (s *AccountsService) GetHTTPPassword(accountID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/password.http", accountID) - return getStringResponseWithoutOptions(s.client, u) -} - -// ListAccountEmails returns the email addresses that are configured for the specified user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-emails -func (s *AccountsService) ListAccountEmails(accountID string) (*[]EmailInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/emails", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]EmailInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetAccountEmail retrieves an email address of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account-email -func (s *AccountsService) GetAccountEmail(accountID, emailID string) (*EmailInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/emails/%s", accountID, emailID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(EmailInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListSSHKeys returns the SSH keys of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-ssh-keys -func (s *AccountsService) ListSSHKeys(accountID string) (*[]SSHKeyInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/sshkeys", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]SSHKeyInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetSSHKey retrieves an SSH key of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-ssh-key -func (s *AccountsService) GetSSHKey(accountID, sshKeyID string) (*SSHKeyInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/sshkeys/%s", accountID, sshKeyID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(SSHKeyInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListGPGKeys returns the GPG keys of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-gpg-keys -func (s *AccountsService) ListGPGKeys(accountID string) (*map[string]GpgKeyInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/gpgkeys", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]GpgKeyInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetGPGKey retrieves a GPG key of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-gpg-key -func (s *AccountsService) GetGPGKey(accountID, gpgKeyID string) (*GpgKeyInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/gpgkeys/%s", accountID, gpgKeyID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GpgKeyInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListAccountCapabilities returns the global capabilities that are enabled for the specified user. -// If the global capabilities for the calling user should be listed, self can be used as account-id. -// This can be used by UI tools to discover if administrative features are available to the caller, so they can hide (or show) relevant UI actions. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-account-capabilities -func (s *AccountsService) ListAccountCapabilities(accountID string, opt *CapabilityOptions) (*AccountCapabilityInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/capabilities", accountID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(AccountCapabilityInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListGroups lists all groups that contain the specified user as a member. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#list-groups -func (s *AccountsService) ListGroups(accountID string) (*[]GroupInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/groups", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetUserPreferences retrieves the user’s preferences. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-user-preferences -func (s *AccountsService) GetUserPreferences(accountID string) (*PreferencesInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/preferences", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(PreferencesInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetDiffPreferences retrieves the diff preferences of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-diff-preferences -func (s *AccountsService) GetDiffPreferences(accountID string) (*DiffPreferencesInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/preferences.diff", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(DiffPreferencesInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetStarredChanges gets the changes starred by the identified user account. -// This URL endpoint is functionally identical to the changes query GET /changes/?q=is:starred. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-starred-changes -func (s *AccountsService) GetStarredChanges(accountID string) (*[]ChangeInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/starred.changes", accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SuggestAccount suggests users for a given query q and result limit n. -// If result limit is not passed, then the default 10 is used. -// Returns a list of matching AccountInfo entities. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#query-account -func (s *AccountsService) SuggestAccount(opt *QueryOptions) (*[]AccountInfo, *Response, error) { - u := "accounts/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateAccount creates a new account. -// In the request body additional data for the account can be provided as AccountInput. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#create-account -func (s *AccountsService) CreateAccount(username string, input *AccountInput) (*AccountInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s", username) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetAccountName sets the full name of an account. -// The new account name must be provided in the request body inside an AccountNameInput entity. -// -// As response the new account name is returned. -// If the name was deleted the response is “204 No Content”. -// Some realms may not allow to modify the account name. -// In this case the request is rejected with “405 Method Not Allowed”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-account-name -func (s *AccountsService) SetAccountName(accountID string, input *AccountNameInput) (*string, *Response, error) { - u := fmt.Sprintf("accounts/%s/name", accountID) - - // TODO Use here the getStringResponseWithoutOptions (for PUT requests) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteAccountName deletes the name of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-account-name -func (s *AccountsService) DeleteAccountName(accountID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/name", accountID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteActive sets the account state to inactive. -// If the account was already inactive the response is “404 Not Found”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-active -func (s *AccountsService) DeleteActive(accountID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/active", accountID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteHTTPPassword deletes the HTTP password of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-http-password -func (s *AccountsService) DeleteHTTPPassword(accountID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/password.http", accountID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteAccountEmail deletes an email address of an account. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-account-email -func (s *AccountsService) DeleteAccountEmail(accountID, emailID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/emails/%s", accountID, emailID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteSSHKey deletes an SSH key of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-ssh-key -func (s *AccountsService) DeleteSSHKey(accountID, sshKeyID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/sshkeys/%s", accountID, sshKeyID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteGPGKey deletes a GPG key of a user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#delete-gpg-key -func (s *AccountsService) DeleteGPGKey(accountID, gpgKeyID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/gpgkeys/%s", accountID, gpgKeyID) - return s.client.DeleteRequest(u, nil) -} - -// SetUsername sets a new username. -// The new username must be provided in the request body inside a UsernameInput entity. -// Once set, the username cannot be changed or deleted. -// If attempted this fails with “405 Method Not Allowed”. -// -// As response the new username is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-username -func (s *AccountsService) SetUsername(accountID string, input *UsernameInput) (*string, *Response, error) { - u := fmt.Sprintf("accounts/%s/username", accountID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetActive checks if an account is active. -// -// If the account is active the string ok is returned. -// If the account is inactive the response is “204 No Content”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-active -func (s *AccountsService) GetActive(accountID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/active", accountID) - return getStringResponseWithoutOptions(s.client, u) -} - -// SetActive sets the account state to active. -// -// If the account was already active the response is “200 OK”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-active -func (s *AccountsService) SetActive(accountID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/active", accountID) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, err - } - return s.client.Do(req, nil) -} - -// SetHTTPPassword sets/Generates the HTTP password of an account. -// The options for setting/generating the HTTP password must be provided in the request body inside a HTTPPasswordInput entity. -// -// As response the new HTTP password is returned. -// If the HTTP password was deleted the response is “204 No Content”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-http-password -func (s *AccountsService) SetHTTPPassword(accountID string, input *HTTPPasswordInput) (*string, *Response, error) { - u := fmt.Sprintf("accounts/%s/password.http", accountID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateAccountEmail registers a new email address for the user. -// A verification email is sent with a link that needs to be visited to confirm the email address, unless DEVELOPMENT_BECOME_ANY_ACCOUNT is used as authentication type. -// For the development mode email addresses are directly added without confirmation. -// A Gerrit administrator may add an email address without confirmation by setting no_confirmation in the EmailInput. -// In the request body additional data for the email address can be provided as EmailInput. -// -// As response the new email address is returned as EmailInfo entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#create-account-email -func (s *AccountsService) CreateAccountEmail(accountID, emailID string, input *EmailInput) (*EmailInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/emails/%s", accountID, emailID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(EmailInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetPreferredEmail sets an email address as preferred email address for an account. -// -// If the email address was already the preferred email address of the account the response is “200 OK”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-preferred-email -func (s *AccountsService) SetPreferredEmail(accountID, emailID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/emails/%s/preferred", accountID, emailID) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, err - } - return s.client.Do(req, nil) -} - -// GetAvatarChangeURL retrieves the URL where the user can change the avatar image. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-avatar-change-url -func (s *AccountsService) GetAvatarChangeURL(accountID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/avatar.change.url", accountID) - return getStringResponseWithoutOptions(s.client, u) -} - -// AddGPGKeys Add or delete one or more GPG keys for a user. -// The changes must be provided in the request body as a GpgKeysInput entity. -// Each new GPG key is provided in ASCII armored format, and must contain a self-signed certification matching a registered email or other identity of the user. -// -// As a response, the modified GPG keys are returned as a map of GpgKeyInfo entities, keyed by ID. Deleted keys are represented by an empty object. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#add-delete-gpg-keys -func (s *AccountsService) AddGPGKeys(accountID string, input *GpgKeysInput) (*map[string]GpgKeyInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/gpgkeys", accountID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(map[string]GpgKeyInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CheckAccountCapability checks if a user has a certain global capability. -// -// If the user has the global capability the string ok is returned. -// If the user doesn’t have the global capability the response is “404 Not Found”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#check-account-capability -func (s *AccountsService) CheckAccountCapability(accountID, capabilityID string) (string, *Response, error) { - u := fmt.Sprintf("accounts/%s/capabilities/%s", accountID, capabilityID) - return getStringResponseWithoutOptions(s.client, u) -} - -// SetUserPreferences sets the user’s preferences. -// The new preferences must be provided in the request body as a PreferencesInput entity. -// -// As result the new preferences of the user are returned as a PreferencesInfo entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-user-preferences -func (s *AccountsService) SetUserPreferences(accountID string, input *PreferencesInput) (*PreferencesInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/preferences", accountID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(PreferencesInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetDiffPreferences sets the diff preferences of a user. -// The new diff preferences must be provided in the request body as a DiffPreferencesInput entity. -// -// As result the new diff preferences of the user are returned as a DiffPreferencesInfo entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#set-diff-preferences -func (s *AccountsService) SetDiffPreferences(accountID string, input *DiffPreferencesInput) (*DiffPreferencesInfo, *Response, error) { - u := fmt.Sprintf("accounts/%s/preferences.diff", accountID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(DiffPreferencesInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// StarChange star a change. -// Starred changes are returned for the search query is:starred or starredby:USER and automatically notify the user whenever updates are made to the change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#star-change -func (s *AccountsService) StarChange(accountID, changeID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/starred.changes/%s", accountID, changeID) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// UnstarChange nstar a change. -// Removes the starred flag, stopping notifications. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#unstar-change -func (s *AccountsService) UnstarChange(accountID, changeID string) (*Response, error) { - u := fmt.Sprintf("accounts/%s/starred.changes/%s", accountID, changeID) - return s.client.DeleteRequest(u, nil) -} - -/* -Missing Account Endpoints: - Add SSH Key - Get Avatar -*/ diff --git a/vendor/github.com/andygrunwald/go-gerrit/authentication.go b/vendor/github.com/andygrunwald/go-gerrit/authentication.go deleted file mode 100644 index 193f6220..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/authentication.go +++ /dev/null @@ -1,187 +0,0 @@ -package gerrit - -import ( - "crypto/md5" // nolint: gosec - "crypto/rand" - "encoding/base64" - "errors" - "fmt" - "io" - "net/http" - "strings" -) - -var ( - // ErrWWWAuthenticateHeaderMissing is returned by digestAuthHeader when the WWW-Authenticate header is missing - ErrWWWAuthenticateHeaderMissing = errors.New("WWW-Authenticate header is missing") - - // ErrWWWAuthenticateHeaderInvalid is returned by digestAuthHeader when the WWW-Authenticate invalid - ErrWWWAuthenticateHeaderInvalid = errors.New("WWW-Authenticate header is invalid") - - // ErrWWWAuthenticateHeaderNotDigest is returned by digestAuthHeader when the WWW-Authenticate header is not 'Digest' - ErrWWWAuthenticateHeaderNotDigest = errors.New("WWW-Authenticate header type is not Digest") -) - -const ( - // HTTP Basic Authentication - authTypeBasic = 1 - // HTTP Digest Authentication - authTypeDigest = 2 - // HTTP Cookie Authentication - authTypeCookie = 3 -) - -// AuthenticationService contains Authentication related functions. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication -type AuthenticationService struct { - client *Client - - // Storage for authentication - // Username or name of cookie - name string - // Password or value of cookie - secret string - authType int -} - -// SetBasicAuth sets basic parameters for HTTP Basic auth -func (s *AuthenticationService) SetBasicAuth(username, password string) { - s.name = username - s.secret = password - s.authType = authTypeBasic -} - -// SetDigestAuth sets digest parameters for HTTP Digest auth. -func (s *AuthenticationService) SetDigestAuth(username, password string) { - s.name = username - s.secret = password - s.authType = authTypeDigest -} - -// digestAuthHeader is called by gerrit.Client.Do in the event the server -// returns 401 Unauthorized and authType was set to authTypeDigest. The -// resulting string is used to set the Authorization header before retrying -// the request. -func (s *AuthenticationService) digestAuthHeader(response *http.Response) (string, error) { - authenticateHeader := response.Header.Get("WWW-Authenticate") - if authenticateHeader == "" { - return "", ErrWWWAuthenticateHeaderMissing - } - - split := strings.SplitN(authenticateHeader, " ", 2) - if len(split) != 2 { - return "", ErrWWWAuthenticateHeaderInvalid - } - - if split[0] != "Digest" { - return "", ErrWWWAuthenticateHeaderNotDigest - } - - // Iterate over all the fields from the WWW-Authenticate header - // and create a map of keys and values. - authenticate := map[string]string{} - for _, value := range strings.Split(split[1], ",") { - kv := strings.SplitN(value, "=", 2) - if len(kv) != 2 { - continue - } - - key := strings.Trim(strings.Trim(kv[0], " "), "\"") - value := strings.Trim(strings.Trim(kv[1], " "), "\"") - authenticate[key] = value - } - - // Gerrit usually responds without providing the algorithm. According - // to RFC2617 if no algorithm is provided then the default is to use - // MD5. At the time this code was implemented Gerrit did not appear - // to support other algorithms or provide a means of changing the - // algorithm. - if value, ok := authenticate["algorithm"]; ok { - if value != "MD5" { - return "", fmt.Errorf( - "algorithm not implemented: %s", value) - } - } - - realmHeader := authenticate["realm"] - qopHeader := authenticate["qop"] - nonceHeader := authenticate["nonce"] - - // If the server does not inform us what the uri is supposed - // to be then use the last requests's uri instead. - if _, ok := authenticate["uri"]; !ok { - authenticate["uri"] = response.Request.URL.Path - } - - uriHeader := authenticate["uri"] - - // A1 - h := md5.New() // nolint: gosec - A1 := fmt.Sprintf("%s:%s:%s", s.name, realmHeader, s.secret) - if _, err := io.WriteString(h, A1); err != nil { - return "", err - } - HA1 := fmt.Sprintf("%x", h.Sum(nil)) - - // A2 - h = md5.New() // nolint: gosec - A2 := fmt.Sprintf("%s:%s", response.Request.Method, uriHeader) - if _, err := io.WriteString(h, A2); err != nil { - return "", err - } - HA2 := fmt.Sprintf("%x", h.Sum(nil)) - - k := make([]byte, 12) - for bytes := 0; bytes < len(k); { - n, err := rand.Read(k[bytes:]) - if err != nil { - return "", fmt.Errorf("cnonce generation failed: %s", err) - } - bytes += n - } - cnonce := base64.StdEncoding.EncodeToString(k) - digest := md5.New() // nolint: gosec - if _, err := digest.Write([]byte(strings.Join([]string{HA1, nonceHeader, "00000001", cnonce, qopHeader, HA2}, ":"))); err != nil { - return "", err - } - responseField := fmt.Sprintf("%x", digest.Sum(nil)) - - return fmt.Sprintf( - `Digest username="%s", realm="%s", nonce="%s", uri="%s", cnonce="%s", nc=00000001, qop=%s, response="%s"`, - s.name, realmHeader, nonceHeader, uriHeader, cnonce, qopHeader, responseField), nil -} - -// SetCookieAuth sets basic parameters for HTTP Cookie -func (s *AuthenticationService) SetCookieAuth(name, value string) { - s.name = name - s.secret = value - s.authType = authTypeCookie -} - -// HasBasicAuth checks if the auth type is HTTP Basic auth -func (s *AuthenticationService) HasBasicAuth() bool { - return s.authType == authTypeBasic -} - -// HasDigestAuth checks if the auth type is HTTP Digest based -func (s *AuthenticationService) HasDigestAuth() bool { - return s.authType == authTypeDigest -} - -// HasCookieAuth checks if the auth type is HTTP Cookie based -func (s *AuthenticationService) HasCookieAuth() bool { - return s.authType == authTypeCookie -} - -// HasAuth checks if an auth type is used -func (s *AuthenticationService) HasAuth() bool { - return s.authType > 0 -} - -// ResetAuth resets all former authentification settings -func (s *AuthenticationService) ResetAuth() { - s.name = "" - s.secret = "" - s.authType = 0 -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/changes.go b/vendor/github.com/andygrunwald/go-gerrit/changes.go deleted file mode 100644 index eb204846..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/changes.go +++ /dev/null @@ -1,855 +0,0 @@ -package gerrit - -import ( - "errors" - "fmt" - "io/ioutil" - "net/http" -) - -// ChangesService contains Change related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html -type ChangesService struct { - client *Client -} - -// WebLinkInfo entity describes a link to an external site. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#web-link-info -type WebLinkInfo struct { - Name string `json:"name"` - URL string `json:"url"` - ImageURL string `json:"image_url"` -} - -// GitPersonInfo entity contains information about the author/committer of a commit. -type GitPersonInfo struct { - Name string `json:"name"` - Email string `json:"email"` - Date Timestamp `json:"date"` - TZ int `json:"tz"` -} - -// NotifyInfo entity contains detailed information about who should be -// notified about an update -type NotifyInfo struct { - Accounts []AccountInfo `json:"accounts"` -} - -// AbandonInput entity contains information for abandoning a change. -type AbandonInput struct { - Message string `json:"message,omitempty"` - Notify string `json:"notify"` - NotifyDetails []NotifyInfo `json:"notify_details"` -} - -// ApprovalInfo entity contains information about an approval from a user for a label on a change. -type ApprovalInfo struct { - AccountInfo - Value int `json:"value,omitempty"` - Date string `json:"date,omitempty"` -} - -// ChangeEditInput entity contains information for restoring a path within change edit. -type ChangeEditInput struct { - RestorePath string `json:"restore_path,omitempty"` - OldPath string `json:"old_path,omitempty"` - NewPath string `json:"new_path,omitempty"` -} - -// ChangeEditMessageInput entity contains information for changing the commit message within a change edit. -type ChangeEditMessageInput struct { - Message string `json:"message"` -} - -// ChangeMessageInfo entity contains information about a message attached to a change. -type ChangeMessageInfo struct { - ID string `json:"id"` - Author AccountInfo `json:"author,omitempty"` - Date Timestamp `json:"date"` - Message string `json:"message"` - Tag string `json:"tag,omitempty"` - RevisionNumber int `json:"_revision_number,omitempty"` -} - -// CherryPickInput entity contains information for cherry-picking a change to a new branch. -type CherryPickInput struct { - Message string `json:"message"` - Destination string `json:"destination"` -} - -// CommentRange entity describes the range of an inline comment. -type CommentRange struct { - StartLine int `json:"start_line"` - StartCharacter int `json:"start_character"` - EndLine int `json:"end_line"` - EndCharacter int `json:"end_character"` -} - -// DiffFileMetaInfo entity contains meta information about a file diff -type DiffFileMetaInfo struct { - Name string `json:"name"` - ContentType string `json:"content_type"` - Lines int `json:"lines"` - WebLinks []WebLinkInfo `json:"web_links,omitempty"` -} - -// DiffWebLinkInfo entity describes a link on a diff screen to an external site. -type DiffWebLinkInfo struct { - Name string `json:"name"` - URL string `json:"url"` - ImageURL string `json:"image_url"` - ShowOnSideBySideDiffView bool `json:"show_on_side_by_side_diff_view"` - ShowOnUnifiedDiffView bool `json:"show_on_unified_diff_view"` -} - -// FetchInfo entity contains information about how to fetch a patch set via a certain protocol. -type FetchInfo struct { - URL string `json:"url"` - Ref string `json:"ref"` - Commands map[string]string `json:"commands,omitempty"` -} - -// FixInput entity contains options for fixing commits using the fix change endpoint. -type FixInput struct { - DeletePatchSetIfCommitMissing bool `json:"delete_patch_set_if_commit_missing"` - ExpectMergedAs string `json:"expect_merged_as"` -} - -// GroupBaseInfo entity contains base information about the group. -type GroupBaseInfo struct { - ID int `json:"id"` - Name string `json:"name"` -} - -// IncludedInInfo entity contains information about the branches a change was merged into and tags it was tagged with. -type IncludedInInfo struct { - Branches []string `json:"branches"` - Tags []string `json:"tags"` - External map[string]string `json:"external,omitempty"` -} - -// ProblemInfo entity contains a description of a potential consistency problem with a change. -// These are not related to the code review process, but rather indicate some inconsistency in Gerrit’s database or repository metadata related to the enclosing change. -type ProblemInfo struct { - Message string `json:"message"` - Status string `json:"status,omitempty"` - Outcome string `json:"outcome,omitempty"` -} - -// RebaseInput entity contains information for changing parent when rebasing. -type RebaseInput struct { - Base string `json:"base,omitempty"` -} - -// RestoreInput entity contains information for restoring a change. -type RestoreInput struct { - Message string `json:"message,omitempty"` -} - -// RevertInput entity contains information for reverting a change. -type RevertInput struct { - Message string `json:"message,omitempty"` -} - -// ReviewInfo entity contains information about a review. -type ReviewInfo struct { - Labels map[string]int `json:"labels"` -} - -// ReviewerUpdateInfo entity contains information about updates -// to change's reviewers set. -type ReviewerUpdateInfo struct { - Updated Timestamp `json:"updated"` // Timestamp of the update. - UpdatedBy AccountInfo `json:"updated_by"` // The account which modified state of the reviewer in question. - Reviewer AccountInfo `json:"reviewer"` // The reviewer account added or removed from the change. - State string `json:"state"` // The reviewer state, one of "REVIEWER", "CC" or "REMOVED". -} - -// ReviewResult entity contains information regarding the updates that were -// made to a review. -type ReviewResult struct { - ReviewInfo - Reviewers map[string]AddReviewerResult `json:"reviewers,omitempty"` - Ready bool `json:"ready,omitempty"` -} - -// TopicInput entity contains information for setting a topic. -type TopicInput struct { - Topic string `json:"topic,omitempty"` -} - -// SubmitRecord entity describes results from a submit_rule. -type SubmitRecord struct { - Status string `json:"status"` - Ok map[string]map[string]AccountInfo `json:"ok,omitempty"` - Reject map[string]map[string]AccountInfo `json:"reject,omitempty"` - Need map[string]interface{} `json:"need,omitempty"` - May map[string]map[string]AccountInfo `json:"may,omitempty"` - Impossible map[string]interface{} `json:"impossible,omitempty"` - ErrorMessage string `json:"error_message,omitempty"` -} - -// SubmitInput entity contains information for submitting a change. -type SubmitInput struct { - WaitForMerge bool `json:"wait_for_merge"` -} - -// SubmitInfo entity contains information about the change status after submitting. -type SubmitInfo struct { - Status string `json:"status"` - OnBehalfOf string `json:"on_behalf_of,omitempty"` -} - -// RuleInput entity contains information to test a Prolog rule. -type RuleInput struct { - Rule string `json:"rule"` - Filters string `json:"filters,omitempty"` -} - -// ReviewerInput entity contains information for adding a reviewer to a change. -type ReviewerInput struct { - Reviewer string `json:"reviewer"` - Confirmed bool `json:"confirmed,omitempty"` -} - -// ReviewInput entity contains information for adding a review to a revision. -type ReviewInput struct { - Message string `json:"message,omitempty"` - Tag string `json:"tag,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - Comments map[string][]CommentInput `json:"comments,omitempty"` - RobotComments map[string][]RobotCommentInput `json:"robot_comments,omitempty"` - StrictLabels bool `json:"strict_labels,omitempty"` - Drafts string `json:"drafts,omitempty"` - Notify string `json:"notify,omitempty"` - OmitDuplicateComments bool `json:"omit_duplicate_comments,omitempty"` - OnBehalfOf string `json:"on_behalf_of,omitempty"` -} - -// RelatedChangeAndCommitInfo entity contains information about a related change and commit. -type RelatedChangeAndCommitInfo struct { - ChangeID string `json:"change_id,omitempty"` - Commit CommitInfo `json:"commit"` - ChangeNumber int `json:"_change_number,omitempty"` - RevisionNumber int `json:"_revision_number,omitempty"` - CurrentRevisionNumber int `json:"_current_revision_number,omitempty"` - Status string `json:"status,omitempty"` -} - -// DiffContent entity contains information about the content differences in a file. -type DiffContent struct { - A []string `json:"a,omitempty"` - B []string `json:"b,omitempty"` - AB []string `json:"ab,omitempty"` - EditA DiffIntralineInfo `json:"edit_a,omitempty"` - EditB DiffIntralineInfo `json:"edit_b,omitempty"` - Skip int `json:"skip,omitempty"` - Common bool `json:"common,omitempty"` -} - -// CommentInput entity contains information for creating an inline comment. -type CommentInput struct { - ID string `json:"id,omitempty"` - Path string `json:"path,omitempty"` - Side string `json:"side,omitempty"` - Line int `json:"line,omitempty"` - Range *CommentRange `json:"range,omitempty"` - InReplyTo string `json:"in_reply_to,omitempty"` - Updated *Timestamp `json:"updated,omitempty"` - Message string `json:"message,omitempty"` -} - -// RobotCommentInput entity contains information for creating an inline robot comment. -// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#robot-comment-input -type RobotCommentInput struct { - CommentInput - - // The ID of the robot that generated this comment. - RobotID string `json:"robot_id"` - // An ID of the run of the robot. - RobotRunID string `json:"robot_run_id"` - // URL to more information. - URL string `json:"url,omitempty"` - // Robot specific properties as map that maps arbitrary keys to values. - Properties *map[string]*string `json:"properties,omitempty"` - // Suggested fixes for this robot comment as a list of FixSuggestionInfo - // entities. - FixSuggestions *FixSuggestionInfo `json:"fix_suggestions,omitempty"` -} - -// RobotCommentInfo entity contains information about a robot inline comment -// RobotCommentInfo has the same fields as CommentInfo. In addition RobotCommentInfo has the following fields: -// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#robot-comment-info -type RobotCommentInfo struct { - CommentInfo - - // The ID of the robot that generated this comment. - RobotID string `json:"robot_id"` - // An ID of the run of the robot. - RobotRunID string `json:"robot_run_id"` - // URL to more information. - URL string `json:"url,omitempty"` - // Robot specific properties as map that maps arbitrary keys to values. - Properties map[string]string `json:"properties,omitempty"` - // Suggested fixes for this robot comment as a list of FixSuggestionInfo - // entities. - FixSuggestions *FixSuggestionInfo `json:"fix_suggestions,omitempty"` -} - -// FixSuggestionInfo entity represents a suggested fix. -// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-suggestion-info -type FixSuggestionInfo struct { - // The UUID of the suggested fix. It will be generated automatically and - // hence will be ignored if it’s set for input objects. - FixID string `json:"fix_id"` - // A description of the suggested fix. - Description string `json:"description"` - // A list of FixReplacementInfo entities indicating how the content of one or - // several files should be modified. Within a file, they should refer to - // non-overlapping regions. - Replacements FixReplacementInfo `json:"replacements"` -} - -// FixReplacementInfo entity describes how the content of a file should be replaced by another content. -// https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-replacement-info -type FixReplacementInfo struct { - // The path of the file which should be modified. Any file in the repository may be modified. - Path string `json:"path"` - - // A CommentRange indicating which content of the file should be replaced. - // Lines in the file are assumed to be separated by the line feed character, - // the carriage return character, the carriage return followed by the line - // feed character, or one of the other Unicode linebreak sequences supported - // by Java. - Range CommentRange `json:"range"` - - // The content which should be used instead of the current one. - Replacement string `json:"replacement,omitempty"` -} - -// DiffIntralineInfo entity contains information about intraline edits in a file. -// -// The information consists of a list of pairs, -// where the skip length is the number of characters between the end of -// the previous edit and the start of this edit, and the mark length is the -// number of edited characters following the skip. The start of the edits -// is from the beginning of the related diff content lines. -// -// Note that the implied newline character at the end of each line -// is included in the length calculation, and thus it is possible for -// the edits to span newlines. -type DiffIntralineInfo [][2]int - -// ChangeInfo entity contains information about a change. -type ChangeInfo struct { - ID string `json:"id"` - URL string `json:"url,omitempty"` - Project string `json:"project"` - Branch string `json:"branch"` - Topic string `json:"topic,omitempty"` - Hashtags []string `json:"hashtags,omitempty"` - ChangeID string `json:"change_id"` - Subject string `json:"subject"` - Status string `json:"status"` - Created Timestamp `json:"created"` - Updated Timestamp `json:"updated"` - Submitted *Timestamp `json:"submitted,omitempty"` - Starred bool `json:"starred,omitempty"` - Reviewed bool `json:"reviewed,omitempty"` - Mergeable bool `json:"mergeable,omitempty"` - Insertions int `json:"insertions"` - Deletions int `json:"deletions"` - Number int `json:"_number"` - Owner AccountInfo `json:"owner"` - Actions map[string]ActionInfo `json:"actions,omitempty"` - Labels map[string]LabelInfo `json:"labels,omitempty"` - PermittedLabels map[string][]string `json:"permitted_labels,omitempty"` - RemovableReviewers []AccountInfo `json:"removable_reviewers,omitempty"` - Reviewers map[string][]AccountInfo `json:"reviewers,omitempty"` - ReviewerUpdates []ReviewerUpdateInfo `json:"reviewer_updates,omitempty"` - Messages []ChangeMessageInfo `json:"messages,omitempty"` - CurrentRevision string `json:"current_revision,omitempty"` - Revisions map[string]RevisionInfo `json:"revisions,omitempty"` - MoreChanges bool `json:"_more_changes,omitempty"` - Problems []ProblemInfo `json:"problems,omitempty"` - BaseChange string `json:"base_change,omitempty"` - Submittable bool `json:"submittable,omitempty"` -} - -// LabelInfo entity contains information about a label on a change, always corresponding to the current patch set. -type LabelInfo struct { - Optional bool `json:"optional,omitempty"` - - // Fields set by LABELS - Approved AccountInfo `json:"approved,omitempty"` - Rejected AccountInfo `json:"rejected,omitempty"` - Recommended AccountInfo `json:"recommended,omitempty"` - Disliked AccountInfo `json:"disliked,omitempty"` - Blocking bool `json:"blocking,omitempty"` - Value int `json:"value,omitempty"` - DefaultValue int `json:"default_value,omitempty"` - - // Fields set by DETAILED_LABELS - All []ApprovalInfo `json:"all,omitempty"` - Values map[string]string `json:"values,omitempty"` -} - -// RevisionInfo entity contains information about a patch set. -type RevisionInfo struct { - Draft bool `json:"draft,omitempty"` - Number int `json:"_number"` - Created Timestamp `json:"created"` - Uploader AccountInfo `json:"uploader"` - Ref string `json:"ref"` - Fetch map[string]FetchInfo `json:"fetch"` - Commit CommitInfo `json:"commit,omitempty"` - Files map[string]FileInfo `json:"files,omitempty"` - Actions map[string]ActionInfo `json:"actions,omitempty"` - Reviewed bool `json:"reviewed,omitempty"` - MessageWithFooter string `json:"messageWithFooter,omitempty"` -} - -// CommentInfo entity contains information about an inline comment. -type CommentInfo struct { - PatchSet int `json:"patch_set,omitempty"` - ID string `json:"id"` - Path string `json:"path,omitempty"` - Side string `json:"side,omitempty"` - Line int `json:"line,omitempty"` - Range *CommentRange `json:"range,omitempty"` - InReplyTo string `json:"in_reply_to,omitempty"` - Message string `json:"message,omitempty"` - Updated *Timestamp `json:"updated"` - Author AccountInfo `json:"author,omitempty"` -} - -// QueryOptions specifies global parameters to query changes / reviewers. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes -type QueryOptions struct { - // Query parameter - // Clients are allowed to specify more than one query by setting the q parameter multiple times. - // In this case the result is an array of arrays, one per query in the same order the queries were given in. - // - // Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/user-search.html#_search_operators - Query []string `url:"q,omitempty"` - - // The n parameter can be used to limit the returned results. - // If the n query parameter is supplied and additional changes exist that match the query beyond the end, the last change object has a _more_changes: true JSON field set. - Limit int `url:"n,omitempty"` -} - -// QueryChangeOptions specifies the parameters to the ChangesService.QueryChanges. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes -type QueryChangeOptions struct { - QueryOptions - - // The S or start query parameter can be supplied to skip a number of changes from the list. - Skip int `url:"S,omitempty"` - Start int `url:"start,omitempty"` - - ChangeOptions -} - -// ChangeOptions specifies the parameters for Query changes. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes -type ChangeOptions struct { - // Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default. - // - // Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes - AdditionalFields []string `url:"o,omitempty"` -} - -// QueryChanges lists changes visible to the caller. -// The query string must be provided by the q parameter. -// The n parameter can be used to limit the returned results. -// -// The change output is sorted by the last update time, most recently updated to oldest updated. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes -func (s *ChangesService) QueryChanges(opt *QueryChangeOptions) (*[]ChangeInfo, *Response, error) { - u := "changes/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetChange retrieves a change. -// Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change -func (s *ChangesService) GetChange(changeID string, opt *ChangeOptions) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s", changeID) - return s.getChangeInfoResponse(u, opt) -} - -// GetChangeDetail retrieves a change with labels, detailed labels, detailed accounts, and messages. -// Additional fields can be obtained by adding o parameters, each option requires more database lookups and slows down the query response time to the client so they are generally disabled by default. -// -// This response will contain all votes for each label and include one combined vote. -// The combined label vote is calculated in the following order (from highest to lowest): REJECTED > APPROVED > DISLIKED > RECOMMENDED. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change-detail -func (s *ChangesService) GetChangeDetail(changeID string, opt *ChangeOptions) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/detail", changeID) - return s.getChangeInfoResponse(u, opt) -} - -// getChangeInfoResponse retrieved a single ChangeInfo Response for a GET request -func (s *ChangesService) getChangeInfoResponse(u string, opt *ChangeOptions) (*ChangeInfo, *Response, error) { - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetTopic retrieves the topic of a change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-topic -func (s *ChangesService) GetTopic(changeID string) (string, *Response, error) { - u := fmt.Sprintf("changes/%s/topic", changeID) - return getStringResponseWithoutOptions(s.client, u) -} - -// ChangesSubmittedTogether returns a list of all changes which are submitted when {submit} is called for this change, including the current change itself. -// An empty list is returned if this change will be submitted by itself (no other changes). -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submitted_together -func (s *ChangesService) ChangesSubmittedTogether(changeID string) (*[]ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/submitted_together", changeID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetIncludedIn retrieves the branches and tags in which a change is included. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-included-in -func (s *ChangesService) GetIncludedIn(changeID string) (*IncludedInInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/in", changeID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(IncludedInInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListChangeComments lists the published comments of all revisions of the change. -// The entries in the map are sorted by file path, and the comments for each path are sorted by patch set number. -// Each comment has the patch_set and author fields set. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-comments -func (s *ChangesService) ListChangeComments(changeID string) (*map[string][]CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/comments", changeID) - return s.getCommentInfoMapResponse(u) -} - -// ListChangeDrafts lLists the draft comments of all revisions of the change that belong to the calling user. -// The entries in the map are sorted by file path, and the comments for each path are sorted by patch set number. -// Each comment has the patch_set field set, and no author. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-drafts -func (s *ChangesService) ListChangeDrafts(changeID string) (*map[string][]CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/drafts", changeID) - return s.getCommentInfoMapResponse(u) -} - -// getCommentInfoMapResponse retrieved a map of CommentInfo Response for a GET request -func (s *ChangesService) getCommentInfoMapResponse(u string) (*map[string][]CommentInfo, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string][]CommentInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CheckChange performs consistency checks on the change, and returns a ChangeInfo entity with the problems field set to a list of ProblemInfo entities. -// Depending on the type of problem, some fields not marked optional may be missing from the result. -// At least id, project, branch, and _number will be present. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#check-change -func (s *ChangesService) CheckChange(changeID string) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/check", changeID) - return s.getChangeInfoResponse(u, nil) -} - -// getCommentInfoResponse retrieved a CommentInfo Response for a GET request -func (s *ChangesService) getCommentInfoResponse(u string) (*CommentInfo, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(CommentInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// getCommentInfoMapSliceResponse retrieved a map with a slice of CommentInfo Response for a GET request -func (s *ChangesService) getCommentInfoMapSliceResponse(u string) (*map[string][]CommentInfo, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string][]CommentInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateChange creates a new change. -// The change info ChangeInfo entity must be provided in the request body. -// Only the following attributes are honored: project, branch, subject, status and topic. -// The first three attributes are mandatory. -// Valid values for status are: DRAFT and NEW. -// -// As response a ChangeInfo entity is returned that describes the resulting change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#create-change -func (s *ChangesService) CreateChange(input *ChangeInfo) (*ChangeInfo, *Response, error) { - u := "changes/" - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetTopic sets the topic of a change. -// The new topic must be provided in the request body inside a TopicInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-topic -func (s *ChangesService) SetTopic(changeID string, input *TopicInput) (*string, *Response, error) { - u := fmt.Sprintf("changes/%s/topic", changeID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteTopic deletes the topic of a change. -// The request body does not need to include a TopicInput entity if no review comment is added. -// -// Please note that some proxies prohibit request bodies for DELETE requests. -// In this case, if you want to specify a commit message, use PUT to delete the topic. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-topic -func (s *ChangesService) DeleteTopic(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/topic", changeID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteDraftChange deletes a draft change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft-change -func (s *ChangesService) DeleteDraftChange(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s", changeID) - return s.client.DeleteRequest(u, nil) -} - -// PublishDraftChange publishes a draft change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-draft-change -func (s *ChangesService) PublishDraftChange(changeID, notify string) (*Response, error) { - u := fmt.Sprintf("changes/%s/publish", changeID) - - req, err := s.client.NewRequest("POST", u, map[string]string{ - "notify": notify, - }) - if err != nil { - return nil, err - } - return s.client.Do(req, nil) -} - -// IndexChange adds or updates the change in the secondary index. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#index-change -func (s *ChangesService) IndexChange(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/index", changeID) - - req, err := s.client.NewRequest("POST", u, nil) - if err != nil { - return nil, err - } - return s.client.Do(req, nil) -} - -// FixChange performs consistency checks on the change as with GET /check, and additionally fixes any problems that can be fixed automatically. -// The returned field values reflect any fixes. -// -// Some fixes have options controlling their behavior, which can be set in the FixInput entity body. -// Only the change owner, a project owner, or an administrator may fix changes. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#fix-change -func (s *ChangesService) FixChange(changeID string, input *FixInput) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/check", changeID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// change is an internal function to consolidate code used by SubmitChange, -// AbandonChange and other similar functions. -func (s *ChangesService) change(tail string, changeID string, input interface{}) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/%s", changeID, tail) - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - if resp.StatusCode == http.StatusConflict { - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return v, resp, err - } - return v, resp, errors.New(string(body[:])) - } - return v, resp, nil -} - -// SubmitChange submits a change. -// -// The request body only needs to include a SubmitInput entity if submitting on behalf of another user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-change -func (s *ChangesService) SubmitChange(changeID string, input *SubmitInput) (*ChangeInfo, *Response, error) { - return s.change("submit", changeID, input) -} - -// AbandonChange abandons a change. -// -// The request body does not need to include a AbandonInput entity if no review -// comment is added. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#abandon-change -func (s *ChangesService) AbandonChange(changeID string, input *AbandonInput) (*ChangeInfo, *Response, error) { - return s.change("abandon", changeID, input) -} - -// RebaseChange rebases a change. -// -// Optionally, the parent revision can be changed to another patch set through -// the RebaseInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#rebase-change -func (s *ChangesService) RebaseChange(changeID string, input *RebaseInput) (*ChangeInfo, *Response, error) { - return s.change("rebase", changeID, input) -} - -// RestoreChange restores a change. -// -// The request body does not need to include a RestoreInput entity if no review -// comment is added. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#restore-change -func (s *ChangesService) RestoreChange(changeID string, input *RestoreInput) (*ChangeInfo, *Response, error) { - return s.change("restore", changeID, input) -} - -// RevertChange reverts a change. -// -// The request body does not need to include a RevertInput entity if no -// review comment is added. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#revert-change -func (s *ChangesService) RevertChange(changeID string, input *RevertInput) (*ChangeInfo, *Response, error) { - return s.change("revert", changeID, input) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/changes_edit.go b/vendor/github.com/andygrunwald/go-gerrit/changes_edit.go deleted file mode 100644 index 58033e21..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/changes_edit.go +++ /dev/null @@ -1,231 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// EditInfo entity contains information about a change edit. -type EditInfo struct { - Commit CommitInfo `json:"commit"` - BaseRevision string `json:"baseRevision"` - Fetch map[string]FetchInfo `json:"fetch"` - Files map[string]FileInfo `json:"files,omitempty"` -} - -// EditFileInfo entity contains additional information of a file within a change edit. -type EditFileInfo struct { - WebLinks []WebLinkInfo `json:"web_links,omitempty"` -} - -// ChangeEditDetailOptions specifies the parameters to the ChangesService.GetChangeEditDetails. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-detail -type ChangeEditDetailOptions struct { - // When request parameter list is provided the response also includes the file list. - List bool `url:"list,omitempty"` - // When base request parameter is provided the file list is computed against this base revision. - Base bool `url:"base,omitempty"` - // When request parameter download-commands is provided fetch info map is also included. - DownloadCommands bool `url:"download-commands,omitempty"` -} - -// GetChangeEditDetails retrieves a change edit details. -// As response an EditInfo entity is returned that describes the change edit, or “204 No Content” when change edit doesn’t exist for this change. -// Change edits are stored on special branches and there can be max one edit per user per change. -// Edits aren’t tracked in the database. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-detail -func (s *ChangesService) GetChangeEditDetails(changeID string, opt *ChangeEditDetailOptions) (*EditInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/edit", changeID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(EditInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RetrieveMetaDataOfAFileFromChangeEdit retrieves meta data of a file from a change edit. -// Currently only web links are returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-meta-data -func (s *ChangesService) RetrieveMetaDataOfAFileFromChangeEdit(changeID, filePath string) (*EditFileInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/edit/%s/meta", changeID, filePath) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(EditFileInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RetrieveCommitMessageFromChangeEdit retrieves commit message from change edit. -// The commit message is returned as base64 encoded string. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-message -func (s *ChangesService) RetrieveCommitMessageFromChangeEdit(changeID string) (string, *Response, error) { - u := fmt.Sprintf("changes/%s/edit:message", changeID) - return getStringResponseWithoutOptions(s.client, u) -} - -// ChangeFileContentInChangeEdit put content of a file to a change edit. -// -// When change edit doesn’t exist for this change yet it is created. -// When file content isn’t provided, it is wiped out for that file. -// As response “204 No Content” is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#put-edit-file -func (s *ChangesService) ChangeFileContentInChangeEdit(changeID, filePath, content string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit/%s", changeID, url.QueryEscape(filePath)) - - req, err := s.client.NewRawPutRequest(u, content) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// ChangeCommitMessageInChangeEdit modify commit message. -// The request body needs to include a ChangeEditMessageInput entity. -// -// If a change edit doesn’t exist for this change yet, it is created. -// As response “204 No Content” is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#put-change-edit-message -func (s *ChangesService) ChangeCommitMessageInChangeEdit(changeID string, input *ChangeEditMessageInput) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit:message", changeID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// DeleteFileInChangeEdit deletes a file from a change edit. -// This deletes the file from the repository completely. -// This is not the same as reverting or restoring a file to its previous contents. -// -// When change edit doesn’t exist for this change yet it is created. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-edit-file -func (s *ChangesService) DeleteFileInChangeEdit(changeID, filePath string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit/%s", changeID, filePath) - return s.client.DeleteRequest(u, nil) -} - -// DeleteChangeEdit deletes change edit. -// -// As response “204 No Content” is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-edit -func (s *ChangesService) DeleteChangeEdit(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit", changeID) - return s.client.DeleteRequest(u, nil) -} - -// PublishChangeEdit promotes change edit to a regular patch set. -// -// As response “204 No Content” is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-edit -func (s *ChangesService) PublishChangeEdit(changeID, notify string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit:publish", changeID) - - req, err := s.client.NewRequest("POST", u, map[string]string{ - "notify": notify, - }) - if err != nil { - return nil, err - } - return s.client.Do(req, nil) -} - -// RebaseChangeEdit rebases change edit on top of latest patch set. -// -// When change was rebased on top of latest patch set, response “204 No Content” is returned. -// When change edit is already based on top of the latest patch set, the response “409 Conflict” is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#rebase-edit -func (s *ChangesService) RebaseChangeEdit(changeID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit:rebase", changeID) - - req, err := s.client.NewRequest("POST", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// RetrieveFileContentFromChangeEdit retrieves content of a file from a change edit. -// -// The content of the file is returned as text encoded inside base64. -// The Content-Type header will always be text/plain reflecting the outer base64 encoding. -// A Gerrit-specific X-FYI-Content-Type header can be examined to find the server detected content type of the file. -// -// When the specified file was deleted in the change edit “204 No Content” is returned. -// If only the content type is required, callers should use HEAD to avoid downloading the encoded file contents. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-file -func (s *ChangesService) RetrieveFileContentFromChangeEdit(changeID, filePath string) (*string, *Response, error) { - u := fmt.Sprintf("changes/%s/edit/%s", changeID, filePath) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RetrieveFileContentTypeFromChangeEdit retrieves content type of a file from a change edit. -// This is nearly the same as RetrieveFileContentFromChangeEdit. -// But if only the content type is required, callers should use HEAD to avoid downloading the encoded file contents. -// -// For further documentation please have a look at RetrieveFileContentFromChangeEdit. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-edit-file -func (s *ChangesService) RetrieveFileContentTypeFromChangeEdit(changeID, filePath string) (*Response, error) { - u := fmt.Sprintf("changes/%s/edit/%s", changeID, filePath) - - req, err := s.client.NewRequest("HEAD", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -/* -Missing Change Edit Endpoints - Restore file content or rename files in Change Edit -*/ diff --git a/vendor/github.com/andygrunwald/go-gerrit/changes_reviewer.go b/vendor/github.com/andygrunwald/go-gerrit/changes_reviewer.go deleted file mode 100644 index 31099d3b..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/changes_reviewer.go +++ /dev/null @@ -1,163 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// ReviewerInfo entity contains information about a reviewer and its votes on a change. -type ReviewerInfo struct { - AccountInfo - Approvals map[string]string `json:"approvals"` -} - -// SuggestedReviewerInfo entity contains information about a reviewer that can be added to a change (an account or a group). -type SuggestedReviewerInfo struct { - Account AccountInfo `json:"account,omitempty"` - Group GroupBaseInfo `json:"group,omitempty"` -} - -// AddReviewerResult entity describes the result of adding a reviewer to a change. -type AddReviewerResult struct { - Input string `json:"input,omitempty"` - Reviewers []ReviewerInfo `json:"reviewers,omitempty"` - CCS []ReviewerInfo `json:"ccs,omitempty"` - Error string `json:"error,omitempty"` - Confirm bool `json:"confirm,omitempty"` -} - -// DeleteVoteInput entity contains options for the deletion of a vote. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote-input -type DeleteVoteInput struct { - Label string `json:"label,omitempty"` - Notify string `json:"notify,omitempty"` - NotifyDetails map[string]NotifyInfo `json:"notify_details"` -} - -// ListReviewers lists the reviewers of a change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-reviewers -func (s *ChangesService) ListReviewers(changeID string) (*[]ReviewerInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/reviewers/", changeID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ReviewerInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SuggestReviewers suggest the reviewers for a given query q and result limit n. -// If result limit is not passed, then the default 10 is used. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#suggest-reviewers -func (s *ChangesService) SuggestReviewers(changeID string, opt *QueryOptions) (*[]SuggestedReviewerInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/suggest_reviewers", changeID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]SuggestedReviewerInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetReviewer retrieves a reviewer of a change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-reviewer -func (s *ChangesService) GetReviewer(changeID, accountID string) (*ReviewerInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/reviewers/%s", changeID, accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(ReviewerInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// AddReviewer adds one user or all members of one group as reviewer to the change. -// The reviewer to be added to the change must be provided in the request body as a ReviewerInput entity. -// -// As response an AddReviewerResult entity is returned that describes the newly added reviewers. -// If a group is specified, adding the group members as reviewers is an atomic operation. -// This means if an error is returned, none of the members are added as reviewer. -// If a group with many members is added as reviewer a confirmation may be required. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#add-reviewer -func (s *ChangesService) AddReviewer(changeID string, input *ReviewerInput) (*AddReviewerResult, *Response, error) { - u := fmt.Sprintf("changes/%s/reviewers", changeID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(AddReviewerResult) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteReviewer deletes a reviewer from a change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-reviewer -func (s *ChangesService) DeleteReviewer(changeID, accountID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/reviewers/%s", changeID, accountID) - return s.client.DeleteRequest(u, nil) -} - -// ListVotes lists the votes for a specific reviewer of the change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-votes -func (s *ChangesService) ListVotes(changeID string, accountID string) (map[string]int, *Response, error) { - u := fmt.Sprintf("changes/%s/reviewers/%s/votes/", changeID, accountID) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var v map[string]int - resp, err := s.client.Do(req, &v) - if err != nil { - return nil, resp, err - } - return v, resp, err -} - -// DeleteVote deletes a single vote from a change. Note, that even when the -// last vote of a reviewer is removed the reviewer itself is still listed on -// the change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote -func (s *ChangesService) DeleteVote(changeID string, accountID string, label string, input *DeleteVoteInput) (*Response, error) { - u := fmt.Sprintf("changes/%s/reviewers/%s/votes/%s", changeID, accountID, label) - return s.client.DeleteRequest(u, input) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/changes_revision.go b/vendor/github.com/andygrunwald/go-gerrit/changes_revision.go deleted file mode 100644 index c20c5ac6..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/changes_revision.go +++ /dev/null @@ -1,651 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// DiffInfo entity contains information about the diff of a file in a revision. -type DiffInfo struct { - MetaA DiffFileMetaInfo `json:"meta_a,omitempty"` - MetaB DiffFileMetaInfo `json:"meta_b,omitempty"` - ChangeType string `json:"change_type"` - IntralineStatus string `json:"intraline_status,omitempty"` - DiffHeader []string `json:"diff_header"` - Content []DiffContent `json:"content"` - WebLinks []DiffWebLinkInfo `json:"web_links,omitempty"` - Binary bool `json:"binary,omitempty"` -} - -// RelatedChangesInfo entity contains information about related changes. -type RelatedChangesInfo struct { - Changes []RelatedChangeAndCommitInfo `json:"changes"` -} - -// FileInfo entity contains information about a file in a patch set. -type FileInfo struct { - Status string `json:"status,omitempty"` - Binary bool `json:"binary,omitempty"` - OldPath string `json:"old_path,omitempty"` - LinesInserted int `json:"lines_inserted,omitempty"` - LinesDeleted int `json:"lines_deleted,omitempty"` - SizeDelta int `json:"size_delta"` - Size int `json:"size"` -} - -// ActionInfo entity describes a REST API call the client can make to manipulate a resource. -// These are frequently implemented by plugins and may be discovered at runtime. -type ActionInfo struct { - Method string `json:"method,omitempty"` - Label string `json:"label,omitempty"` - Title string `json:"title,omitempty"` - Enabled bool `json:"enabled,omitempty"` -} - -// CommitInfo entity contains information about a commit. -type CommitInfo struct { - Commit string `json:"commit,omitempty"` - Parents []CommitInfo `json:"parents"` - Author GitPersonInfo `json:"author"` - Committer GitPersonInfo `json:"committer"` - Subject string `json:"subject"` - Message string `json:"message"` - WebLinks []WebLinkInfo `json:"web_links,omitempty"` -} - -// MergeableInfo entity contains information about the mergeability of a change. -type MergeableInfo struct { - SubmitType string `json:"submit_type"` - Mergeable bool `json:"mergeable"` - MergeableInto []string `json:"mergeable_into,omitempty"` -} - -// DiffOptions specifies the parameters for GetDiff call. -type DiffOptions struct { - // If the intraline parameter is specified, intraline differences are included in the diff. - Intraline bool `url:"intraline,omitempty"` - - // The base parameter can be specified to control the base patch set from which the diff - // should be generated. - Base string `url:"base,omitempty"` - - // The integer-valued request parameter parent can be specified to control the parent commit number - // against which the diff should be generated. This is useful for supporting review of merge commits. - // The value is the 1-based index of the parent’s position in the commit object. - Parent int `url:"parent,omitempty"` - - // If the weblinks-only parameter is specified, only the diff web links are returned. - WeblinksOnly bool `url:"weblinks-only,omitempty"` - - // The ignore-whitespace parameter can be specified to control how whitespace differences are reported in the result. Valid values are NONE, TRAILING, CHANGED or ALL. - IgnoreWhitespace string `url:"ignore-whitespace,omitempty"` - - // The context parameter can be specified to control the number of lines of surrounding context in the diff. - // Valid values are ALL or number of lines. - Context string `url:"context,omitempty"` -} - -// CommitOptions specifies the parameters for GetCommit call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-commit -type CommitOptions struct { - // Adding query parameter links (for example /changes/.../commit?links) returns a CommitInfo with the additional field web_links. - Weblinks bool `url:"links,omitempty"` -} - -// MergableOptions specifies the parameters for GetMergable call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-mergeable -type MergableOptions struct { - // If the other-branches parameter is specified, the mergeability will also be checked for all other branches. - OtherBranches bool `url:"other-branches,omitempty"` -} - -// FilesOptions specifies the parameters for ListFiles and ListFilesReviewed calls. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files -type FilesOptions struct { - // The request parameter q changes the response to return a list of all files (modified or unmodified) - // that contain that substring in the path name. This is useful to implement suggestion services - // finding a file by partial name. - Q string `url:"q,omitempty"` - - // The base parameter can be specified to control the base patch set from which the list of files - // should be generated. - // - // Note: This option is undocumented. - Base string `url:"base,omitempty"` - - // The integer-valued request parameter parent changes the response to return a list of the files - // which are different in this commit compared to the given parent commit. This is useful for - // supporting review of merge commits. The value is the 1-based index of the parent’s position - // in the commit object. - Parent int `url:"parent,omitempty"` -} - -// PatchOptions specifies the parameters for GetPatch call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-patch -type PatchOptions struct { - // Adding query parameter zip (for example /changes/.../patch?zip) returns the patch as a single file inside of a ZIP archive. - // Clients can expand the ZIP to obtain the plain text patch, avoiding the need for a base64 decoding step. - // This option implies download. - Zip bool `url:"zip,omitempty"` - - // Query parameter download (e.g. /changes/.../patch?download) will suggest the browser save the patch as commitsha1.diff.base64, for later processing by command line tools. - Download bool `url:"download,omitempty"` - - // If the path parameter is set, the returned content is a diff of the single file that the path refers to. - Path string `url:"path,omitempty"` -} - -// GetDiff gets the diff of a file from a certain revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-diff -func (s *ChangesService) GetDiff(changeID, revisionID, fileID string, opt *DiffOptions) (*DiffInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/diff", changeID, revisionID, url.PathEscape(fileID)) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(DiffInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetRelatedChanges retrieves related changes of a revision. -// Related changes are changes that either depend on, or are dependencies of the revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-related-changes -func (s *ChangesService) GetRelatedChanges(changeID, revisionID string) (*RelatedChangesInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/related", changeID, revisionID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(RelatedChangesInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetDraft retrieves a draft comment of a revision that belongs to the calling user. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-draft -func (s *ChangesService) GetDraft(changeID, revisionID, draftID string) (*CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/drafts/%s", changeID, revisionID, draftID) - return s.getCommentInfoResponse(u) -} - -// GetComment retrieves a published comment of a revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-comment -func (s *ChangesService) GetComment(changeID, revisionID, commentID string) (*CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s//comments/%s", changeID, revisionID, commentID) - return s.getCommentInfoResponse(u) -} - -// GetSubmitType gets the method the server will use to submit (merge) the change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-submit-type -func (s *ChangesService) GetSubmitType(changeID, revisionID string) (string, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/submit_type", changeID, revisionID) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetRevisionActions retrieves revision actions of the revision of a change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-revision-actions -func (s *ChangesService) GetRevisionActions(changeID, revisionID string) (*map[string]ActionInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/actions", changeID, revisionID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]ActionInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetCommit retrieves a parsed commit of a revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-commit -func (s *ChangesService) GetCommit(changeID, revisionID string, opt *CommitOptions) (*CommitInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/commit", changeID, revisionID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(CommitInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetReview retrieves a review of a revision. -// -// As response a ChangeInfo entity with detailed labels and detailed accounts is returned that describes the review of the revision. -// The revision for which the review is retrieved is contained in the revisions field. -// In addition the current_revision field is set if the revision for which the review is retrieved is the current revision of the change. -// Please note that the returned labels are always for the current patch set. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-review -func (s *ChangesService) GetReview(changeID, revisionID string) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/review", changeID, revisionID) - return s.getChangeInfoResponse(u, nil) -} - -// GetMergeable gets the method the server will use to submit (merge) the change and an indicator if the change is currently mergeable. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-mergeable -func (s *ChangesService) GetMergeable(changeID, revisionID string, opt *MergableOptions) (*MergeableInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/mergeable", changeID, revisionID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(MergeableInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListRevisionDrafts lists the draft comments of a revision that belong to the calling user. -// Returns a map of file paths to lists of CommentInfo entries. -// The entries in the map are sorted by file path. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-drafts -func (s *ChangesService) ListRevisionDrafts(changeID, revisionID string) (*map[string][]CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/drafts/", changeID, revisionID) - return s.getCommentInfoMapSliceResponse(u) -} - -// ListRevisionComments lists the published comments of a revision. -// As result a map is returned that maps the file path to a list of CommentInfo entries. -// The entries in the map are sorted by file path and only include file (or inline) comments. -// Use the Get Change Detail endpoint to retrieve the general change message (or comment). -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-comments -func (s *ChangesService) ListRevisionComments(changeID, revisionID string) (*map[string][]CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/comments/", changeID, revisionID) - return s.getCommentInfoMapSliceResponse(u) -} - -// ListFiles lists the files that were modified, added or deleted in a revision. -// As result a map is returned that maps the file path to a list of FileInfo entries. -// The entries in the map are sorted by file path. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files -func (s *ChangesService) ListFiles(changeID, revisionID string, opt *FilesOptions) (map[string]FileInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/", changeID, revisionID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var v map[string]FileInfo - resp, err := s.client.Do(req, &v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListFilesReviewed lists the files that were modified, added or deleted in a revision. -// Unlike ListFiles, the response of ListFilesReviewed is a list of the paths the caller -// has marked as reviewed. Clients that also need the FileInfo should make two requests. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-files -func (s *ChangesService) ListFilesReviewed(changeID, revisionID string, opt *FilesOptions) ([]string, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/", changeID, revisionID) - - o := struct { - // The request parameter reviewed changes the response to return a list of the paths the caller has marked as reviewed. - Reviewed bool `url:"reviewed,omitempty"` - - FilesOptions - }{ - Reviewed: true, - } - if opt != nil { - o.FilesOptions = *opt - } - u, err := addOptions(u, o) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var v []string - resp, err := s.client.Do(req, &v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetReview sets a review on a revision. -// The review must be provided in the request body as a ReviewInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review -func (s *ChangesService) SetReview(changeID, revisionID string, input *ReviewInput) (*ReviewResult, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/review", changeID, revisionID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ReviewResult) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// PublishDraftRevision publishes a draft revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-draft-revision -func (s *ChangesService) PublishDraftRevision(changeID, revisionID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/publish", changeID, revisionID) - - req, err := s.client.NewRequest("POST", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// DeleteDraftRevision deletes a draft revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft-revision -func (s *ChangesService) DeleteDraftRevision(changeID, revisionID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s", changeID, revisionID) - return s.client.DeleteRequest(u, nil) -} - -// GetPatch gets the formatted patch for one revision. -// -// The formatted patch is returned as text encoded inside base64. -// Adding query parameter zip (for example /changes/.../patch?zip) returns the patch as a single file inside of a ZIP archive. -// Clients can expand the ZIP to obtain the plain text patch, avoiding the need for a base64 decoding step. -// This option implies download. -// -// Query parameter download (e.g. /changes/.../patch?download) will suggest the browser save the patch as commitsha1.diff.base64, for later processing by command line tools. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-patch -func (s *ChangesService) GetPatch(changeID, revisionID string, opt *PatchOptions) (*string, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/patch", changeID, revisionID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// TestSubmitType tests the submit_type Prolog rule in the project, or the one given. -// -// Request body may be either the Prolog code as text/plain or a RuleInput object. -// The query parameter filters may be set to SKIP to bypass parent project filters while testing a project-specific rule. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#test-submit-type -func (s *ChangesService) TestSubmitType(changeID, revisionID string, input *RuleInput) (*string, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/test.submit_type", changeID, revisionID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// TestSubmitRule tests the submit_rule Prolog rule in the project, or the one given. -// -// Request body may be either the Prolog code as text/plain or a RuleInput object. -// The query parameter filters may be set to SKIP to bypass parent project filters while testing a project-specific rule. -// -// The response is a list of SubmitRecord entries describing the permutations that satisfy the tested submit rule. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#test-submit-rule -func (s *ChangesService) TestSubmitRule(changeID, revisionID string, input *RuleInput) (*[]SubmitRecord, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/test.submit_rule", changeID, revisionID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new([]SubmitRecord) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateDraft creates a draft comment on a revision. -// The new draft comment must be provided in the request body inside a CommentInput entity. -// -// As response a CommentInfo entity is returned that describes the draft comment. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#create-draft -func (s *ChangesService) CreateDraft(changeID, revisionID string, input *CommentInput) (*CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/drafts", changeID, revisionID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(CommentInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// UpdateDraft updates a draft comment on a revision. -// The new draft comment must be provided in the request body inside a CommentInput entity. -// -// As response a CommentInfo entity is returned that describes the draft comment. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#update-draft -func (s *ChangesService) UpdateDraft(changeID, revisionID, draftID string, input *CommentInput) (*CommentInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/drafts/%s", changeID, revisionID, draftID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(CommentInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteDraft deletes a draft comment from a revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft -func (s *ChangesService) DeleteDraft(changeID, revisionID, draftID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/drafts/%s", changeID, revisionID, draftID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteReviewed deletes the reviewed flag of the calling user from a file of a revision. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-reviewed -func (s *ChangesService) DeleteReviewed(changeID, revisionID, fileID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/reviewed", changeID, revisionID, url.PathEscape(fileID)) - return s.client.DeleteRequest(u, nil) -} - -// GetContent gets the content of a file from a certain revision. -// The content is returned as base64 encoded string. -// The HTTP response Content-Type is always text/plain, reflecting the base64 wrapping. -// A Gerrit-specific X-FYI-Content-Type header is returned describing the server detected content type of the file. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-content -func (s *ChangesService) GetContent(changeID, revisionID, fileID string) (*string, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/content", changeID, revisionID, url.PathEscape(fileID)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetContentType gets the content type of a file from a certain revision. -// This is nearly the same as GetContent. -// But if only the content type is required, callers should use HEAD to avoid downloading the encoded file contents. -// -// For further documentation see GetContent. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-content -func (s *ChangesService) GetContentType(changeID, revisionID, fileID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/content", changeID, revisionID, url.PathEscape(fileID)) - - req, err := s.client.NewRequest("HEAD", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// SetReviewed marks a file of a revision as reviewed by the calling user. -// -// If the file was already marked as reviewed by the calling user the response is “200 OK”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-reviewed -func (s *ChangesService) SetReviewed(changeID, revisionID, fileID string) (*Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/files/%s/reviewed", changeID, revisionID, url.PathEscape(fileID)) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// CherryPickRevision cherry picks a revision to a destination branch. -// The commit message and destination branch must be provided in the request body inside a CherryPickInput entity. -// -// As response a ChangeInfo entity is returned that describes the resulting cherry picked change. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#cherry-pick -func (s *ChangesService) CherryPickRevision(changeID, revisionID string, input *CherryPickInput) (*ChangeInfo, *Response, error) { - u := fmt.Sprintf("changes/%s/revisions/%s/cherrypick", changeID, revisionID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ChangeInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -/* -TODO: Missing Revision Endpoints - Rebase Revision - Submit Revision - DownloadContent (https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-safe-content) -*/ diff --git a/vendor/github.com/andygrunwald/go-gerrit/config.go b/vendor/github.com/andygrunwald/go-gerrit/config.go deleted file mode 100644 index 088b0fb4..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/config.go +++ /dev/null @@ -1,529 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// ConfigService contains Config related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html -type ConfigService struct { - client *Client -} - -// TopMenuItemInfo entity contains information about a menu item in a top menu entry. -type TopMenuItemInfo struct { - URL string `json:"url"` - Name string `json:"name"` - Target string `json:"target"` - ID string `json:"id,omitempty"` -} - -// AuthInfo entity contains information about the authentication configuration of the Gerrit server. -type AuthInfo struct { - Type string `json:"type"` - UseContributorAgreements bool `json:"use_contributor_agreements,omitempty"` - EditableAccountFields []string `json:"editable_account_fields"` - LoginURL string `json:"login_url,omitempty"` - LoginText string `json:"login_text,omitempty"` - SwitchAccountURL string `json:"switch_account_url,omitempty"` - RegisterURL string `json:"register_url,omitempty"` - RegisterText string `json:"register_text,omitempty"` - EditFullNameURL string `json:"edit_full_name_url,omitempty"` - HTTPPasswordURL string `json:"http_password_url,omitempty"` - IsGitBasicAuth bool `json:"is_git_basic_auth,omitempty"` -} - -// CacheInfo entity contains information about a cache. -type CacheInfo struct { - Name string `json:"name,omitempty"` - Type string `json:"type"` - Entries EntriesInfo `json:"entries"` - AverageGet string `json:"average_get,omitempty"` - HitRatio HitRatioInfo `json:"hit_ratio"` -} - -// CacheOperationInput entity contains information about an operation that should be executed on caches. -type CacheOperationInput struct { - Operation string `json:"operation"` - Caches []string `json:"caches,omitempty"` -} - -// ConfigCapabilityInfo entity contains information about a capability.type -type ConfigCapabilityInfo struct { - ID string `json:"id"` - Name string `json:"name"` -} - -// HitRatioInfo entity contains information about the hit ratio of a cache. -type HitRatioInfo struct { - Mem int `json:"mem"` - Disk int `json:"disk,omitempty"` -} - -// EntriesInfo entity contains information about the entries in a cache. -type EntriesInfo struct { - Mem int `json:"mem,omitempty"` - Disk int `json:"disk,omitempty"` - Space string `json:"space,omitempty"` -} - -// UserConfigInfo entity contains information about Gerrit configuration from the user section. -type UserConfigInfo struct { - AnonymousCowardName string `json:"anonymous_coward_name"` -} - -// TopMenuEntryInfo entity contains information about a top menu entry. -type TopMenuEntryInfo struct { - Name string `json:"name"` - Items []TopMenuItemInfo `json:"items"` -} - -// ThreadSummaryInfo entity contains information about the current threads. -type ThreadSummaryInfo struct { - CPUs int `json:"cpus"` - Threads int `json:"threads"` - Counts map[string]map[string]int `json:"counts"` -} - -// TaskSummaryInfo entity contains information about the current tasks. -type TaskSummaryInfo struct { - Total int `json:"total,omitempty"` - Running int `json:"running,omitempty"` - Ready int `json:"ready,omitempty"` - Sleeping int `json:"sleeping,omitempty"` -} - -// TaskInfo entity contains information about a task in a background work queue. -type TaskInfo struct { - ID string `json:"id"` - State string `json:"state"` - StartTime string `json:"start_time"` - Delay int `json:"delay"` - Command string `json:"command"` - RemoteName string `json:"remote_name,omitempty"` - Project string `json:"project,omitempty"` -} - -// SummaryInfo entity contains information about the current state of the server. -type SummaryInfo struct { - TaskSummary TaskSummaryInfo `json:"task_summary"` - MemSummary MemSummaryInfo `json:"mem_summary"` - ThreadSummary ThemeInfo `json:"thread_summary"` - JVMSummary JvmSummaryInfo `json:"jvm_summary,omitempty"` -} - -// SuggestInfo entity contains information about Gerrit configuration from the suggest section. -type SuggestInfo struct { - From int `json:"from"` -} - -// SSHdInfo entity contains information about Gerrit configuration from the sshd section. -type SSHdInfo struct{} - -// ServerInfo entity contains information about the configuration of the Gerrit server. -type ServerInfo struct { - Auth AuthInfo `json:"auth"` - Change ChangeConfigInfo `json:"change"` - Download DownloadInfo `json:"download"` - Gerrit Info `json:"gerrit"` - Gitweb map[string]string `json:"gitweb,omitempty"` - Plugin PluginConfigInfo `json:"plugin"` - Receive ReceiveInfo `json:"receive,omitempty"` - SSHd SSHdInfo `json:"sshd,omitempty"` - Suggest SuggestInfo `json:"suggest"` - URLAliases map[string]string `json:"url_aliases,omitempty"` - User UserConfigInfo `json:"user"` -} - -// ReceiveInfo entity contains information about the configuration of git-receive-pack behavior on the server. -type ReceiveInfo struct { - EnableSignedPush bool `json:"enableSignedPush,omitempty"` -} - -// PluginConfigInfo entity contains information about Gerrit extensions by plugins. -type PluginConfigInfo struct { - // HasAvatars reports whether an avatar provider is registered. - HasAvatars bool `json:"has_avatars,omitempty"` -} - -// MemSummaryInfo entity contains information about the current memory usage. -type MemSummaryInfo struct { - Total string `json:"total"` - Used string `json:"used"` - Free string `json:"free"` - Buffers string `json:"buffers"` - Max string `json:"max"` - OpenFiles int `json:"open_files,omitempty"` -} - -// JvmSummaryInfo entity contains information about the JVM. -type JvmSummaryInfo struct { - VMVendor string `json:"vm_vendor"` - VMName string `json:"vm_name"` - VMVersion string `json:"vm_version"` - OSName string `json:"os_name"` - OSVersion string `json:"os_version"` - OSArch string `json:"os_arch"` - User string `json:"user"` - Host string `json:"host,omitempty"` - CurrentWorkingDirectory string `json:"current_working_directory"` - Site string `json:"site"` -} - -// Info entity contains information about Gerrit configuration from the gerrit section. -type Info struct { - AllProjectsName string `json:"all_projects_name"` - AllUsersName string `json:"all_users_name"` - DocURL string `json:"doc_url,omitempty"` - ReportBugURL string `json:"report_bug_url,omitempty"` - ReportBugText string `json:"report_bug_text,omitempty"` -} - -// GitwebInfo entity contains information about the gitweb configuration. -type GitwebInfo struct { - URL string `json:"url"` - Type GitwebTypeInfo `json:"type"` -} - -// GitwebTypeInfo entity contains information about the gitweb configuration. -type GitwebTypeInfo struct { - Name string `json:"name"` - Revision string `json:"revision,omitempty"` - Project string `json:"project,omitempty"` - Branch string `json:"branch,omitempty"` - RootTree string `json:"root_tree,omitempty"` - File string `json:"file,omitempty"` - FileHistory string `json:"file_history,omitempty"` - PathSeparator string `json:"path_separator"` - LinkDrafts bool `json:"link_drafts,omitempty"` - URLEncode bool `json:"url_encode,omitempty"` -} - -// EmailConfirmationInput entity contains information for confirming an email address. -type EmailConfirmationInput struct { - Token string `json:"token"` -} - -// DownloadSchemeInfo entity contains information about a supported download scheme and its commands. -type DownloadSchemeInfo struct { - URL string `json:"url"` - IsAuthRequired bool `json:"is_auth_required,omitempty"` - IsAuthSupported bool `json:"is_auth_supported,omitempty"` - Commands map[string]string `json:"commands"` - CloneCommands map[string]string `json:"clone_commands"` -} - -// DownloadInfo entity contains information about supported download options. -type DownloadInfo struct { - Schemes map[string]DownloadSchemeInfo `json:"schemes"` - Archives []string `json:"archives"` -} - -// ChangeConfigInfo entity contains information about Gerrit configuration from the change section. -type ChangeConfigInfo struct { - AllowDrafts bool `json:"allow_drafts,omitempty"` - LargeChange int `json:"large_change"` - ReplyLabel string `json:"reply_label"` - ReplyTooltip string `json:"reply_tooltip"` - UpdateDelay int `json:"update_delay"` - SubmitWholeTopic bool `json:"submit_whole_topic"` -} - -// ListCachesOptions specifies the different output formats. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-caches -type ListCachesOptions struct { - // Format specifies the different output formats. - Format string `url:"format,omitempty"` -} - -// SummaryOptions specifies the different options for the GetSummary call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-summary -type SummaryOptions struct { - // JVM includes a JVM summary. - JVM bool `url:"jvm,omitempty"` - // GC requests a Java garbage collection before computing the information about the Java memory heap. - GC bool `url:"gc,omitempty"` -} - -// GetVersion returns the version of the Gerrit server. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-version -func (s *ConfigService) GetVersion() (string, *Response, error) { - u := "config/server/version" - return getStringResponseWithoutOptions(s.client, u) -} - -// GetServerInfo returns the information about the Gerrit server configuration. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-info -func (s *ConfigService) GetServerInfo() (*ServerInfo, *Response, error) { - u := "config/server/info" - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(ServerInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListCaches lists the caches of the server. Caches defined by plugins are included. -// The caller must be a member of a group that is granted one of the following capabilities: -// * View Caches -// * Maintain Server -// * Administrate Server -// The entries in the map are sorted by cache name. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-caches -func (s *ConfigService) ListCaches(opt *ListCachesOptions) (*map[string]CacheInfo, *Response, error) { - u := "config/server/caches/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]CacheInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetCache retrieves information about a cache. -// The caller must be a member of a group that is granted one of the following capabilities: -// * View Caches -// * Maintain Server -// * Administrate Server -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-cache -func (s *ConfigService) GetCache(cacheName string) (*CacheInfo, *Response, error) { - u := fmt.Sprintf("config/server/caches/%s", cacheName) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(CacheInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetSummary retrieves a summary of the current server state. -// The caller must be a member of a group that is granted the Administrate Server capability. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-summary -func (s *ConfigService) GetSummary(opt *SummaryOptions) (*SummaryInfo, *Response, error) { - u := "config/server/summary" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(SummaryInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListCapabilities lists the capabilities that are available in the system. -// There are two kinds of capabilities: core and plugin-owned capabilities. -// The entries in the map are sorted by capability ID. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-capabilities -func (s *ConfigService) ListCapabilities() (*map[string]ConfigCapabilityInfo, *Response, error) { - u := "config/server/capabilities" - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]ConfigCapabilityInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ListTasks lists the tasks from the background work queues that the Gerrit daemon is currently performing, or will perform in the near future. -// Gerrit contains an internal scheduler, similar to cron, that it uses to queue and dispatch both short and long term tasks. -// Tasks that are completed or canceled exit the queue very quickly once they enter this state, but it can be possible to observe tasks in these states. -// End-users may see a task only if they can also see the project the task is associated with. -// Tasks operating on other projects, or that do not have a specific project, are hidden. -// -// The caller must be a member of a group that is granted one of the following capabilities: -// * View Queue -// * Maintain Server -// * Administrate Server -// -// The entries in the list are sorted by task state, remaining delay and command. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#list-tasks -func (s *ConfigService) ListTasks() (*[]TaskInfo, *Response, error) { - u := "config/server/tasks" - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]TaskInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetTask retrieves a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future. -// End-users may see a task only if they can also see the project the task is associated with. -// Tasks operating on other projects, or that do not have a specific project, are hidden. -// -// The caller must be a member of a group that is granted one of the following capabilities: -// * View Queue -// * Maintain Server -// * Administrate Server -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-task -func (s *ConfigService) GetTask(taskID string) (*TaskInfo, *Response, error) { - u := fmt.Sprintf("config/server/tasks/%s", taskID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(TaskInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetTopMenus returns the list of additional top menu entries. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#get-top-menus -func (s *ConfigService) GetTopMenus() (*[]TopMenuEntryInfo, *Response, error) { - u := "config/server/top-menus" - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]TopMenuEntryInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// ConfirmEmail confirms that the user owns an email address. -// The email token must be provided in the request body inside an EmailConfirmationInput entity. -// -// The response is “204 No Content”. -// If the token is invalid or if it’s the token of another user the request fails and the response is “422 Unprocessable Entity”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#confirm-email -func (s *ConfigService) ConfirmEmail(input *EmailConfirmationInput) (*Response, error) { - u := "config/server/email.confirm" - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// CacheOperations executes a cache operation that is specified in the request body in a CacheOperationInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#cache-operations -func (s *ConfigService) CacheOperations(input *CacheOperationInput) (*Response, error) { - u := "config/server/caches/" - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// FlushCache flushes a cache. -// The caller must be a member of a group that is granted one of the following capabilities: -// -// * Flush Caches (any cache except "web_sessions") -// * Maintain Server (any cache including "web_sessions") -// * Administrate Server (any cache including "web_sessions") -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#flush-cache -func (s *ConfigService) FlushCache(cacheName string, input *CacheOperationInput) (*Response, error) { - u := fmt.Sprintf("config/server/caches/%s/flush", cacheName) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} - -// DeleteTask kills a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future. -// The caller must be a member of a group that is granted one of the following capabilities: -// -// * Kill Task -// * Maintain Server -// * Administrate Server -// -// End-users may see a task only if they can also see the project the task is associated with. -// Tasks operating on other projects, or that do not have a specific project, are hidden. -// Members of a group granted one of the following capabilities may view all tasks: -// -// * View Queue -// * Maintain Server -// * Administrate Server -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#delete-task -func (s *ConfigService) DeleteTask(taskID string) (*Response, error) { - u := fmt.Sprintf("config/server/tasks/%s", taskID) - return s.client.DeleteRequest(u, nil) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/doc.go b/vendor/github.com/andygrunwald/go-gerrit/doc.go deleted file mode 100644 index e3336ef3..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/doc.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Package gerrit provides a client for using the Gerrit API. - -Construct a new Gerrit client, then use the various services on the client to -access different parts of the Gerrit API. For example: - - instance := "https://go-review.googlesource.com/" - client, _ := gerrit.NewClient(instance, nil) - - // Get all public projects - projects, _, err := client.Projects.ListProjects(nil) - -Set optional parameters for an API method by passing an Options object. - - // Get all projects with descriptions - opt := &gerrit.ProjectOptions{ - Description: true, - } - projects, _, err := client.Projects.ListProjects(opt) - -The services of a client divide the API into logical chunks and correspond to -the structure of the Gerrit API documentation at -https://gerrit-review.googlesource.com/Documentation/rest-api.html#_endpoints. - -Authentication - -The go-gerrit library supports various methods to support the authentication. -This methods are combined in the AuthenticationService that is available at client.Authentication. - -One way is an authentication via HTTP cookie. -Some Gerrit instances hosted like the one hosted googlesource.com (e.g. https://go-review.googlesource.com/, -https://android-review.googlesource.com/ or https://gerrit-review.googlesource.com/) support HTTP Cookie authentication. - -You need the cookie name and the cookie value. -You can get them by click on "Settings > HTTP Password > Obtain Password" in your Gerrit instance. -There you can receive your values. -The cookie name will be (mostly) "o" (if hosted on googlesource.com). -Your cookie secret will be something like "git-your@email.com=SomeHash...". - - instance := "https://gerrit-review.googlesource.com/" - client, _ := gerrit.NewClient(instance, nil) - client.Authentication.SetCookieAuth("o", "my-cookie-secret") - - self, _, _ := client.Accounts.GetAccount("self") - - fmt.Printf("Username: %s", self.Name) - - // Username: Andy G. - -Some other Gerrit instances (like https://review.typo3.org/) has auth.gitBasicAuth activated. -With this you can authenticate with HTTP Basic like this: - - instance := "https://review.typo3.org/" - client, _ := gerrit.NewClient(instance, nil) - client.Authentication.SetBasicAuth("andy.grunwald", "my secrect password") - - self, _, _ := client.Accounts.GetAccount("self") - - fmt.Printf("Username: %s", self.Name) - - // Username: Andy Grunwald - -Additionally when creating a new client, pass an http.Client that supports further actions for you. -For more information regarding authentication have a look at the Gerrit documentation: -https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication - -*/ -package gerrit diff --git a/vendor/github.com/andygrunwald/go-gerrit/events.go b/vendor/github.com/andygrunwald/go-gerrit/events.go deleted file mode 100644 index 4850ba4b..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/events.go +++ /dev/null @@ -1,166 +0,0 @@ -package gerrit - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/url" - "time" -) - -// PatchSet contains detailed information about a specific patch set. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/json.html#patchSet -type PatchSet struct { - Number Number `json:"number"` - Revision string `json:"revision"` - Parents []string `json:"parents"` - Ref string `json:"ref"` - Uploader AccountInfo `json:"uploader"` - Author AccountInfo `json:"author"` - CreatedOn int `json:"createdOn"` - IsDraft bool `json:"isDraft"` - Kind string `json:"kind"` -} - -// RefUpdate contains data about a reference update. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/json.html#refUpdate -type RefUpdate struct { - OldRev string `json:"oldRev"` - NewRev string `json:"newRev"` - RefName string `json:"refName"` - Project string `json:"project"` -} - -// EventInfo contains information about an event emitted by Gerrit. This -// structure can be used either when parsing streamed events or when reading -// the output of the events-log plugin. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html#events -type EventInfo struct { - Type string `json:"type"` - Change ChangeInfo `json:"change,omitempty"` - ChangeKey ChangeInfo `json:"changeKey,omitempty"` - PatchSet PatchSet `json:"patchSet,omitempty"` - EventCreatedOn int `json:"eventCreatedOn,omitempty"` - Reason string `json:"reason,omitempty"` - Abandoner AccountInfo `json:"abandoner,omitempty"` - Restorer AccountInfo `json:"restorer,omitempty"` - Submitter AccountInfo `json:"submitter,omitempty"` - Author AccountInfo `json:"author,omitempty"` - Uploader AccountInfo `json:"uploader,omitempty"` - Approvals []AccountInfo `json:"approvals,omitempty"` - Comment string `json:"comment,omitempty"` - Editor AccountInfo `json:"editor,omitempty"` - Added []string `json:"added,omitempty"` - Removed []string `json:"removed,omitempty"` - Hashtags []string `json:"hashtags,omitempty"` - RefUpdate RefUpdate `json:"refUpdate,omitempty"` - Project ProjectInfo `json:"project,omitempty"` - Reviewer AccountInfo `json:"reviewer,omitempty"` - OldTopic string `json:"oldTopic,omitempty"` - Changer AccountInfo `json:"changer,omitempty"` -} - -// EventsLogService contains functions for querying the API provided -// by the optional events-log plugin. -type EventsLogService struct { - client *Client -} - -// EventsLogOptions contains options for querying events from the events-logs -// plugin. -type EventsLogOptions struct { - From time.Time - To time.Time - - // IgnoreUnmarshalErrors will cause GetEvents to ignore any errors - // that come up when calling json.Unmarshal. This can be useful in - // cases where the events-log plugin was not kept up to date with - // the Gerrit version for some reason. In these cases the events-log - // plugin will return data structs that don't match the EventInfo - // struct which in turn causes issues for json.Unmarshal. - IgnoreUnmarshalErrors bool -} - -// getURL returns the url that should be used in the request. This will vary -// depending on the options provided to GetEvents. -func (events *EventsLogService) getURL(options *EventsLogOptions) (string, error) { - parsed, err := url.Parse("/plugins/events-log/events/") - if err != nil { - return "", err - } - - query := parsed.Query() - - if !options.From.IsZero() { - query.Set("t1", options.From.Format("2006-01-02 15:04:05")) - } - - if !options.To.IsZero() { - query.Set("t2", options.To.Format("2006-01-02 15:04:05")) - } - - encoded := query.Encode() - if len(encoded) > 0 { - parsed.RawQuery = encoded - } - - return parsed.String(), nil -} - -// GetEvents returns a list of events for the given input options. Use of this -// function requires an authenticated user and for the events-log plugin to be -// installed. This function returns the unmarshalled EventInfo structs, response, -// failed lines and errors. Marshaling errors will cause this function to return -// before processing is complete unless you set EventsLogOptions.IgnoreUnmarshalErrors -// to true. This can be useful in cases where the events-log plugin got out of sync -// with the Gerrit version which in turn produced events which can't be transformed -// unmarshalled into EventInfo. -// -// Gerrit API docs: https:///plugins/events-log/Documentation/rest-api-events.html -func (events *EventsLogService) GetEvents(options *EventsLogOptions) ([]EventInfo, *Response, [][]byte, error) { - info := []EventInfo{} - failures := [][]byte{} - requestURL, err := events.getURL(options) - - if err != nil { - return info, nil, failures, err - } - - request, err := events.client.NewRequest("GET", requestURL, nil) - if err != nil { - return info, nil, failures, err - } - - // Perform the request but do not pass in a structure to unpack - // the response into. The format of the response is one EventInfo - // object per line so we need to manually handle the response here. - response, err := events.client.Do(request, nil) - if err != nil { - return info, response, failures, err - } - - body, err := ioutil.ReadAll(response.Body) - defer response.Body.Close() // nolint: errcheck - if err != nil { - return info, response, failures, err - } - - for _, line := range bytes.Split(body, []byte("\n")) { - if len(line) > 0 { - event := EventInfo{} - if err := json.Unmarshal(line, &event); err != nil { // nolint: vetshadow - failures = append(failures, line) - - if !options.IgnoreUnmarshalErrors { - return info, response, failures, err - } - continue - } - info = append(info, event) - } - } - return info, response, failures, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/gerrit.go b/vendor/github.com/andygrunwald/go-gerrit/gerrit.go deleted file mode 100644 index ebcbda00..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/gerrit.go +++ /dev/null @@ -1,564 +0,0 @@ -package gerrit - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "regexp" - "strings" - - "github.com/google/go-querystring/query" -) - -// TODO Try to reduce the code duplications of a std API req -// Maybe with http://play.golang.org/p/j-667shCCB -// and https://groups.google.com/forum/#!topic/golang-nuts/D-gIr24k5uY - -// A Client manages communication with the Gerrit API. -type Client struct { - // client is the HTTP client used to communicate with the API. - client *http.Client - - // baseURL is the base URL of the Gerrit instance for API requests. - // It must have a trailing slash. - baseURL *url.URL - - // Gerrit service for authentication. - Authentication *AuthenticationService - - // Services used for talking to different parts of the standard Gerrit API. - Access *AccessService - Accounts *AccountsService - Changes *ChangesService - Config *ConfigService - Groups *GroupsService - Plugins *PluginsService - Projects *ProjectsService - - // Additional services used for talking to non-standard Gerrit APIs. - EventsLog *EventsLogService -} - -// Response is a Gerrit API response. -// This wraps the standard http.Response returned from Gerrit. -type Response struct { - *http.Response -} - -var ( - // ErrNoInstanceGiven is returned by NewClient in the event the - // gerritURL argument was blank. - ErrNoInstanceGiven = errors.New("no Gerrit instance given") - - // ErrUserProvidedWithoutPassword is returned by NewClient - // if a user name is provided without a password. - ErrUserProvidedWithoutPassword = errors.New("a username was provided without a password") - - // ErrAuthenticationFailed is returned by NewClient in the event the provided - // credentials didn't allow us to query account information using digest, basic or cookie - // auth. - ErrAuthenticationFailed = errors.New("failed to authenticate using the provided credentials") - - // ReParseURL is used to parse the url provided to NewClient(). This - // regular expression contains five groups which capture the scheme, - // username, password, hostname and port. If we parse the url with this - // regular expression - ReParseURL = regexp.MustCompile(`^(http|https)://(.+):(.+)@(.+):(\d+)(.*)$`) -) - -// NewClient returns a new Gerrit API client. gerritURL specifies the -// HTTP endpoint of the Gerrit instance. For example, "http://localhost:8080/". -// If gerritURL does not have a trailing slash, one is added automatically. -// If a nil httpClient is provided, http.DefaultClient will be used. -// -// The url may contain credentials, http://admin:secret@localhost:8081/ for -// example. These credentials may either be a user name and password or -// name and value as in the case of cookie based authentication. If the url contains -// credentials then this function will attempt to validate the credentials before -// returning the client. ErrAuthenticationFailed will be returned if the credentials -// cannot be validated. The process of validating the credentials is relatively simple and -// only requires that the provided user have permission to GET /a/accounts/self. -func NewClient(gerritURL string, httpClient *http.Client) (*Client, error) { - if httpClient == nil { - httpClient = http.DefaultClient - } - - endpoint := gerritURL - if endpoint == "" { - return nil, ErrNoInstanceGiven - } - - hasAuth := false - username := "" - password := "" - - // Depending on the contents of the username and password the default - // url.Parse may not work. The below is an example URL that - // would end up being parsed incorrectly with url.Parse: - // http://admin:ZOSOKjgV/kgEkN0bzPJp+oGeJLqpXykqWFJpon/Ckg@localhost:38607 - // So instead of depending on url.Parse we'll try using a regular expression - // first to match a specific pattern. If that ends up working we modify - // the incoming endpoint to remove the username and password so the rest - // of this function will run as expected. - submatches := ReParseURL.FindAllStringSubmatch(endpoint, -1) - if len(submatches) > 0 && len(submatches[0]) > 5 { - submatch := submatches[0] - username = submatch[2] - password = submatch[3] - endpoint = fmt.Sprintf( - "%s://%s:%s%s", submatch[1], submatch[4], submatch[5], submatch[6]) - hasAuth = true - } - - baseURL, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - if !strings.HasSuffix(baseURL.Path, "/") { - baseURL.Path += "/" - } - - // Note, if we retrieved the URL and password using the regular - // expression above then the below code will do nothing. - if baseURL.User != nil { - username = baseURL.User.Username() - parsedPassword, haspassword := baseURL.User.Password() - - // Catches cases like http://user@localhost:8081/ where no password - // was at all. If a blank password is required - if !haspassword { - return nil, ErrUserProvidedWithoutPassword - } - - password = parsedPassword - - // Reconstruct the url but without the username and password. - baseURL, err = url.Parse( - fmt.Sprintf("%s://%s%s", baseURL.Scheme, baseURL.Host, baseURL.RequestURI())) - if err != nil { - return nil, err - } - hasAuth = true - } - - c := &Client{ - client: httpClient, - baseURL: baseURL, - } - c.Authentication = &AuthenticationService{client: c} - c.Access = &AccessService{client: c} - c.Accounts = &AccountsService{client: c} - c.Changes = &ChangesService{client: c} - c.Config = &ConfigService{client: c} - c.Groups = &GroupsService{client: c} - c.Plugins = &PluginsService{client: c} - c.Projects = &ProjectsService{client: c} - c.EventsLog = &EventsLogService{client: c} - - if hasAuth { - // Digest auth (first since that's the default auth type) - c.Authentication.SetDigestAuth(username, password) - if success, err := checkAuth(c); success || err != nil { - return c, err - } - - // Basic auth - c.Authentication.SetBasicAuth(username, password) - if success, err := checkAuth(c); success || err != nil { - return c, err - } - - // Cookie auth - c.Authentication.SetCookieAuth(username, password) - if success, err := checkAuth(c); success || err != nil { - return c, err - } - - // Reset auth in case the consumer needs to do something special. - c.Authentication.ResetAuth() - return c, ErrAuthenticationFailed - } - - return c, nil -} - -// checkAuth is used by NewClient to check if the current credentials are -// valid. If the response is 401 Unauthorized then the error will be discarded. -func checkAuth(client *Client) (bool, error) { - _, response, err := client.Accounts.GetAccount("self") - switch err { - case ErrWWWAuthenticateHeaderMissing: - return false, nil - case ErrWWWAuthenticateHeaderNotDigest: - return false, nil - default: - // Response could be nil if the connection outright failed - // or some other error occurred before we got a response. - if response == nil && err != nil { - return false, err - } - - if err != nil && response.StatusCode == http.StatusUnauthorized { - err = nil - } - return response.StatusCode == http.StatusOK, err - } -} - -// NewRequest creates an API request. -// A relative URL can be provided in urlStr, in which case it is resolved relative to the baseURL of the Client. -// Relative URLs should always be specified without a preceding slash. -// If specified, the value pointed to by body is JSON encoded and included as the request body. -func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) { - // Build URL for request - u, err := c.buildURLForRequest(urlStr) - if err != nil { - return nil, err - } - - var buf io.ReadWriter - if body != nil { - buf = new(bytes.Buffer) - err = json.NewEncoder(buf).Encode(body) - if err != nil { - return nil, err - } - } - - req, err := http.NewRequest(method, u, buf) - if err != nil { - return nil, err - } - - // Apply Authentication - if err := c.addAuthentication(req); err != nil { - return nil, err - } - - // Request compact JSON - // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output - req.Header.Add("Accept", "application/json") - req.Header.Add("Content-Type", "application/json") - - // TODO: Add gzip encoding - // Accept-Encoding request header is set to gzip - // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output - - return req, nil -} - -// NewRawPutRequest creates a raw PUT request and makes no attempt to encode -// or marshal the body. Just passes it straight through. -func (c *Client) NewRawPutRequest(urlStr string, body string) (*http.Request, error) { - // Build URL for request - u, err := c.buildURLForRequest(urlStr) - if err != nil { - return nil, err - } - - buf := bytes.NewBuffer([]byte(body)) - req, err := http.NewRequest("PUT", u, buf) - if err != nil { - return nil, err - } - - // Apply Authentication - if err := c.addAuthentication(req); err != nil { - return nil, err - } - - // Request compact JSON - // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output - req.Header.Add("Accept", "application/json") - req.Header.Add("Content-Type", "application/x-www-form-urlencoded") - - // TODO: Add gzip encoding - // Accept-Encoding request header is set to gzip - // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output - - return req, nil -} - -// Call is a combine function for Client.NewRequest and Client.Do. -// -// Most API methods are quite the same. -// Get the URL, apply options, make a request, and get the response. -// Without adding special headers or something. -// To avoid a big amount of code duplication you can Client.Call. -// -// method is the HTTP method you want to call. -// u is the URL you want to call. -// body is the HTTP body. -// v is the HTTP response. -// -// For more information read https://github.com/google/go-github/issues/234 -func (c *Client) Call(method, u string, body interface{}, v interface{}) (*Response, error) { - req, err := c.NewRequest(method, u, body) - if err != nil { - return nil, err - } - - resp, err := c.Do(req, v) - if err != nil { - return resp, err - } - - return resp, err -} - -// buildURLForRequest will build the URL (as string) that will be called. -// We need such a utility method, because the URL.Path needs to be escaped (partly). -// -// E.g. if a project is called via "projects/%s" and the project is named "plugin/delete-project" -// there has to be "projects/plugin%25Fdelete-project" instead of "projects/plugin/delete-project". -// The second url will return nothing. -func (c *Client) buildURLForRequest(urlStr string) (string, error) { - // If there is a "/" at the start, remove it. - // TODO: It can be arranged for all callers of buildURLForRequest to never have a "/" prefix, - // which can be ensured via tests. This is how it's done in go-github. - // Then, this run-time check becomes unnecessary and can be removed. - urlStr = strings.TrimPrefix(urlStr, "/") - - // If we are authenticated, let's apply the "a/" prefix, - // but only if it has not already been applied. - if c.Authentication.HasAuth() && !strings.HasPrefix(urlStr, "a/") { - urlStr = "a/" + urlStr - } - - rel, err := url.Parse(urlStr) - if err != nil { - return "", err - } - - return c.baseURL.String() + rel.String(), nil -} - -// Do sends an API request and returns the API response. -// The API response is JSON decoded and stored in the value pointed to by v, -// or returned as an error if an API error has occurred. -// If v implements the io.Writer interface, the raw response body will be written to v, -// without attempting to first decode it. -func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) { - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - - // Wrap response - response := &Response{Response: resp} - - err = CheckResponse(resp) - if err != nil { - // even though there was an error, we still return the response - // in case the caller wants to inspect it further - return response, err - } - - if v != nil { - defer resp.Body.Close() // nolint: errcheck - if w, ok := v.(io.Writer); ok { - if _, err := io.Copy(w, resp.Body); err != nil { // nolint: vetshadow - return nil, err - } - } else { - var body []byte - body, err = ioutil.ReadAll(resp.Body) - if err != nil { - // even though there was an error, we still return the response - // in case the caller wants to inspect it further - return response, err - } - - body = RemoveMagicPrefixLine(body) - err = json.Unmarshal(body, v) - } - } - return response, err -} - -func (c *Client) addAuthentication(req *http.Request) error { - // Apply HTTP Basic Authentication - if c.Authentication.HasBasicAuth() { - req.SetBasicAuth(c.Authentication.name, c.Authentication.secret) - return nil - } - - // Apply HTTP Cookie - if c.Authentication.HasCookieAuth() { - req.AddCookie(&http.Cookie{ - Name: c.Authentication.name, - Value: c.Authentication.secret, - }) - return nil - } - - // Apply Digest Authentication. If we're using digest based - // authentication we need to make a request, process the - // WWW-Authenticate header, then set the Authorization header on the - // incoming request. We do not need to send a body along because - // the request itself should fail first. - if c.Authentication.HasDigestAuth() { - uri, err := c.buildURLForRequest(req.URL.RequestURI()) - if err != nil { - return err - } - - // WARNING: Don't use c.NewRequest here unless you like - // infinite recursion. - digestRequest, err := http.NewRequest(req.Method, uri, nil) - digestRequest.Header.Set("Accept", "*/*") - digestRequest.Header.Set("Content-Type", "application/json") - if err != nil { - return err - } - - response, err := c.client.Do(digestRequest) - if err != nil { - return err - } - - // When the function exits discard the rest of the - // body and close it. This should cause go to - // reuse the connection. - defer io.Copy(ioutil.Discard, response.Body) // nolint: errcheck - defer response.Body.Close() // nolint: errcheck - - if response.StatusCode == http.StatusUnauthorized { - authorization, err := c.Authentication.digestAuthHeader(response) - if err != nil { - return err - } - req.Header.Set("Authorization", authorization) - } - } - - return nil -} - -// DeleteRequest sends an DELETE API Request to urlStr with optional body. -// It is a shorthand combination for Client.NewRequest with Client.Do. -// -// Relative URLs should always be specified without a preceding slash. -// If specified, the value pointed to by body is JSON encoded and included as the request body. -func (c *Client) DeleteRequest(urlStr string, body interface{}) (*Response, error) { - req, err := c.NewRequest("DELETE", urlStr, body) - if err != nil { - return nil, err - } - - return c.Do(req, nil) -} - -// BaseURL returns the client's Gerrit instance HTTP endpoint. -func (c *Client) BaseURL() url.URL { - return *c.baseURL -} - -// RemoveMagicPrefixLine removes the "magic prefix line" of Gerris JSON -// response if present. The JSON response body starts with a magic prefix line -// that must be stripped before feeding the rest of the response body to a JSON -// parser. The reason for this is to prevent against Cross Site Script -// Inclusion (XSSI) attacks. By default all standard Gerrit APIs include this -// prefix line though some plugins may not. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#output -func RemoveMagicPrefixLine(body []byte) []byte { - if bytes.HasPrefix(body, magicPrefix) { - return body[5:] - } - return body -} - -var magicPrefix = []byte(")]}'\n") - -// CheckResponse checks the API response for errors, and returns them if present. -// A response is considered an error if it has a status code outside the 200 range. -// API error responses are expected to have no response body. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#response-codes -func CheckResponse(r *http.Response) error { - if c := r.StatusCode; 200 <= c && c <= 299 { - return nil - } - - // Some calls require an authentification - // In such cases errors like: - // API call to https://review.typo3.org/accounts/self failed: 403 Forbidden - // will be thrown. - - err := fmt.Errorf("API call to %s failed: %s", r.Request.URL.String(), r.Status) - return err -} - -// queryParameterReplacements are values in a url, specifically the query -// portion of the url, which should not be escaped before being sent to -// Gerrit. Note, Gerrit itself does not escape these values when using the -// search box so we shouldn't escape them either. -var queryParameterReplacements = map[string]string{ - "+": "GOGERRIT_URL_PLACEHOLDER_PLUS", - ":": "GOGERRIT_URL_PLACEHOLDER_COLON"} - -// addOptions adds the parameters in opt as URL query parameters to s. -// opt must be a struct whose fields may contain "url" tags. -func addOptions(s string, opt interface{}) (string, error) { - v := reflect.ValueOf(opt) - if v.Kind() == reflect.Ptr && v.IsNil() { - return s, nil - } - - u, err := url.Parse(s) - if err != nil { - return s, err - } - - qs, err := query.Values(opt) - if err != nil { - return s, err - } - - // If the url contained one or more query parameters (q) then we need - // to do some escaping on these values before Encode() is called. By - // doing so we're ensuring that : and + don't get encoded which means - // they'll be passed along to Gerrit as raw ascii. Without this Gerrit - // could return 400 Bad Request depending on the query parameters. For - // more complete information see this issue on GitHub: - // https://github.com/andygrunwald/go-gerrit/issues/18 - _, hasQuery := qs["q"] - if hasQuery { - values := []string{} - for _, value := range qs["q"] { - for key, replacement := range queryParameterReplacements { - value = strings.Replace(value, key, replacement, -1) - } - values = append(values, value) - } - - qs.Del("q") - for _, value := range values { - qs.Add("q", value) - } - } - encoded := qs.Encode() - - if hasQuery { - for key, replacement := range queryParameterReplacements { - encoded = strings.Replace(encoded, replacement, key, -1) - } - } - - u.RawQuery = encoded - return u.String(), nil -} - -// getStringResponseWithoutOptions retrieved a single string Response for a GET request -func getStringResponseWithoutOptions(client *Client, u string) (string, *Response, error) { - v := new(string) - resp, err := client.Call("GET", u, nil, v) - return *v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/gometalinter.json b/vendor/github.com/andygrunwald/go-gerrit/gometalinter.json deleted file mode 100644 index 67a7078a..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/gometalinter.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "DisableAll": true, - "Enable": [ - "deadcode", - "unconvert", - "golint", - "vetshadow", - "vet", - "gofmt", - "goimports", - "goconst", - "errcheck", - "interfacer", - "gosec", - "unconvert", - "testify", - "unparam", - "varcheck", - "gotype", - "ineffassign", - "staticcheck" - ] -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/groups.go b/vendor/github.com/andygrunwald/go-gerrit/groups.go deleted file mode 100644 index a83027b3..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/groups.go +++ /dev/null @@ -1,360 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// GroupsService contains Group related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html -type GroupsService struct { - client *Client -} - -// GroupAuditEventInfo entity contains information about an audit event of a group. -type GroupAuditEventInfo struct { - // TODO Member AccountInfo OR GroupInfo `json:"member"` - Type string `json:"type"` - User AccountInfo `json:"user"` - Date Timestamp `json:"date"` -} - -// GroupInfo entity contains information about a group. -// This can be a Gerrit internal group, or an external group that is known to Gerrit. -type GroupInfo struct { - ID string `json:"id"` - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Options GroupOptionsInfo `json:"options"` - Description string `json:"description,omitempty"` - GroupID int `json:"group_id,omitempty"` - Owner string `json:"owner,omitempty"` - OwnerID string `json:"owner_id,omitempty"` - CreatedOn *Timestamp `json:"created_on,omitempty"` - Members []AccountInfo `json:"members,omitempty"` - Includes []GroupInfo `json:"includes,omitempty"` -} - -// GroupInput entity contains information for the creation of a new internal group. -type GroupInput struct { - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - VisibleToAll bool `json:"visible_to_all,omitempty"` - OwnerID string `json:"owner_id,omitempty"` -} - -// GroupOptionsInfo entity contains options of the group. -type GroupOptionsInfo struct { - VisibleToAll bool `json:"visible_to_all,omitempty"` -} - -// GroupOptionsInput entity contains new options for a group. -type GroupOptionsInput struct { - VisibleToAll bool `json:"visible_to_all,omitempty"` -} - -// GroupsInput entity contains information about groups that should be included into a group or that should be deleted from a group. -type GroupsInput struct { - OneGroup string `json:"_one_group,omitempty"` - Groups []string `json:"groups,omitempty"` -} - -// ListGroupsOptions specifies the different options for the ListGroups call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#list-groups -type ListGroupsOptions struct { - // Group Options - // Options fields can be obtained by adding o parameters, each option requires more lookups and slows down the query response time to the client so they are generally disabled by default. - // Optional fields are: - // INCLUDES: include list of directly included groups. - // MEMBERS: include list of direct group members. - Options []string `url:"o,omitempty"` - - // Check if a group is owned by the calling user - // By setting the option owned and specifying a group to inspect with the option q, it is possible to find out, if this group is owned by the calling user. - // If the group is owned by the calling user, the returned map contains this group. If the calling user doesn’t own this group an empty map is returned. - Owned string `url:"owned,omitempty"` - Group string `url:"q,omitempty"` - - // Group Limit - // The /groups/ URL also accepts a limit integer in the n parameter. This limits the results to show n groups. - Limit int `url:"n,omitempty"` - // The /groups/ URL also accepts a start integer in the S parameter. The results will skip S groups from group list. - Skip int `url:"S,omitempty"` -} - -// ListGroups lists the groups accessible by the caller. -// This is the same as using the ls-groups command over SSH, and accepts the same options as query parameters. -// The entries in the map are sorted by group name. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#list-groups -func (s *GroupsService) ListGroups(opt *ListGroupsOptions) (*map[string]GroupInfo, *Response, error) { - u := "groups/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetGroup retrieves a group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group -func (s *GroupsService) GetGroup(groupID string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s", groupID) - return s.getGroupInfoResponse(u) -} - -// GetGroupDetail retrieves a group with the direct members and the directly included groups. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-detail -func (s *GroupsService) GetGroupDetail(groupID string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/detail", groupID) - return s.getGroupInfoResponse(u) -} - -// getGroupInfoResponse retrieved a single GroupInfo Response for a GET request -func (s *GroupsService) getGroupInfoResponse(u string) (*GroupInfo, *Response, error) { - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetGroupName retrieves the name of a group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-name -func (s *GroupsService) GetGroupName(groupID string) (string, *Response, error) { - u := fmt.Sprintf("groups/%s/name", groupID) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetGroupDescription retrieves the description of a group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-description -func (s *GroupsService) GetGroupDescription(groupID string) (string, *Response, error) { - u := fmt.Sprintf("groups/%s/description", groupID) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetGroupOptions retrieves the options of a group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-options -func (s *GroupsService) GetGroupOptions(groupID string) (*GroupOptionsInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/options", groupID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GroupOptionsInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetGroupOwner retrieves the owner group of a Gerrit internal group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-owner -func (s *GroupsService) GetGroupOwner(groupID string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/owner", groupID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetAuditLog gets the audit log of a Gerrit internal group. -// The returned audit events are sorted by date in reverse order so that the newest audit event comes first. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-audit-log -func (s *GroupsService) GetAuditLog(groupID string) (*[]GroupAuditEventInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/log.audit", groupID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]GroupAuditEventInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateGroup creates a new Gerrit internal group. -// In the request body additional data for the group can be provided as GroupInput. -// -// As response the GroupInfo entity is returned that describes the created group. -// If the group creation fails because the name is already in use the response is “409 Conflict”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#create-group -func (s *GroupsService) CreateGroup(groupID string, input *GroupInput) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s", groupID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RenameGroup renames a Gerrit internal group. -// The new group name must be provided in the request body. -// -// As response the new group name is returned. -// If renaming the group fails because the new name is already in use the response is “409 Conflict”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#rename-group -func (s *GroupsService) RenameGroup(groupID, name string) (*string, *Response, error) { - u := fmt.Sprintf("groups/%s/name", groupID) - input := struct { - Name string `json:"name"` - }{ - Name: name, - } - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetGroupDescription sets the description of a Gerrit internal group. -// The new group description must be provided in the request body. -// -// As response the new group description is returned. -// If the description was deleted the response is “204 No Content”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-description -func (s *GroupsService) SetGroupDescription(groupID, description string) (*string, *Response, error) { - u := fmt.Sprintf("groups/%s/description", groupID) - input := struct { - Description string `json:"description"` - }{ - Description: description, - } - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteGroupDescription deletes the description of a Gerrit internal group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-description -func (s *GroupsService) DeleteGroupDescription(groupID string) (*Response, error) { - u := fmt.Sprintf("groups/%s/description'", groupID) - return s.client.DeleteRequest(u, nil) -} - -// SetGroupOptions sets the options of a Gerrit internal group. -// The new group options must be provided in the request body as a GroupOptionsInput entity. -// -// As response the new group options are returned as a GroupOptionsInfo entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-options -func (s *GroupsService) SetGroupOptions(groupID string, input *GroupOptionsInput) (*GroupOptionsInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/options", groupID) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(GroupOptionsInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetGroupOwner sets the owner group of a Gerrit internal group. -// The new owner group must be provided in the request body. -// The new owner can be specified by name, by group UUID or by the legacy numeric group ID. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#set-group-owner -func (s *GroupsService) SetGroupOwner(groupID, owner string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/owner", groupID) - input := struct { - Owner string `json:"owner"` - }{ - Owner: owner, - } - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/groups_include.go b/vendor/github.com/andygrunwald/go-gerrit/groups_include.go deleted file mode 100644 index e8f4afc4..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/groups_include.go +++ /dev/null @@ -1,117 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// ListIncludedGroups lists the directly included groups of a group. -// The entries in the list are sorted by group name and UUID. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#included-groups -func (s *GroupsService) ListIncludedGroups(groupID string) (*[]GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/groups/", groupID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetIncludedGroup retrieves an included group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-included-group -func (s *GroupsService) GetIncludedGroup(groupID, includeGroupID string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/groups/%s", groupID, includeGroupID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// IncludeGroup includes an internal or external group into a Gerrit internal group. -// External groups must be specified using the UUID. -// -// As response a GroupInfo entity is returned that describes the included group. -// The request also succeeds if the group is already included in this group, but then the HTTP response code is 200 OK. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-group -func (s *GroupsService) IncludeGroup(groupID, includeGroupID string) (*GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/groups/%s", groupID, includeGroupID) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// IncludeGroups includes one or several groups into a Gerrit internal group. -// The groups to be included into the group must be provided in the request body as a GroupsInput entity. -// -// As response a list of GroupInfo entities is returned that describes the groups that were specified in the GroupsInput. -// A GroupInfo entity is returned for each group specified in the input, independently of whether the group was newly included into the group or whether the group was already included in the group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-groups -func (s *GroupsService) IncludeGroups(groupID string, input *GroupsInput) (*[]GroupInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/groups", groupID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new([]GroupInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteIncludedGroup deletes an included group from a Gerrit internal group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#include-group -func (s *GroupsService) DeleteIncludedGroup(groupID, includeGroupID string) (*Response, error) { - u := fmt.Sprintf("groups/%s/groups/%s", groupID, includeGroupID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteIncludedGroups delete one or several included groups from a Gerrit internal group. -// The groups to be deleted from the group must be provided in the request body as a GroupsInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-included-groups -func (s *GroupsService) DeleteIncludedGroups(groupID string, input *GroupsInput) (*Response, error) { - u := fmt.Sprintf("groups/%s/groups.delete", groupID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/groups_member.go b/vendor/github.com/andygrunwald/go-gerrit/groups_member.go deleted file mode 100644 index 45cdf381..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/groups_member.go +++ /dev/null @@ -1,133 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// ListGroupMembersOptions specifies the different options for the ListGroupMembers call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#group-members -type ListGroupMembersOptions struct { - // To resolve the included groups of a group recursively and to list all members the parameter recursive can be set. - // Members from included external groups and from included groups which are not visible to the calling user are ignored. - Recursive bool `url:"recursive,omitempty"` -} - -// MembersInput entity contains information about accounts that should be added as members to a group or that should be deleted from the group -type MembersInput struct { - OneMember string `json:"_one_member,omitempty"` - Members []string `json:"members,omitempty"` -} - -// ListGroupMembers lists the direct members of a Gerrit internal group. -// The entries in the list are sorted by full name, preferred email and id. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#group-members -func (s *GroupsService) ListGroupMembers(groupID string, opt *ListGroupMembersOptions) (*[]AccountInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/members/", groupID) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetGroupMember retrieves a group member. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#get-group-member -func (s *GroupsService) GetGroupMember(groupID, accountID string) (*AccountInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/members/%s", groupID, accountID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// AddGroupMember adds a user as member to a Gerrit internal group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#add-group-member -func (s *GroupsService) AddGroupMember(groupID, accountID string) (*AccountInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/members/%s", groupID, accountID) - - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// AddGroupMembers adds one or several users to a Gerrit internal group. -// The users to be added to the group must be provided in the request body as a MembersInput entity. -// -// As response a list of detailed AccountInfo entities is returned that describes the group members that were specified in the MembersInput. -// An AccountInfo entity is returned for each user specified in the input, independently of whether the user was newly added to the group or whether the user was already a member of the group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#_add_group_members -func (s *GroupsService) AddGroupMembers(groupID string, input *MembersInput) (*[]AccountInfo, *Response, error) { - u := fmt.Sprintf("groups/%s/members", groupID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, nil, err - } - - v := new([]AccountInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteGroupMember deletes a user from a Gerrit internal group. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-member -func (s *GroupsService) DeleteGroupMember(groupID, accountID string) (*Response, error) { - u := fmt.Sprintf("groups/%s/members/%s'", groupID, accountID) - return s.client.DeleteRequest(u, nil) -} - -// DeleteGroupMembers delete one or several users from a Gerrit internal group. -// The users to be deleted from the group must be provided in the request body as a MembersInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-groups.html#delete-group-members -func (s *GroupsService) DeleteGroupMembers(groupID string, input *MembersInput) (*Response, error) { - u := fmt.Sprintf("groups/%s/members.delete'", groupID) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, err - } - - return s.client.Do(req, nil) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/plugins.go b/vendor/github.com/andygrunwald/go-gerrit/plugins.go deleted file mode 100644 index c4460140..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/plugins.go +++ /dev/null @@ -1,131 +0,0 @@ -package gerrit - -import ( - "fmt" -) - -// PluginsService contains Plugin related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html -type PluginsService struct { - client *Client -} - -// PluginInfo entity describes a plugin. -type PluginInfo struct { - ID string `json:"id"` - Version string `json:"version"` - IndexURL string `json:"index_url,omitempty"` - Disabled bool `json:"disabled,omitempty"` -} - -// PluginInput entity describes a plugin that should be installed. -type PluginInput struct { - URL string `json:"url"` -} - -// PluginOptions specifies the different options for the ListPlugins call. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#list-plugins -type PluginOptions struct { - // All enabled that all plugins are returned (enabled and disabled). - All bool `url:"all,omitempty"` -} - -// ListPlugins lists the plugins installed on the Gerrit server. -// Only the enabled plugins are returned unless the all option is specified. -// -// To be allowed to see the installed plugins, a user must be a member of a group that is granted the 'View Plugins' capability or the 'Administrate Server' capability. -// The entries in the map are sorted by plugin ID. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#list-plugins -func (s *PluginsService) ListPlugins(opt *PluginOptions) (*map[string]PluginInfo, *Response, error) { - u := "plugins/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(map[string]PluginInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetPluginStatus retrieves the status of a plugin on the Gerrit server. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#get-plugin-status -func (s *PluginsService) GetPluginStatus(pluginID string) (*PluginInfo, *Response, error) { - u := fmt.Sprintf("plugins/%s/gerrit~status", pluginID) - return s.requestWithPluginInfoResponse("GET", u, nil) -} - -// InstallPlugin installs a new plugin on the Gerrit server. -// If a plugin with the specified name already exists it is overwritten. -// -// Note: if the plugin provides its own name in the MANIFEST file, then the plugin name from the MANIFEST file has precedence over the {plugin-id} above. -// -// The plugin jar can either be sent as binary data in the request body or a URL to the plugin jar must be provided in the request body inside a PluginInput entity. -// -// As response a PluginInfo entity is returned that describes the plugin. -// If an existing plugin was overwritten the response is “200 OK”. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-dashboard -func (s *PluginsService) InstallPlugin(pluginID string, input *PluginInput) (*PluginInfo, *Response, error) { - u := fmt.Sprintf("plugins/%s", pluginID) - return s.requestWithPluginInfoResponse("PUT", u, input) -} - -// EnablePlugin enables a plugin on the Gerrit server. -// -// As response a PluginInfo entity is returned that describes the plugin. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#enable-plugin -func (s *PluginsService) EnablePlugin(pluginID string) (*PluginInfo, *Response, error) { - u := fmt.Sprintf("plugins/%s/gerrit~enable", pluginID) - return s.requestWithPluginInfoResponse("POST", u, nil) -} - -// DisablePlugin disables a plugin on the Gerrit server. -// -// As response a PluginInfo entity is returned that describes the plugin. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#disable-plugin -func (s *PluginsService) DisablePlugin(pluginID string) (*PluginInfo, *Response, error) { - u := fmt.Sprintf("plugins/%s/gerrit~disable", pluginID) - return s.requestWithPluginInfoResponse("POST", u, nil) -} - -// ReloadPlugin reloads a plugin on the Gerrit server. -// -// As response a PluginInfo entity is returned that describes the plugin. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-plugins.html#disable-plugin -func (s *PluginsService) ReloadPlugin(pluginID string) (*PluginInfo, *Response, error) { - u := fmt.Sprintf("plugins/%s/gerrit~reload", pluginID) - return s.requestWithPluginInfoResponse("POST", u, nil) -} - -func (s *PluginsService) requestWithPluginInfoResponse(method, u string, input interface{}) (*PluginInfo, *Response, error) { - req, err := s.client.NewRequest(method, u, input) - if err != nil { - return nil, nil, err - } - - v := new(PluginInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects.go b/vendor/github.com/andygrunwald/go-gerrit/projects.go deleted file mode 100644 index 5695c6b9..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects.go +++ /dev/null @@ -1,465 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// ProjectsService contains Project related REST endpoints -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html -type ProjectsService struct { - client *Client -} - -// ProjectInfo entity contains information about a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#project-info -type ProjectInfo struct { - ID string `json:"id"` - Name string `json:"name"` - Parent string `json:"parent,omitempty"` - Description string `json:"description,omitempty"` - State string `json:"state,omitempty"` - Branches map[string]string `json:"branches,omitempty"` - WebLinks []WebLinkInfo `json:"web_links,omitempty"` -} - -// ProjectInput entity contains information for the creation of a new project. -type ProjectInput struct { - Name string `json:"name,omitempty"` - Parent string `json:"parent,omitempty"` - Description string `json:"description,omitempty"` - PermissionsOnly bool `json:"permissions_only"` - CreateEmptyCommit bool `json:"create_empty_commit"` - SubmitType string `json:"submit_type,omitempty"` - Branches []string `json:"branches,omitempty"` - Owners []string `json:"owners,omitempty"` - UseContributorAgreements string `json:"use_contributor_agreements"` - UseSignedOffBy string `json:"use_signed_off_by"` - CreateNewChangeForAllNotInTarget string `json:"create_new_change_for_all_not_in_target"` - UseContentMerge string `json:"use_content_merge"` - RequireChangeID string `json:"require_change_id"` - MaxObjectSizeLimit string `json:"max_object_size_limit,omitempty"` - PluginConfigValues map[string]map[string]string `json:"plugin_config_values,omitempty"` -} - -// GCInput entity contains information to run the Git garbage collection. -type GCInput struct { - ShowProgress bool `json:"show_progress"` - Aggressive bool `json:"aggressive"` -} - -// HeadInput entity contains information for setting HEAD for a project. -type HeadInput struct { - Ref string `json:"ref"` -} - -// BanInput entity contains information for banning commits in a project. -type BanInput struct { - Commits []string `json:"commits"` - Reason string `json:"reason,omitempty"` -} - -// BanResultInfo entity describes the result of banning commits. -type BanResultInfo struct { - NewlyBanned []string `json:"newly_banned,omitempty"` - AlreadyBanned []string `json:"already_banned,omitempty"` - Ignored []string `json:"ignored,omitempty"` -} - -// ThemeInfo entity describes a theme. -type ThemeInfo struct { - CSS string `type:"css,omitempty"` - Header string `type:"header,omitempty"` - Footer string `type:"footer,omitempty"` -} - -// ReflogEntryInfo entity describes an entry in a reflog. -type ReflogEntryInfo struct { - OldID string `json:"old_id"` - NewID string `json:"new_id"` - Who GitPersonInfo `json:"who"` - Comment string `json:"comment"` -} - -// ProjectParentInput entity contains information for setting a project parent. -type ProjectParentInput struct { - Parent string `json:"parent"` - CommitMessage string `json:"commit_message,omitempty"` -} - -// RepositoryStatisticsInfo entity contains information about statistics of a Git repository. -type RepositoryStatisticsInfo struct { - NumberOfLooseObjects int `json:"number_of_loose_objects"` - NumberOfLooseRefs int `json:"number_of_loose_refs"` - NumberOfPackFiles int `json:"number_of_pack_files"` - NumberOfPackedObjects int `json:"number_of_packed_objects"` - NumberOfPackedRefs int `json:"number_of_packed_refs"` - SizeOfLooseObjects int `json:"size_of_loose_objects"` - SizeOfPackedObjects int `json:"size_of_packed_objects"` -} - -// InheritedBooleanInfo entity represents a boolean value that can also be inherited. -type InheritedBooleanInfo struct { - Value bool `json:"value"` - ConfiguredValue string `json:"configured_value"` - InheritedValue bool `json:"inherited_value,omitempty"` -} - -// MaxObjectSizeLimitInfo entity contains information about the max object size limit of a project. -type MaxObjectSizeLimitInfo struct { - Value string `json:"value,omitempty"` - ConfiguredValue string `json:"configured_value,omitempty"` - InheritedValue string `json:"inherited_value,omitempty"` -} - -// ConfigParameterInfo entity describes a project configuration parameter. -type ConfigParameterInfo struct { - DisplayName string `json:"display_name,omitempty"` - Description string `json:"description,omitempty"` - Warning string `json:"warning,omitempty"` - Type string `json:"type"` - Value string `json:"value,omitempty"` - Values []string `json:"values,omitempty"` - // TODO: 5 fields are missing here, because the documentation seems to be fucked up - // See https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#config-parameter-info -} - -// ProjectDescriptionInput entity contains information for setting a project description. -type ProjectDescriptionInput struct { - Description string `json:"description,omitempty"` - CommitMessage string `json:"commit_message,omitempty"` -} - -// ConfigInfo entity contains information about the effective project configuration. -type ConfigInfo struct { - Description string `json:"description,omitempty"` - UseContributorAgreements InheritedBooleanInfo `json:"use_contributor_agreements,omitempty"` - UseContentMerge InheritedBooleanInfo `json:"use_content_merge,omitempty"` - UseSignedOffBy InheritedBooleanInfo `json:"use_signed_off_by,omitempty"` - CreateNewChangeForAllNotInTarget InheritedBooleanInfo `json:"create_new_change_for_all_not_in_target,omitempty"` - RequireChangeID InheritedBooleanInfo `json:"require_change_id,omitempty"` - EnableSignedPush InheritedBooleanInfo `json:"enable_signed_push,omitempty"` - MaxObjectSizeLimit MaxObjectSizeLimitInfo `json:"max_object_size_limit"` - SubmitType string `json:"submit_type"` - State string `json:"state,omitempty"` - Commentlinks map[string]string `json:"commentlinks"` - Theme ThemeInfo `json:"theme,omitempty"` - PluginConfig map[string]ConfigParameterInfo `json:"plugin_config,omitempty"` - Actions map[string]ActionInfo `json:"actions,omitempty"` -} - -// ConfigInput entity describes a new project configuration. -type ConfigInput struct { - Description string `json:"description,omitempty"` - UseContributorAgreements string `json:"use_contributor_agreements,omitempty"` - UseContentMerge string `json:"use_content_merge,omitempty"` - UseSignedOffBy string `json:"use_signed_off_by,omitempty"` - CreateNewChangeForAllNotInTarget string `json:"create_new_change_for_all_not_in_target,omitempty"` - RequireChangeID string `json:"require_change_id,omitempty"` - MaxObjectSizeLimit MaxObjectSizeLimitInfo `json:"max_object_size_limit,omitempty"` - SubmitType string `json:"submit_type,omitempty"` - State string `json:"state,omitempty"` - PluginConfigValues map[string]map[string]string `json:"plugin_config_values,omitempty"` -} - -// ProjectBaseOptions specifies the really basic options for projects -// and sub functionality (e.g. Tags) -type ProjectBaseOptions struct { - // Limit the number of projects to be included in the results. - Limit int `url:"n,omitempty"` - - // Skip the given number of branches from the beginning of the list. - Skip string `url:"s,omitempty"` -} - -// ProjectOptions specifies the parameters to the ProjectsService.ListProjects. -type ProjectOptions struct { - ProjectBaseOptions - - // Limit the results to the projects having the specified branch and include the sha1 of the branch in the results. - Branch string `url:"b,omitempty"` - - // Include project description in the results. - Description bool `url:"d,omitempty"` - - // Limit the results to those projects that start with the specified prefix. - Prefix string `url:"p,omitempty"` - - // Limit the results to those projects that match the specified regex. - // Boundary matchers '^' and '$' are implicit. - // For example: the regex 'test.*' will match any projects that start with 'test' and regex '.*test' will match any project that end with 'test'. - Regex string `url:"r,omitempty"` - - // Skip the given number of projects from the beginning of the list. - Skip string `url:"S,omitempty"` - - // Limit the results to those projects that match the specified substring. - Substring string `url:"m,omitempty"` - - // Get projects inheritance in a tree-like format. - // This option does not work together with the branch option. - Tree bool `url:"t,omitempty"` - - // Get projects with specified type: ALL, CODE, PERMISSIONS. - Type string `url:"type,omitempty"` -} - -// ListProjects lists the projects accessible by the caller. -// This is the same as using the ls-projects command over SSH, and accepts the same options as query parameters. -// The entries in the map are sorted by project name. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-projects -func (s *ProjectsService) ListProjects(opt *ProjectOptions) (*map[string]ProjectInfo, *Response, error) { - u := "projects/" - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - v := new(map[string]ProjectInfo) - resp, err := s.client.Call("GET", u, nil, v) - return v, resp, err -} - -// GetProject retrieves a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project -func (s *ProjectsService) GetProject(projectName string) (*ProjectInfo, *Response, error) { - u := fmt.Sprintf("projects/%s", url.QueryEscape(projectName)) - - v := new(ProjectInfo) - resp, err := s.client.Call("GET", u, nil, v) - return v, resp, err -} - -// CreateProject creates a new project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#create-project -func (s *ProjectsService) CreateProject(projectName string, input *ProjectInput) (*ProjectInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/", url.QueryEscape(projectName)) - - v := new(ProjectInfo) - resp, err := s.client.Call("PUT", u, input, v) - return v, resp, err -} - -// GetProjectDescription retrieves the description of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project-description -func (s *ProjectsService) GetProjectDescription(projectName string) (string, *Response, error) { - u := fmt.Sprintf("projects/%s/description", url.QueryEscape(projectName)) - - return getStringResponseWithoutOptions(s.client, u) -} - -// GetProjectParent retrieves the name of a project’s parent project. -// For the All-Projects root project an empty string is returned. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-project-parent -func (s *ProjectsService) GetProjectParent(projectName string) (string, *Response, error) { - u := fmt.Sprintf("projects/%s/parent", url.QueryEscape(projectName)) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetHEAD retrieves for a project the name of the branch to which HEAD points. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-head -func (s *ProjectsService) GetHEAD(projectName string) (string, *Response, error) { - u := fmt.Sprintf("projects/%s/HEAD", url.QueryEscape(projectName)) - return getStringResponseWithoutOptions(s.client, u) -} - -// GetRepositoryStatistics return statistics for the repository of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-repository-statistics -func (s *ProjectsService) GetRepositoryStatistics(projectName string) (*RepositoryStatisticsInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/statistics.git", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(RepositoryStatisticsInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetConfig gets some configuration information about a project. -// Note that this config info is not simply the contents of project.config; -// it generally contains fields that may have been inherited from parent projects. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-config -func (s *ProjectsService) GetConfig(projectName string) (*ConfigInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/config'", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(ConfigInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetProjectDescription sets the description of a project. -// The new project description must be provided in the request body inside a ProjectDescriptionInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-project-description -func (s *ProjectsService) SetProjectDescription(projectName string, input *ProjectDescriptionInput) (*string, *Response, error) { - u := fmt.Sprintf("projects/%s/description'", url.QueryEscape(projectName)) - - // TODO Use here the getStringResponseWithoutOptions (for PUT requests) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteProjectDescription deletes the description of a project. -// The request body does not need to include a ProjectDescriptionInput entity if no commit message is specified. -// -// Please note that some proxies prohibit request bodies for DELETE requests. -// In this case, if you want to specify a commit message, use PUT to delete the description. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-project-description -func (s *ProjectsService) DeleteProjectDescription(projectName string) (*Response, error) { - u := fmt.Sprintf("projects/%s/description'", url.QueryEscape(projectName)) - return s.client.DeleteRequest(u, nil) -} - -// BanCommit marks commits as banned for the project. -// If a commit is banned Gerrit rejects every push that includes this commit with contains banned commit ... -// -// Note: -// This REST endpoint only marks the commits as banned, but it does not remove the commits from the history of any central branch. -// This needs to be done manually. -// The commits to be banned must be specified in the request body as a BanInput entity. -// -// The caller must be project owner. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#ban-commit -func (s *ProjectsService) BanCommit(projectName string, input *BanInput) (*BanResultInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/ban'", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(BanResultInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetConfig sets the configuration of a project. -// The new configuration must be provided in the request body as a ConfigInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-config -func (s *ProjectsService) SetConfig(projectName string, input *ConfigInput) (*ConfigInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/config'", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(ConfigInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetHEAD sets HEAD for a project. -// The new ref to which HEAD should point must be provided in the request body inside a HeadInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-head -func (s *ProjectsService) SetHEAD(projectName string, input *HeadInput) (*string, *Response, error) { - u := fmt.Sprintf("projects/%s/HEAD'", url.QueryEscape(projectName)) - - // TODO Use here the getStringResponseWithoutOptions (for PUT requests) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetProjectParent sets the parent project for a project. -// The new name of the parent project must be provided in the request body inside a ProjectParentInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-project-parent -func (s *ProjectsService) SetProjectParent(projectName string, input *ProjectParentInput) (*string, *Response, error) { - u := fmt.Sprintf("projects/%s/parent'", url.QueryEscape(projectName)) - - // TODO Use here the getStringResponseWithoutOptions (for PUT requests) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(string) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// RunGC runs the Git garbage collection for the repository of a project. -// The response is the streamed output of the garbage collection. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#run-gc -func (s *ProjectsService) RunGC(projectName string, input *GCInput) (*Response, error) { - u := fmt.Sprintf("projects/%s/gc'", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("POST", u, input) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(req, nil) - if err != nil { - return resp, err - } - - return resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects_branch.go b/vendor/github.com/andygrunwald/go-gerrit/projects_branch.go deleted file mode 100644 index 285f20fc..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects_branch.go +++ /dev/null @@ -1,157 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// BranchInfo entity contains information about a branch. -type BranchInfo struct { - Ref string `json:"ref"` - Revision string `json:"revision"` - CanDelete bool `json:"can_delete"` - WebLinks []WebLinkInfo `json:"web_links,omitempty"` -} - -// BranchInput entity contains information for the creation of a new branch. -type BranchInput struct { - Ref string `json:"ref,omitempty"` - Revision string `json:"revision,omitempty"` -} - -// DeleteBranchesInput entity contains information about branches that should be deleted. -type DeleteBranchesInput struct { - Branches []string `json:"DeleteBranchesInput"` -} - -// BranchOptions specifies the parameters to the branch API endpoints. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#branch-options -type BranchOptions struct { - // Limit the number of branches to be included in the results. - Limit int `url:"n,omitempty"` - - // Skip the given number of branches from the beginning of the list. - Skip string `url:"s,omitempty"` - - // Substring limits the results to those projects that match the specified substring. - Substring string `url:"m,omitempty"` - - // Limit the results to those branches that match the specified regex. - // Boundary matchers '^' and '$' are implicit. - // For example: the regex 't*' will match any branches that start with 'test' and regex '*t' will match any branches that end with 'test'. - Regex string `url:"r,omitempty"` -} - -// ListBranches list the branches of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-branches -func (s *ProjectsService) ListBranches(projectName string, opt *BranchOptions) (*[]BranchInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/branches/", url.QueryEscape(projectName)) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]BranchInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetBranch retrieves a branch of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-branch -func (s *ProjectsService) GetBranch(projectName, branchID string) (*BranchInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/branches/%s", url.QueryEscape(projectName), url.QueryEscape(branchID)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(BranchInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetReflog gets the reflog of a certain branch. -// The caller must be project owner. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-reflog -func (s *ProjectsService) GetReflog(projectName, branchID string) (*[]ReflogEntryInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/branches/%s/reflog", url.QueryEscape(projectName), url.QueryEscape(branchID)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ReflogEntryInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// CreateBranch creates a new branch. -// In the request body additional data for the branch can be provided as BranchInput. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#create-branch -func (s *ProjectsService) CreateBranch(projectName, branchID string, input *BranchInput) (*BranchInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/branches/%s", url.QueryEscape(projectName), url.QueryEscape(branchID)) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(BranchInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteBranch deletes a branch. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-branch -func (s *ProjectsService) DeleteBranch(projectName, branchID string) (*Response, error) { - u := fmt.Sprintf("projects/%s/branches/%s", url.QueryEscape(projectName), url.QueryEscape(branchID)) - return s.client.DeleteRequest(u, nil) -} - -// DeleteBranches delete one or more branches. -// If some branches could not be deleted, the response is “409 Conflict” and the error message is contained in the response body. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-branches -func (s *ProjectsService) DeleteBranches(projectName string, input *DeleteBranchesInput) (*Response, error) { - u := fmt.Sprintf("projects/%s/branches:delete", url.QueryEscape(projectName)) - return s.client.DeleteRequest(u, input) -} - -// GetBranchContent gets the content of a file from the HEAD revision of a certain branch. -// The content is returned as base64 encoded string. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-content -func (s *ProjectsService) GetBranchContent(projectName, branchID, fileID string) (string, *Response, error) { - u := fmt.Sprintf("projects/%s/branches/%s/files/%s/content", url.QueryEscape(projectName), url.QueryEscape(branchID), fileID) - return getStringResponseWithoutOptions(s.client, u) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects_childproject.go b/vendor/github.com/andygrunwald/go-gerrit/projects_childproject.go deleted file mode 100644 index ef0e100b..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects_childproject.go +++ /dev/null @@ -1,66 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// ChildProjectOptions specifies the parameters to the Child Project API endpoints. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-child-projects -type ChildProjectOptions struct { - // Recursive resolve the child projects of a project recursively. - // Child projects that are not visible to the calling user are ignored and are not resolved further. - Recursive int `url:"recursive,omitempty"` -} - -// ListChildProjects lists the direct child projects of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-child-projects -func (s *ProjectsService) ListChildProjects(projectName string, opt *ChildProjectOptions) (*[]ProjectInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/children/", url.QueryEscape(projectName)) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]ProjectInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetChildProject retrieves a child project. -// If a non-direct child project should be retrieved the parameter recursive must be set. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-child-project -func (s *ProjectsService) GetChildProject(projectName, childProjectName string, opt *ChildProjectOptions) (*ProjectInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/children/%s", url.QueryEscape(projectName), url.QueryEscape(childProjectName)) - - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(ProjectInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects_commit.go b/vendor/github.com/andygrunwald/go-gerrit/projects_commit.go deleted file mode 100644 index d4bb9425..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects_commit.go +++ /dev/null @@ -1,36 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// GetCommit retrieves a commit of a project. -// The commit must be visible to the caller. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-commit -func (s *ProjectsService) GetCommit(projectName, commitID string) (*CommitInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/commits/%s", url.QueryEscape(projectName), commitID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(CommitInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetCommitContent gets the content of a file from a certain commit. -// The content is returned as base64 encoded string. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html##get-content-from-commit -func (s *ProjectsService) GetCommitContent(projectName, commitID, fileID string) (string, *Response, error) { - u := fmt.Sprintf("projects/%s/commits/%s/files/%s/content", url.QueryEscape(projectName), commitID, fileID) - return getStringResponseWithoutOptions(s.client, u) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects_dashboard.go b/vendor/github.com/andygrunwald/go-gerrit/projects_dashboard.go deleted file mode 100644 index 07c38b58..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects_dashboard.go +++ /dev/null @@ -1,108 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// DashboardSectionInfo entity contains information about a section in a dashboard. -type DashboardSectionInfo struct { - Name string `json:"name"` - Query string `json:"query"` -} - -// DashboardInput entity contains information to create/update a project dashboard. -type DashboardInput struct { - ID string `json:"id,omitempty"` - CommitMessage string `json:"commit_message,omitempty"` -} - -// DashboardInfo entity contains information about a project dashboard. -type DashboardInfo struct { - ID string `json:"id"` - Project string `json:"project"` - DefiningProject string `json:"defining_project"` - Ref string `json:"ref"` - Path string `json:"path"` - Description string `json:"description,omitempty"` - Foreach string `json:"foreach,omitempty"` - URL string `json:"url"` - Default bool `json:"default"` - Title string `json:"title,omitempty"` - Sections []DashboardSectionInfo `json:"sections"` -} - -// ListDashboards list custom dashboards for a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-dashboards -func (s *ProjectsService) ListDashboards(projectName string) (*[]DashboardInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/dashboards/", url.QueryEscape(projectName)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]DashboardInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetDashboard list custom dashboards for a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-dashboard -func (s *ProjectsService) GetDashboard(projectName, dashboardName string) (*DashboardInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/dashboards/%s", url.QueryEscape(projectName), url.QueryEscape(dashboardName)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(DashboardInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// SetDashboard updates/Creates a project dashboard. -// Currently only supported for the default dashboard. -// -// The creation/update information for the dashboard must be provided in the request body as a DashboardInput entity. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#set-dashboard -func (s *ProjectsService) SetDashboard(projectName, dashboardID string, input *DashboardInput) (*DashboardInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/dashboards/%s", url.QueryEscape(projectName), url.QueryEscape(dashboardID)) - - req, err := s.client.NewRequest("PUT", u, input) - if err != nil { - return nil, nil, err - } - - v := new(DashboardInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// DeleteDashboard deletes a project dashboard. -// Currently only supported for the default dashboard. -// -// The request body does not need to include a DashboardInput entity if no commit message is specified. -// Please note that some proxies prohibit request bodies for DELETE requests. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#delete-dashboard -func (s *ProjectsService) DeleteDashboard(projectName, dashboardID string, input *DashboardInput) (*Response, error) { - u := fmt.Sprintf("projects/%s/dashboards/%s", url.QueryEscape(projectName), url.QueryEscape(dashboardID)) - return s.client.DeleteRequest(u, input) -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/projects_tag.go b/vendor/github.com/andygrunwald/go-gerrit/projects_tag.go deleted file mode 100644 index 7070d3f7..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/projects_tag.go +++ /dev/null @@ -1,60 +0,0 @@ -package gerrit - -import ( - "fmt" - "net/url" -) - -// TagInfo entity contains information about a tag. -type TagInfo struct { - Ref string `json:"ref"` - Revision string `json:"revision"` - Object string `json:"object"` - Message string `json:"message"` - Tagger GitPersonInfo `json:"tagger"` - Created *Timestamp `json:"created,omitempty"` -} - -// ListTags list the tags of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-tags -func (s *ProjectsService) ListTags(projectName string, opt *ProjectBaseOptions) (*[]TagInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/tags/", url.QueryEscape(projectName)) - u, err := addOptions(u, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new([]TagInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} - -// GetTag retrieves a tag of a project. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-tag -func (s *ProjectsService) GetTag(projectName, tagName string) (*TagInfo, *Response, error) { - u := fmt.Sprintf("projects/%s/tags/%s", url.QueryEscape(projectName), url.QueryEscape(tagName)) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - v := new(TagInfo) - resp, err := s.client.Do(req, v) - if err != nil { - return nil, resp, err - } - - return v, resp, err -} diff --git a/vendor/github.com/andygrunwald/go-gerrit/types.go b/vendor/github.com/andygrunwald/go-gerrit/types.go deleted file mode 100644 index baf8ee4a..00000000 --- a/vendor/github.com/andygrunwald/go-gerrit/types.go +++ /dev/null @@ -1,88 +0,0 @@ -package gerrit - -import ( - "encoding/json" - "errors" - "strconv" - "time" -) - -// Timestamp represents an instant in time with nanosecond precision, in UTC time zone. -// It encodes to and from JSON in Gerrit's timestamp format. -// All exported methods of time.Time can be called on Timestamp. -// -// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api.html#timestamp -type Timestamp struct { - // Time is an instant in time. Its time zone must be UTC. - time.Time -} - -// MarshalJSON implements the json.Marshaler interface. -// The time is a quoted string in Gerrit's timestamp format. -// An error is returned if t.Time time zone is not UTC. -func (t Timestamp) MarshalJSON() ([]byte, error) { - if t.Location() != time.UTC { - return nil, errors.New("Timestamp.MarshalJSON: time zone must be UTC") - } - if y := t.Year(); y < 0 || 9999 < y { - // RFC 3339 is clear that years are 4 digits exactly. - // See golang.org/issue/4556#issuecomment-66073163 for more discussion. - return nil, errors.New("Timestamp.MarshalJSON: year outside of range [0,9999]") - } - b := make([]byte, 0, len(timeLayout)+2) - b = append(b, '"') - b = t.AppendFormat(b, timeLayout) - b = append(b, '"') - return b, nil -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -// The time is expected to be a quoted string in Gerrit's timestamp format. -func (t *Timestamp) UnmarshalJSON(b []byte) error { - // Ignore null, like in the main JSON package. - if string(b) == "null" { - return nil - } - var err error - t.Time, err = time.Parse(`"`+timeLayout+`"`, string(b)) - return err -} - -// Gerrit's timestamp layout is like time.RFC3339Nano, but with a space instead -// of the "T", without a timezone (it's always in UTC), and always includes nanoseconds. -// See https://gerrit-review.googlesource.com/Documentation/rest-api.html#timestamp. -const timeLayout = "2006-01-02 15:04:05.000000000" - -// Number is a string representing a number. This type is only used in cases -// where the API being queried may return an inconsistent result. -type Number string - -// String returns the string representing the current number. -func (n *Number) String() string { - return string(*n) -} - -// Int returns the current number as an integer -func (n *Number) Int() (int, error) { - return strconv.Atoi(n.String()) -} - -// UnmarshalJSON will marshal the provided data into the current *Number struct. -func (n *Number) UnmarshalJSON(data []byte) error { - // `data` is a number represented as a string (ex. "5"). - var stringNumber string - if err := json.Unmarshal(data, &stringNumber); err == nil { - *n = Number(stringNumber) - return nil - } - - // `data` is a number represented as an integer (ex. 5). Here - // we're using json.Unmarshal to convert bytes -> number which - // we then convert to our own Number type. - var number int - if err := json.Unmarshal(data, &number); err == nil { - *n = Number(strconv.Itoa(number)) - return nil - } - return errors.New("cannot convert data to number") -} diff --git a/vendor/github.com/briandowns/openweathermap/.gitignore b/vendor/github.com/briandowns/openweathermap/.gitignore deleted file mode 100644 index 0b1d88a8..00000000 --- a/vendor/github.com/briandowns/openweathermap/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# Created by .gitignore support plugin (hsz.mobi) -### Go template -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -.vscode -.idea -*.iml - -coverage.* diff --git a/vendor/github.com/briandowns/openweathermap/.travis.yml b/vendor/github.com/briandowns/openweathermap/.travis.yml deleted file mode 100644 index 28614c4e..00000000 --- a/vendor/github.com/briandowns/openweathermap/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: go -go: - - 1.5.4 - - 1.6.2 -env: - - GOARCH: amd64 - - GOARCH: 386 -addons: - hosts: - - api.openweathermap.org -before_install: - - sudo apt-get -qq update - - sudo apt-get install -y socat - - cat /etc/hosts - - wget http://ipinfo.io/ip -qO - - - sudo socat TCP-LISTEN:80,fork TCP:${RTCP_HOST}:${RTCP_PORT} > /tmp/socat.log 2>&1 & - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover -script: - - make test - - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN -notifications: - email: - recipients: - - brian.downs@gmail.com - on_success: change - on_failure: always - after_success: - - coveralls diff --git a/vendor/github.com/briandowns/openweathermap/CONTRIBUTING.md b/vendor/github.com/briandowns/openweathermap/CONTRIBUTING.md deleted file mode 100644 index f6d0aa74..00000000 --- a/vendor/github.com/briandowns/openweathermap/CONTRIBUTING.md +++ /dev/null @@ -1,14 +0,0 @@ -# Contributing to openweathermap - -## Issues - -### Reporting an Issue - -* Please add an issue [here](https://github.com/briandowns/openweathermap/issues) and utilize the appropriate label. - -## Fixing Problems and/or Adding Features - -* Feel free to fork and fix an issue(s) or add a feature. -* Please provide tests for the submitted code. -* Run `go fmt` and `go vet` -* Once the pull request is submitted, it'll be tested and merged. diff --git a/vendor/github.com/briandowns/openweathermap/LICENSE b/vendor/github.com/briandowns/openweathermap/LICENSE deleted file mode 100644 index dd5b3a58..00000000 --- a/vendor/github.com/briandowns/openweathermap/LICENSE +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/briandowns/openweathermap/Makefile b/vendor/github.com/briandowns/openweathermap/Makefile deleted file mode 100644 index b390203b..00000000 --- a/vendor/github.com/briandowns/openweathermap/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -GOCMD = go -GOBUILD = $(GOCMD) build -GOGET = $(GOCMD) get -v -GOCLEAN = $(GOCMD) clean -GOINSTALL = $(GOCMD) install -GOTEST = $(GOCMD) test - -.PHONY: all - -all: test - -test: - $(GOTEST) -v -covermode=count -coverprofile=coverage.out ./... - -build: test - $(GOBUILD) - -install: test - $(GOINSTALL) diff --git a/vendor/github.com/briandowns/openweathermap/README.md b/vendor/github.com/briandowns/openweathermap/README.md deleted file mode 100644 index cfe1db19..00000000 --- a/vendor/github.com/briandowns/openweathermap/README.md +++ /dev/null @@ -1,279 +0,0 @@ -# OpenWeatherMap Go API - -[![GoDoc](https://godoc.org/github.com/briandowns/openweathermap?status.svg)](https://godoc.org/github.com/briandowns/openweathermap) [![Build Status](https://travis-ci.org/briandowns/openweathermap.svg?branch=master)](https://travis-ci.org/briandowns/openweathermap) [![Coverage Status](https://coveralls.io/repos/github/briandowns/openweathermap/badge.svg?branch=master)](https://coveralls.io/github/briandowns/openweathermap?branch=master) - -Go (golang) package for use with openweathermap.org's API. - -For more detail about the library and its features, reference your local godoc once installed. - -[Website](https://briandowns.github.io/openweathermap)! - -To use the OpenweatherMap API, you need to obtain an API key. Sign up [here](http://home.openweathermap.org/users/sign_up). Once you have your key, create an environment variable called `OWM_API_KEY`. Start coding! - -[Slack Channel](https://openweathermapgolang.slack.com/messages/general) - -Contributions welcome! - -## Features - -### Current Weather Conditions - -- By City -- By City,St (State) -- By City,Co (Country) -- By City ID -- By Zip,Co (Country) -- By Longitude and Latitude - -## Forecast - -Get the weather conditions for a given number of days. - -- By City -- By City,St (State) -- By City,Co (Country) -- By City ID -- By Longitude and Latitude - -### Access to Condition Codes and Icons - -Gain access to OpenWeatherMap icons and condition codes. - -- Thunderstorms -- Drizzle -- Rain -- Snow -- Atmosphere -- Clouds -- Extreme -- Additional - -### Data Available in Multiple Measurement Systems - -- Fahrenheit (OpenWeatherMap API - imperial) -- Celsius (OpenWeatherMap API - metric) -- Kelvin (OpenWeatherMap API - internal) - -### UV Index Data - -- Current -- Historical - -### Pollution Data - -- Current - -## Historical Conditions - -- By Name -- By ID -- By Coordinates - -## Supported Languages - -English - en, Russian - ru, Italian - it, Spanish - es (or sp), Ukrainian - uk (or ua), German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - sv (or se), Chinese Traditional - zh_tw, Chinese Simplified - zh (or zh_cn), Turkish - tr, Croatian - hr, Catalan - ca - -## Installation - -```bash -go get github.com/briandowns/openweathermap -``` - -## Examples - -There are a few full examples in the examples directory that can be referenced. 1 is a command line application and 1 is a simple web application. - -```Go -package main - -import ( - "log" - "fmt" - "os" - - // Shortening the import reference name seems to make it a bit easier - owm "github.com/briandowns/openweathermap" -) - -var apiKey = os.Getenv("OWM_API_KEY") - -func main() { - w, err := owm.NewCurrent("F", "ru", apiKey) // fahrenheit (imperial) with Russian output - if err != nil { - log.Fatalln(err) - } - - w.CurrentByName("Phoenix") - fmt.Println(w) -} - -``` - -### Current Conditions by location name - -```Go -func main() { - w, err := owm.NewCurrent("K", "EN", apiKey) // (internal - OpenWeatherMap reference for kelvin) with English output - if err != nil { - log.Fatalln(err) - } - - w.CurrentByName("Phoenix,AZ") - fmt.Println(w) -} -``` - -### Forecast Conditions in imperial (fahrenheit) by coordinates - -```Go -func main() { - w, err := owm.NewForecast("5", "F", "FI", apiKey) // valid options for first parameter are "5" and "16" - if err != nil { - log.Fatalln(err) - } - - w.DailyByCoordinates( - &owm.Coordinates{ - Longitude: -112.07, - Latitude: 33.45, - }, - 5 // five days forecast - ) - fmt.Println(w) -} -``` - -### Current conditions in metric (celsius) by location ID - -```Go -func main() { - w, err := owm.NewCurrent("C", "PL", apiKey) - if err != nil { - log.Fatalln(err) - } - - w.CurrentByID(2172797) - fmt.Println(w) -} -``` - -### Current conditions by zip code. 2 character country code required - -```Go -func main() { - w, err := owm.NewCurrent("F", "EN", apiKey) - if err != nil { - log.Fatalln(err) - } - - w.CurrentByZip(19125, "US") - fmt.Println(w) -} -``` - -### Configure http client - -```Go -func main() { - client := &http.Client{} - w, err := owm.NewCurrent("F", "EN", apiKey, owm.WithHttpClient(client)) - if err != nil { - log.Fatalln(err) - } -} -``` - -### Current UV conditions - -```Go -func main() { - uv, err := owm.NewUV(apiKey) - if err != nil { - log.Fatalln(err) - } - - coord := &owm.Coordinates{ - Longitude: 53.343497, - Latitude: -6.288379, - } - - if err := uv.Current(coord); err != nil { - log.Fatalln(err) - } - - fmt.Println(coord) -} -``` - -### Historical UV conditions - -```Go -func main() { - uv, err := owm.NewUV(apiKey) - if err != nil { - log.Fatalln(err) - } - - coord := &owm.Coordinates{ - Longitude: 54.995656, - Latitude: -7.326834, - } - - end := time.Now().UTC() - start := time.Now().UTC().Add(-time.Hour * time.Duration(24)) - - if err := uv.Historical(coord, start, end); err != nil { - log.Fatalln(err) - } -} -``` - -### UV Information - -```Go -func main() { - uv, err := owm.NewUV(apiKey) - if err != nil { - log.Fatalln(err) - } - - coord := &owm.Coordinates{ - Longitude: 53.343497, - Latitude: -6.288379, - } - - if err := uv.Current(coord); err != nil { - log.Fatalln(err) - } - - info, err := uv.UVInformation() - if err != nil { - log.Fatalln(err) - } - - fmt.Println(info) -} -``` - -### Pollution Information - -```Go -func main() { - pollution, err := owm.NewPollution(apiKey) - if err != nil { - log.Fatalln(err) - } - - params := &owm.PollutionParameters{ - Location: owm.Coordinates{ - Latitude: 0.0, - Longitude: 10.0, - }, - Datetime: "current", - } - - if err := pollution.PollutionByParams(params); err != nil { - log.Fatalln(err) - } -} -``` diff --git a/vendor/github.com/briandowns/openweathermap/conditions.go b/vendor/github.com/briandowns/openweathermap/conditions.go deleted file mode 100644 index e73ececc..00000000 --- a/vendor/github.com/briandowns/openweathermap/conditions.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "fmt" - "io" - "net/http" - "os" -) - -// IconData holds the relevant info for linking icons to conditions. -type IconData struct { - Condition string - Day string - Night string -} - -// ConditionData holds data structure for weather conditions information. -type ConditionData struct { - ID int - Meaning string - Icon1 string - Icon2 string -} - -// RetrieveIcon will get the specified icon from the API. -func RetrieveIcon(destination, iconFile string) (int64, error) { - fullFilePath := fmt.Sprintf("%s/%s", destination, iconFile) - - // Check to see if we've already gotten that icon file. If so, use it - // rather than getting it again. - if _, err := os.Stat(fullFilePath); err != nil { - response, err := http.Get(fmt.Sprintf(iconURL, iconFile)) - if err != nil { - return 0, err - } - defer response.Body.Close() - - // Create the icon file - out, err := os.Create(fullFilePath) - if err != nil { - return 0, err - } - defer out.Close() - - // Fill the empty file with the actual content - n, err := io.Copy(out, response.Body) - if err != nil { - return 0, err - } - return n, nil - } - return 0, nil -} - -// IconList is a slice of IconData pointers -var IconList = []*IconData{ - {Condition: "clear sky", Day: "01d.png", Night: "01n.png"}, - {Condition: "few clouds", Day: "02d.png", Night: "02n.png"}, - {Condition: "scattered clouds", Day: "03d.png", Night: "03n.png"}, - {Condition: "broken clouds", Day: "04d.png", Night: "04n.png"}, - {Condition: "shower rain", Day: "09d.png", Night: "09n.png"}, - {Condition: "rain", Day: "10d.png", Night: "10n.png"}, - {Condition: "thunderstorm", Day: "11d.png", Night: "11n.png"}, - {Condition: "snow", Day: "13d.png", Night: "13n.png"}, - {Condition: "mist", Day: "50d.png", Night: "50n.png"}, -} - -// ThunderstormConditions is a slice of ConditionData pointers -var ThunderstormConditions = []*ConditionData{ - {ID: 200, Meaning: "thunderstorm with light rain", Icon1: "11d.png"}, - {ID: 201, Meaning: "thunderstorm with rain", Icon1: "11d.png"}, - {ID: 202, Meaning: "thunderstorm with heavy rain", Icon1: "11d.png"}, - {ID: 210, Meaning: "light thunderstorm", Icon1: "11d.png"}, - {ID: 211, Meaning: "thunderstorm", Icon1: "11d.png"}, - {ID: 212, Meaning: "heavy thunderstorm", Icon1: "11d.png"}, - {ID: 221, Meaning: "ragged thunderstorm", Icon1: "11d.png"}, - {ID: 230, Meaning: "thunderstorm with light drizzle", Icon1: "11d.png"}, - {ID: 231, Meaning: "thunderstorm with drizzle", Icon1: "11d.png"}, - {ID: 232, Meaning: "thunderstorm with heavy drizzle", Icon1: "11d.png"}, -} - -// DrizzleConditions is a slice of ConditionData pointers -var DrizzleConditions = []*ConditionData{ - {ID: 300, Meaning: "light intensity drizzle", Icon1: "09d.png"}, - {ID: 301, Meaning: "drizzle", Icon1: "09d.png"}, - {ID: 302, Meaning: "heavy intensity drizzle", Icon1: "09d.png"}, - {ID: 310, Meaning: "light intensity drizzle rain", Icon1: "09d.png"}, - {ID: 311, Meaning: "drizzle rain", Icon1: "09d.png"}, - {ID: 312, Meaning: "heavy intensity drizzle rain", Icon1: "09d.png"}, - {ID: 313, Meaning: "shower rain and drizzle", Icon1: "09d.png"}, - {ID: 314, Meaning: "heavy shower rain and drizzle", Icon1: "09d.png"}, - {ID: 321, Meaning: "shower drizzle", Icon1: "09d.png"}, -} - -// RainConditions is a slice of ConditionData pointers -var RainConditions = []*ConditionData{ - {ID: 500, Meaning: "light rain", Icon1: "09d.png"}, - {ID: 501, Meaning: "moderate rain", Icon1: "09d.png"}, - {ID: 502, Meaning: "heavy intensity rain", Icon1: "09d.png"}, - {ID: 503, Meaning: "very heavy rain", Icon1: "09d.png"}, - {ID: 504, Meaning: "extreme rain", Icon1: "09d.png"}, - {ID: 511, Meaning: "freezing rain", Icon1: "13d.png"}, - {ID: 520, Meaning: "light intensity shower rain", Icon1: "09d.png"}, - {ID: 521, Meaning: "shower rain", Icon1: "09d.png"}, - {ID: 522, Meaning: "heavy intensity shower rain", Icon1: "09d.png"}, - {ID: 531, Meaning: "ragged shower rain", Icon1: "09d.png"}, -} - -// SnowConditions is a slice of ConditionData pointers -var SnowConditions = []*ConditionData{ - {ID: 600, Meaning: "light snow", Icon1: "13d.png"}, - {ID: 601, Meaning: "snow", Icon1: "13d.png"}, - {ID: 602, Meaning: "heavy snow", Icon1: "13d.png"}, - {ID: 611, Meaning: "sleet", Icon1: "13d.png"}, - {ID: 612, Meaning: "shower sleet", Icon1: "13d.png"}, - {ID: 615, Meaning: "light rain and snow", Icon1: "13d.png"}, - {ID: 616, Meaning: "rain and snow", Icon1: "13d.png"}, - {ID: 620, Meaning: "light shower snow", Icon1: "13d.png"}, - {ID: 621, Meaning: "shower snow", Icon1: "13d.png"}, - {ID: 622, Meaning: "heavy shower snow", Icon1: "13d.png"}, -} - -// AtmosphereConditions is a slice of ConditionData pointers -var AtmosphereConditions = []*ConditionData{ - {ID: 701, Meaning: "mist", Icon1: "50d.png"}, - {ID: 711, Meaning: "smoke", Icon1: "50d.png"}, - {ID: 721, Meaning: "haze", Icon1: "50d.png"}, - {ID: 731, Meaning: "sand, dust whirls", Icon1: "50d.png"}, - {ID: 741, Meaning: "fog", Icon1: "50d.png"}, - {ID: 751, Meaning: "sand", Icon1: "50d.png"}, - {ID: 761, Meaning: "dust", Icon1: "50d.png"}, - {ID: 762, Meaning: "volcanic ash", Icon1: "50d.png"}, - {ID: 771, Meaning: "squalls", Icon1: "50d.png"}, - {ID: 781, Meaning: "tornado", Icon1: "50d.png"}, -} - -// CloudConditions is a slice of ConditionData pointers -var CloudConditions = []*ConditionData{ - {ID: 800, Meaning: "clear sky", Icon1: "01d.png", Icon2: "01n.png"}, - {ID: 801, Meaning: "few clouds", Icon1: "02d.png", Icon2: " 02n.png"}, - {ID: 802, Meaning: "scattered clouds", Icon1: "03d.png", Icon2: "03d.png"}, - {ID: 803, Meaning: "broken clouds", Icon1: "04d.png", Icon2: "03d.png"}, - {ID: 804, Meaning: "overcast clouds", Icon1: "04d.png", Icon2: "04d.png"}, -} - -// ExtremeConditions is a slice of ConditionData pointers -var ExtremeConditions = []*ConditionData{ - {ID: 900, Meaning: "tornado", Icon1: ""}, - {ID: 901, Meaning: "tropical storm", Icon1: ""}, - {ID: 902, Meaning: "hurricane", Icon1: ""}, - {ID: 903, Meaning: "cold", Icon1: ""}, - {ID: 904, Meaning: "hot", Icon1: ""}, - {ID: 905, Meaning: "windy", Icon1: ""}, - {ID: 906, Meaning: "hail", Icon1: ""}, -} - -// AdditionalConditions is a slive of ConditionData pointers -var AdditionalConditions = []*ConditionData{ - {ID: 951, Meaning: "calm", Icon1: ""}, - {ID: 952, Meaning: "light breeze", Icon1: ""}, - {ID: 953, Meaning: "gentle breeze", Icon1: ""}, - {ID: 954, Meaning: "moderate breeze", Icon1: ""}, - {ID: 955, Meaning: "fresh breeze", Icon1: ""}, - {ID: 956, Meaning: "strong breeze", Icon1: ""}, - {ID: 957, Meaning: "high wind, near gale", Icon1: ""}, - {ID: 958, Meaning: "gale", Icon1: ""}, - {ID: 959, Meaning: "severe gale", Icon1: ""}, - {ID: 960, Meaning: "storm", Icon1: ""}, - {ID: 961, Meaning: "violent storm", Icon1: ""}, - {ID: 962, Meaning: "hurricane", Icon1: ""}, -} diff --git a/vendor/github.com/briandowns/openweathermap/current.go b/vendor/github.com/briandowns/openweathermap/current.go deleted file mode 100644 index 52941b71..00000000 --- a/vendor/github.com/briandowns/openweathermap/current.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" -) - -// CurrentWeatherData struct contains an aggregate view of the structs -// defined above for JSON to be unmarshaled into. -type CurrentWeatherData struct { - GeoPos Coordinates `json:"coord"` - Sys Sys `json:"sys"` - Base string `json:"base"` - Weather []Weather `json:"weather"` - Main Main `json:"main"` - Wind Wind `json:"wind"` - Clouds Clouds `json:"clouds"` - Rain Rain `json:"rain"` - Snow Snow `json:"snow"` - Dt int `json:"dt"` - ID int `json:"id"` - Name string `json:"name"` - Cod int `json:"cod"` - Unit string - Lang string - Key string - *Settings -} - -// NewCurrent returns a new CurrentWeatherData pointer with the supplied parameters -func NewCurrent(unit, lang, key string, options ...Option) (*CurrentWeatherData, error) { - unitChoice := strings.ToUpper(unit) - langChoice := strings.ToUpper(lang) - - c := &CurrentWeatherData{ - Settings: NewSettings(), - } - - if ValidDataUnit(unitChoice) { - c.Unit = DataUnits[unitChoice] - } else { - return nil, errUnitUnavailable - } - - if ValidLangCode(langChoice) { - c.Lang = langChoice - } else { - return nil, errLangUnavailable - } - var err error - c.Key, err = setKey(key) - if err != nil { - return nil, err - } - - if err := setOptions(c.Settings, options); err != nil { - return nil, err - } - return c, nil -} - -// CurrentByName will provide the current weather with the provided -// location name. -func (w *CurrentWeatherData) CurrentByName(location string) error { - response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(baseURL, "appid=%s&q=%s&units=%s&lang=%s"), w.Key, url.QueryEscape(location), w.Unit, w.Lang)) - if err != nil { - return err - } - defer response.Body.Close() - - if err := json.NewDecoder(response.Body).Decode(&w); err != nil { - return err - } - - return nil -} - -// CurrentByCoordinates will provide the current weather with the -// provided location coordinates. -func (w *CurrentWeatherData) CurrentByCoordinates(location *Coordinates) error { - response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(baseURL, "appid=%s&lat=%f&lon=%f&units=%s&lang=%s"), w.Key, location.Latitude, location.Longitude, w.Unit, w.Lang)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&w); err != nil { - return err - } - - return nil -} - -// CurrentByID will provide the current weather with the -// provided location ID. -func (w *CurrentWeatherData) CurrentByID(id int) error { - response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(baseURL, "appid=%s&id=%d&units=%s&lang=%s"), w.Key, id, w.Unit, w.Lang)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&w); err != nil { - return err - } - - return nil -} - -// CurrentByZip will provide the current weather for the -// provided zip code. -func (w *CurrentWeatherData) CurrentByZip(zip int, countryCode string) error { - response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(baseURL, "appid=%s&zip=%d,%s&units=%s&lang=%s"), w.Key, zip, countryCode, w.Unit, w.Lang)) - if err != nil { - return err - } - defer response.Body.Close() - if err = json.NewDecoder(response.Body).Decode(&w); err != nil { - return err - } - - return nil -} - -// CurrentByArea will provide the current weather for the -// provided area. -func (w *CurrentWeatherData) CurrentByArea() {} diff --git a/vendor/github.com/briandowns/openweathermap/doc.go b/vendor/github.com/briandowns/openweathermap/doc.go deleted file mode 100644 index 39a41ffb..00000000 --- a/vendor/github.com/briandowns/openweathermap/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package openweathermap is a library for use to access the -// http://openweathermap.org API. JSON is the only return format supported -// at this time. -package openweathermap diff --git a/vendor/github.com/briandowns/openweathermap/forecast.go b/vendor/github.com/briandowns/openweathermap/forecast.go deleted file mode 100644 index ebba0273..00000000 --- a/vendor/github.com/briandowns/openweathermap/forecast.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "fmt" - "io" - "net/url" - "strconv" - "strings" -) - -// ForecastSys area population -type ForecastSys struct { - Population int `json:"population"` -} - -// Temperature holds returned termperate sure stats -type Temperature struct { - Day float64 `json:"day"` - Min float64 `json:"min"` - Max float64 `json:"max"` - Night float64 `json:"night"` - Eve float64 `json:"eve"` - Morn float64 `json:"morn"` -} - -// City data for given location -type City struct { - ID int `json:"id"` - Name string `json:"name"` - Coord Coordinates `json:"coord"` - Country string `json:"country"` - Population int `json:"population"` - Sys ForecastSys `json:"sys"` -} - -type ForecastWeather interface { - DailyByName(location string, days int) error - DailyByCoordinates(location *Coordinates, days int) error - DailyByID(id, days int) error -} - -// json served by OWM API can take different forms, so all of them must be matched -// by corresponding data type and unmarshall method -type ForecastWeatherJson interface { - Decode(r io.Reader) error -} - -type ForecastWeatherData struct { - Unit string - Lang string - Key string - baseURL string - *Settings - ForecastWeatherJson -} - -// NewForecast returns a new HistoricalWeatherData pointer with -// the supplied arguments. -func NewForecast(forecastType, unit, lang, key string, options ...Option) (*ForecastWeatherData, error) { - unitChoice := strings.ToUpper(unit) - langChoice := strings.ToUpper(lang) - - if forecastType != "16" && forecastType != "5" { - return nil, errForecastUnavailable - } - - if !ValidDataUnit(unitChoice) { - return nil, errUnitUnavailable - } - - if !ValidLangCode(langChoice) { - return nil, errLangUnavailable - } - - settings := NewSettings() - if err := setOptions(settings, options); err != nil { - return nil, err - } - - var err error - k, err := setKey(key) - if err != nil { - return nil, err - } - forecastData := ForecastWeatherData{ - Unit: DataUnits[unitChoice], - Lang: langChoice, - Key: k, - Settings: settings, - } - - if forecastType == "16" { - forecastData.baseURL = forecast16Base - forecastData.ForecastWeatherJson = &Forecast16WeatherData{} - } else { - forecastData.baseURL = forecast5Base - forecastData.ForecastWeatherJson = &Forecast5WeatherData{} - } - - return &forecastData, nil -} - -// DailyByName will provide a forecast for the location given for the -// number of days given. -func (f *ForecastWeatherData) DailyByName(location string, days int) error { - response, err := f.client.Get(fmt.Sprintf(f.baseURL, f.Key, fmt.Sprintf("%s=%s", "q", url.QueryEscape(location)), f.Unit, f.Lang, days)) - if err != nil { - return err - } - defer response.Body.Close() - - return f.ForecastWeatherJson.Decode(response.Body) -} - -// DailyByCoordinates will provide a forecast for the coordinates ID give -// for the number of days given. -func (f *ForecastWeatherData) DailyByCoordinates(location *Coordinates, days int) error { - response, err := f.client.Get(fmt.Sprintf(f.baseURL, f.Key, fmt.Sprintf("lat=%f&lon=%f", location.Latitude, location.Longitude), f.Unit, f.Lang, days)) - if err != nil { - return err - } - defer response.Body.Close() - - return f.ForecastWeatherJson.Decode(response.Body) -} - -// DailyByID will provide a forecast for the location ID give for the -// number of days given. -func (f *ForecastWeatherData) DailyByID(id, days int) error { - response, err := f.client.Get(fmt.Sprintf(f.baseURL, f.Key, fmt.Sprintf("%s=%s", "id", strconv.Itoa(id)), f.Unit, f.Lang, days)) - if err != nil { - return err - } - defer response.Body.Close() - - return f.ForecastWeatherJson.Decode(response.Body) -} diff --git a/vendor/github.com/briandowns/openweathermap/forecast16.go b/vendor/github.com/briandowns/openweathermap/forecast16.go deleted file mode 100644 index 3ba9f513..00000000 --- a/vendor/github.com/briandowns/openweathermap/forecast16.go +++ /dev/null @@ -1,36 +0,0 @@ -package openweathermap - -import ( - "encoding/json" - "io" -) - -// Forecast16WeatherList holds specific query data -type Forecast16WeatherList struct { - Dt int `json:"dt"` - Temp Temperature `json:"temp"` - Pressure float64 `json:"pressure"` - Humidity int `json:"humidity"` - Weather []Weather `json:"weather"` - Speed float64 `json:"speed"` - Deg int `json:"deg"` - Clouds int `json:"clouds"` - Snow float64 `json:"snow"` - Rain float64 `json:"rain"` -} - -// Forecast16WeatherData will hold returned data from queries -type Forecast16WeatherData struct { - COD int `json:"cod"` - Message string `json:"message"` - City City `json:"city"` - Cnt int `json:"cnt"` - List []Forecast16WeatherList `json:"list"` -} - -func (f *Forecast16WeatherData) Decode(r io.Reader) error { - if err := json.NewDecoder(r).Decode(&f); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/briandowns/openweathermap/forecast5.go b/vendor/github.com/briandowns/openweathermap/forecast5.go deleted file mode 100644 index 9e52c20a..00000000 --- a/vendor/github.com/briandowns/openweathermap/forecast5.go +++ /dev/null @@ -1,50 +0,0 @@ -package openweathermap - -import ( - "encoding/json" - "io" - "strings" - "time" -) - -type DtTxt struct { - time.Time -} - -func (dt *DtTxt) UnmarshalJSON(b []byte) error { - t, err := time.Parse("2006-01-02 15:04:05", strings.Trim(string(b), "\"")) - dt.Time = t - return err -} - -func (t *DtTxt) MarshalJSON() ([]byte, error) { - return json.Marshal(t) -} - -// Forecast5WeatherList holds specific query data -type Forecast5WeatherList struct { - Dt int `json:"dt"` - Main Main `json:"main"` - Weather []Weather `json:"weather"` - Clouds Clouds `json:"clouds"` - Wind Wind `json:"wind"` - Rain Rain `json:"rain"` - Snow Snow `json:"snow"` - DtTxt DtTxt `json:"dt_txt"` -} - -// Forecast5WeatherData will hold returned data from queries -type Forecast5WeatherData struct { - // COD string `json:"cod"` - // Message float64 `json:"message"` - City City `json:"city"` - Cnt int `json:"cnt"` - List []Forecast5WeatherList `json:"list"` -} - -func (f *Forecast5WeatherData) Decode(r io.Reader) error { - if err := json.NewDecoder(r).Decode(&f); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/briandowns/openweathermap/history.go b/vendor/github.com/briandowns/openweathermap/history.go deleted file mode 100644 index bba6c83d..00000000 --- a/vendor/github.com/briandowns/openweathermap/history.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "encoding/json" - "fmt" - "net/url" - "strings" -) - -// HistoricalParameters struct holds the (optional) fields to be -// supplied for historical data requests. -type HistoricalParameters struct { - Start int64 // Data start (unix time, UTC time zone) - End int64 // Data end (unix time, UTC time zone) - Cnt int // Amount of returned data (one per hour, can be used instead of Data end) -} - -// Rain struct contains 3 hour data -type Rain struct { - ThreeH float64 `json:"3h"` -} - -// Snow struct contains 3 hour data -type Snow struct { - ThreeH float64 `json:"3h"` -} - -// WeatherHistory struct contains aggregate fields from the above -// structs. -type WeatherHistory struct { - Main Main `json:"main"` - Wind Wind `json:"wind"` - Clouds Clouds `json:"clouds"` - Weather []Weather `json:"weather"` - Rain Rain `json:"rain"` - Dt int `json:"dt"` -} - -// HistoricalWeatherData struct is where the JSON is unmarshaled to -// when receiving data for a historical request. -type HistoricalWeatherData struct { - Message string `json:"message"` - Cod int `json:"cod"` - CityData int `json:"city_data"` - CalcTime float64 `json:"calctime"` - Cnt int `json:"cnt"` - List []WeatherHistory `json:"list"` - Unit string - Key string - *Settings -} - -// NewHistorical returns a new HistoricalWeatherData pointer with -//the supplied arguments. -func NewHistorical(unit, key string, options ...Option) (*HistoricalWeatherData, error) { - h := &HistoricalWeatherData{ - Settings: NewSettings(), - } - - unitChoice := strings.ToUpper(unit) - if !ValidDataUnit(unitChoice) { - return nil, errUnitUnavailable - } - h.Unit = DataUnits[unitChoice] - - var err error - h.Key, err = setKey(key) - if err != nil { - return nil, err - } - - if err := setOptions(h.Settings, options); err != nil { - return nil, err - } - return h, nil -} - -// HistoryByName will return the history for the provided location -func (h *HistoricalWeatherData) HistoryByName(location string) error { - response, err := h.client.Get(fmt.Sprintf(fmt.Sprintf(historyURL, "city?appid=%s&q=%s"), h.Key, url.QueryEscape(location))) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&h); err != nil { - return err - } - - return nil -} - -// HistoryByID will return the history for the provided location ID -func (h *HistoricalWeatherData) HistoryByID(id int, hp ...*HistoricalParameters) error { - if len(hp) > 0 { - response, err := h.client.Get(fmt.Sprintf(fmt.Sprintf(historyURL, "city?appid=%s&id=%d&type=hour&start%d&end=%d&cnt=%d"), h.Key, id, hp[0].Start, hp[0].End, hp[0].Cnt)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&h); err != nil { - return err - } - } - - response, err := h.client.Get(fmt.Sprintf(fmt.Sprintf(historyURL, "city?appid=%s&id=%d"), h.Key, id)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&h); err != nil { - return err - } - - return nil -} - -// HistoryByCoord will return the history for the provided coordinates -func (h *HistoricalWeatherData) HistoryByCoord(location *Coordinates, hp *HistoricalParameters) error { - response, err := h.client.Get(fmt.Sprintf(fmt.Sprintf(historyURL, "appid=%s&lat=%f&lon=%f&start=%d&end=%d"), h.Key, location.Latitude, location.Longitude, hp.Start, hp.End)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&h); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/briandowns/openweathermap/openweathermap.go b/vendor/github.com/briandowns/openweathermap/openweathermap.go deleted file mode 100644 index b256c27d..00000000 --- a/vendor/github.com/briandowns/openweathermap/openweathermap.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "errors" - "net/http" -) - -var errUnitUnavailable = errors.New("unit unavailable") -var errLangUnavailable = errors.New("language unavailable") -var errInvalidKey = errors.New("invalid api key") -var errInvalidOption = errors.New("invalid option") -var errInvalidHttpClient = errors.New("invalid http client") -var errForecastUnavailable = errors.New("forecast unavailable") - -// DataUnits represents the character chosen to represent the temperature notation -var DataUnits = map[string]string{"C": "metric", "F": "imperial", "K": "internal"} -var ( - baseURL = "http://api.openweathermap.org/data/2.5/weather?%s" - iconURL = "http://openweathermap.org/img/w/%s" - stationURL = "http://api.openweathermap.org/data/2.5/station?id=%d" - forecast5Base = "http://api.openweathermap.org/data/2.5/forecast?appid=%s&%s&mode=json&units=%s&lang=%s&cnt=%d" - forecast16Base = "http://api.openweathermap.org/data/2.5/forecast/daily?appid=%s&%s&mode=json&units=%s&lang=%s&cnt=%d" - historyURL = "http://api.openweathermap.org/data/2.5/history/%s" - pollutionURL = "http://api.openweathermap.org/pollution/v1/co/" - uvURL = "http://api.openweathermap.org/data/2.5/" - dataPostURL = "http://openweathermap.org/data/post" -) - -// LangCodes holds all supported languages to be used -// inspried and sourced from @bambocher (github.com/bambocher) -var LangCodes = map[string]string{ - "EN": "English", - "RU": "Russian", - "IT": "Italian", - "ES": "Spanish", - "SP": "Spanish", - "UK": "Ukrainian", - "UA": "Ukrainian", - "DE": "German", - "PT": "Portuguese", - "RO": "Romanian", - "PL": "Polish", - "FI": "Finnish", - "NL": "Dutch", - "FR": "French", - "BG": "Bulgarian", - "SV": "Swedish", - "SE": "Swedish", - "TR": "Turkish", - "HR": "Croatian", - "CA": "Catalan", - "ZH_TW": "Chinese Traditional", - "ZH": "Chinese Simplified", - "ZH_CN": "Chinese Simplified", -} - -// Config will hold default settings to be passed into the -// "NewCurrent, NewForecast, etc}" functions. -type Config struct { - Mode string // user choice of JSON or XML - Unit string // measurement for results to be displayed. F, C, or K - Lang string // should reference a key in the LangCodes map - APIKey string // API Key for connecting to the OWM - Username string // Username for posting data - Password string // Pasword for posting data -} - -// APIError returned on failed API calls. -type APIError struct { - Message string `json:"message"` - COD string `json:"cod"` -} - -// Coordinates struct holds longitude and latitude data in returned -// JSON or as parameter data for requests using longitude and latitude. -type Coordinates struct { - Longitude float64 `json:"lon"` - Latitude float64 `json:"lat"` -} - -// Sys struct contains general information about the request -// and the surrounding area for where the request was made. -type Sys struct { - Type int `json:"type"` - ID int `json:"id"` - Message float64 `json:"message"` - Country string `json:"country"` - Sunrise int `json:"sunrise"` - Sunset int `json:"sunset"` -} - -// Wind struct contains the speed and degree of the wind. -type Wind struct { - Speed float64 `json:"speed"` - Deg float64 `json:"deg"` -} - -// Weather struct holds high-level, basic info on the returned -// data. -type Weather struct { - ID int `json:"id"` - Main string `json:"main"` - Description string `json:"description"` - Icon string `json:"icon"` -} - -// Main struct contains the temperates, humidity, pressure for the request. -type Main struct { - Temp float64 `json:"temp"` - TempMin float64 `json:"temp_min"` - TempMax float64 `json:"temp_max"` - Pressure float64 `json:"pressure"` - SeaLevel float64 `json:"sea_level"` - GrndLevel float64 `json:"grnd_level"` - Humidity int `json:"humidity"` -} - -// Clouds struct holds data regarding cloud cover. -type Clouds struct { - All int `json:"all"` -} - -// return key -// } -func setKey(key string) (string, error) { - if err := ValidAPIKey(key); err != nil { - return "", err - } - return key, nil -} - -// ValidDataUnit makes sure the string passed in is an accepted -// unit of measure to be used for the return data. -func ValidDataUnit(u string) bool { - for d := range DataUnits { - if u == d { - return true - } - } - return false -} - -// ValidLangCode makes sure the string passed in is an -// acceptable lang code. -func ValidLangCode(c string) bool { - for d := range LangCodes { - if c == d { - return true - } - } - return false -} - -// ValidDataUnitSymbol makes sure the string passed in is an -// acceptable data unit symbol. -func ValidDataUnitSymbol(u string) bool { - for _, d := range DataUnits { - if u == d { - return true - } - } - return false -} - -// ValidAPIKey makes sure that the key given is a valid one -func ValidAPIKey(key string) error { - if len(key) != 32 { - return errors.New("invalid key") - } - return nil -} - -// CheckAPIKeyExists will see if an API key has been set. -func (c *Config) CheckAPIKeyExists() bool { return len(c.APIKey) > 1 } - -// Settings holds the client settings -type Settings struct { - client *http.Client -} - -// NewSettings returns a new Setting pointer with default http client. -func NewSettings() *Settings { - return &Settings{ - client: http.DefaultClient, - } -} - -// Optional client settings -type Option func(s *Settings) error - -// WithHttpClient sets custom http client when creating a new Client. -func WithHttpClient(c *http.Client) Option { - return func(s *Settings) error { - if c == nil { - return errInvalidHttpClient - } - s.client = c - return nil - } -} - -// setOptions sets Optional client settings to the Settings pointer -func setOptions(settings *Settings, options []Option) error { - for _, option := range options { - if option == nil { - return errInvalidOption - } - err := option(settings) - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/briandowns/openweathermap/pollution.go b/vendor/github.com/briandowns/openweathermap/pollution.go deleted file mode 100644 index abb5b2dd..00000000 --- a/vendor/github.com/briandowns/openweathermap/pollution.go +++ /dev/null @@ -1,82 +0,0 @@ -package openweathermap - -import ( - "encoding/json" - "fmt" - "strconv" -) - -// DateTimeAliases holds the alias the pollution API supports in lieu -// of an ISO 8601 timestamp -var DateTimeAliases = []string{"current"} - -// ValidAlias checks to make sure the given alias is a valid one -func ValidAlias(alias string) bool { - for _, i := range DateTimeAliases { - if i == alias { - return true - } - } - return false -} - -// PollutionData holds the pollution specific data from the call -type PollutionData struct { - Precision float64 `json:"precision"` - Pressure float64 `json:"pressure"` - Value float64 `json:"value"` -} - -// PollutionParameters holds the parameters needed to make -// a call to the pollution API -type PollutionParameters struct { - Location Coordinates - Datetime string // this should be either ISO 8601 or an alias -} - -// Pollution holds the data returnd from the pollution API -type Pollution struct { - Time string `json:"time"` - Location Coordinates `json:"location"` - Data []PollutionData `json:"data"` - Key string - *Settings -} - -// NewPollution creates a new reference to Pollution -func NewPollution(key string, options ...Option) (*Pollution, error) { - k, err := setKey(key) - if err != nil { - return nil, err - } - p := &Pollution{ - Key: k, - Settings: NewSettings(), - } - - if err := setOptions(p.Settings, options); err != nil { - return nil, err - } - return p, nil -} - -// PollutionByParams gets the pollution data based on the given parameters -func (p *Pollution) PollutionByParams(params *PollutionParameters) error { - url := fmt.Sprintf("%s%s,%s/%s.json?appid=%s", - pollutionURL, - strconv.FormatFloat(params.Location.Latitude, 'f', -1, 64), - strconv.FormatFloat(params.Location.Longitude, 'f', -1, 64), - params.Datetime, - p.Key) - response, err := p.client.Get(url) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&p); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/briandowns/openweathermap/station.go b/vendor/github.com/briandowns/openweathermap/station.go deleted file mode 100644 index 731cf08e..00000000 --- a/vendor/github.com/briandowns/openweathermap/station.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package openweathermap - -import ( - "fmt" - "net/http" - "net/url" -) - -// Slice of type string of the valid parameters to be sent from a station. -// The API refers to this data as the "Weather station data transmission protocol" -var StationDataParameters = []string{ - "wind_dir", // Wind direction - "wind_speed", // Wind speed - "wind_gust", // Wind gust speed - "temp", // Temperature - "humidity", // Relative humidty - "pressure", // Atmospheric pressure - "rain_1h", // Rain in the last hour - "rain_24h", // Rain in the last 24 hours - "rain_today", // Rain since midnight - "snow", // Snow in the last 24 hours - "lum", // Brightness - "lat", // Latitude - "long", // Longitude - "alt", // Altitude - "radiation", // Radiation - "dewpoint", // Dew point - "uv", // UV index - "name", // Weather station name -} - -// ValidateStationDataParameter will make sure that whatever parameter -// supplied is one that can actually be used in the POST request. -func ValidateStationDataParameter(param string) bool { - for _, p := range StationDataParameters { - if param == p { - return true - } - } - - return false -} - -// ConvertToURLValues will convert a map to a url.Values instance. We're -// taking a map[string]string instead of something more type specific since -// the url.Values instance only takes strings to create the URL values. -func ConvertToURLValues(data map[string]string) string { - v := url.Values{} - - for key, val := range data { - v.Set(key, val) - } - - return v.Encode() -} - -// SendStationData will send an instance the provided url.Values to the -// provided URL. -func SendStationData(data url.Values) { - resp, err := http.PostForm(dataPostURL, data) - if err != nil { - fmt.Println(err) - } - - fmt.Println(resp.Body) -} diff --git a/vendor/github.com/briandowns/openweathermap/uv.go b/vendor/github.com/briandowns/openweathermap/uv.go deleted file mode 100644 index 2b10b9d1..00000000 --- a/vendor/github.com/briandowns/openweathermap/uv.go +++ /dev/null @@ -1,170 +0,0 @@ -package openweathermap - -import ( - "encoding/json" - "errors" - "fmt" - "time" -) - -var errInvalidUVIndex = errors.New("invalid UV index value") - -// UVDataPoints holds the UV specific data -type UVDataPoints struct { - DT int64 `json:"dt"` - Value float64 `json:"value"` -} - -// UV contains the response from the OWM UV API -type UV struct { - Coord []float64 `json:"coord"` - Data []UVDataPoints `json:"data,omitempty"` - /*Data []struct { - DT int64 `json:"dt"` - Value float64 `json:"value"` - } `json:"data,omitempty"`*/ - DT int64 `json:"dt,omitempty"` - Value float64 `json:"value,omitempty"` - Key string - *Settings -} - -// NewUV creates a new reference to UV -func NewUV(key string, options ...Option) (*UV, error) { - k, err := setKey(key) - if err != nil { - return nil, err - } - u := &UV{ - Key: k, - Settings: NewSettings(), - } - - if err := setOptions(u.Settings, options); err != nil { - return nil, err - } - return u, nil -} - -// Current gets the current UV data for the given coordinates -func (u *UV) Current(coord *Coordinates) error { - response, err := u.client.Get(fmt.Sprintf("%suvi?lat=%f&lon=%f&appid=%s", uvURL, coord.Latitude, coord.Longitude, u.Key)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&u); err != nil { - return err - } - - return nil -} - -// Historical gets the historical UV data for the coordinates and times -func (u *UV) Historical(coord *Coordinates, start, end time.Time) error { - response, err := u.client.Get(fmt.Sprintf("%shistory?lat=%f&lon=%f&start=%d&end=%d&appid=%s", uvURL, coord.Latitude, coord.Longitude, start.Unix(), end.Unix(), u.Key)) - if err != nil { - return err - } - defer response.Body.Close() - - if err = json.NewDecoder(response.Body).Decode(&u); err != nil { - return err - } - - return nil -} - -// UVIndexInfo -type UVIndexInfo struct { - // UVIndex holds the range of the index - UVIndex []float64 - - // MGC represents the Media graphic color - MGC string - - // Risk of harm from unprotected sun exposure, for the average adult - Risk string - - // RecommendedProtection contains information on what a person should - // do when outside in the associated UVIndex - RecommendedProtection string -} - -// UVData contains data in regards to UV index ranges, rankings, and steps for protection -var UVData = []UVIndexInfo{ - { - UVIndex: []float64{0, 2.9}, - MGC: "Green", - Risk: "Low", - RecommendedProtection: "Wear sunglasses on bright days; use sunscreen if there is snow on the ground, which reflects UV radiation, or if you have particularly fair skin.", - }, - { - UVIndex: []float64{3, 5.9}, - MGC: "Yellow", - Risk: "Moderate", - RecommendedProtection: "Take precautions, such as covering up, if you will be outside. Stay in shade near midday when the sun is strongest.", - }, - { - UVIndex: []float64{6, 7.9}, - MGC: "Orange", - Risk: "High", - RecommendedProtection: "Cover the body with sun protective clothing, use SPF 30+ sunscreen, wear a hat, reduce time in the sun within three hours of solar noon, and wear sunglasses.", - }, - { - UVIndex: []float64{8, 10.9}, - MGC: "Red", - Risk: "Very high", - RecommendedProtection: "Wear SPF 30+ sunscreen, a shirt, sunglasses, and a wide-brimmed hat. Do not stay in the sun for too long.", - }, - { - UVIndex: []float64{11}, - MGC: "Violet", - Risk: "Extreme", - RecommendedProtection: "Take all precautions: Wear SPF 30+ sunscreen, a long-sleeved shirt and trousers, sunglasses, and a very broad hat. Avoid the sun within three hours of solar noon.", - }, -} - -// UVInformation provides information on the given UV data which includes the severity -// and "Recommended protection" -func (u *UV) UVInformation() ([]UVIndexInfo, error) { - switch { - case u.Value != 0: - switch { - case u.Value < 2.9: - return []UVIndexInfo{UVData[0]}, nil - case u.Value > 3 && u.Value < 5.9: - return []UVIndexInfo{UVData[1]}, nil - case u.Value > 6 && u.Value < 7.9: - return []UVIndexInfo{UVData[2]}, nil - case u.Value > 8 && u.Value < 10.9: - return []UVIndexInfo{UVData[3]}, nil - case u.Value >= 11: - return []UVIndexInfo{UVData[4]}, nil - default: - return nil, errInvalidUVIndex - } - - case len(u.Data) > 0: - var uvi []UVIndexInfo - for _, i := range u.Data { - switch { - case i.Value < 2.9: - uvi = append(uvi, UVData[0]) - case i.Value > 3 && u.Value < 5.9: - uvi = append(uvi, UVData[1]) - case i.Value > 6 && u.Value < 7.9: - uvi = append(uvi, UVData[2]) - case i.Value > 8 && u.Value < 10.9: - uvi = append(uvi, UVData[3]) - case i.Value >= 11: - uvi = append(uvi, UVData[4]) - default: - return nil, errInvalidUVIndex - } - } - } - - return nil, nil -} diff --git a/vendor/github.com/cenkalti/backoff/.gitignore b/vendor/github.com/cenkalti/backoff/.gitignore deleted file mode 100644 index 00268614..00000000 --- a/vendor/github.com/cenkalti/backoff/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe diff --git a/vendor/github.com/cenkalti/backoff/.travis.yml b/vendor/github.com/cenkalti/backoff/.travis.yml deleted file mode 100644 index 47a6a46e..00000000 --- a/vendor/github.com/cenkalti/backoff/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.7 - - 1.x - - tip -before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover -script: - - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/cenkalti/backoff/LICENSE b/vendor/github.com/cenkalti/backoff/LICENSE deleted file mode 100644 index 89b81799..00000000 --- a/vendor/github.com/cenkalti/backoff/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Cenk Altı - -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. diff --git a/vendor/github.com/cenkalti/backoff/README.md b/vendor/github.com/cenkalti/backoff/README.md deleted file mode 100644 index 55ebc98f..00000000 --- a/vendor/github.com/cenkalti/backoff/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls] - -This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. - -[Exponential backoff][exponential backoff wiki] -is an algorithm that uses feedback to multiplicatively decrease the rate of some process, -in order to gradually find an acceptable rate. -The retries exponentially increase and stop increasing when a certain threshold is met. - -## Usage - -See https://godoc.org/github.com/cenkalti/backoff#pkg-examples - -## Contributing - -* I would like to keep this library as small as possible. -* Please don't send a PR without opening an issue and discussing it first. -* If proposed change is not a common use case, I will probably not accept it. - -[godoc]: https://godoc.org/github.com/cenkalti/backoff -[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png -[travis]: https://travis-ci.org/cenkalti/backoff -[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master -[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master -[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master - -[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java -[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff - -[advanced example]: https://godoc.org/github.com/cenkalti/backoff#example_ diff --git a/vendor/github.com/cenkalti/backoff/backoff.go b/vendor/github.com/cenkalti/backoff/backoff.go deleted file mode 100644 index 3676ee40..00000000 --- a/vendor/github.com/cenkalti/backoff/backoff.go +++ /dev/null @@ -1,66 +0,0 @@ -// Package backoff implements backoff algorithms for retrying operations. -// -// Use Retry function for retrying operations that may fail. -// If Retry does not meet your needs, -// copy/paste the function into your project and modify as you wish. -// -// There is also Ticker type similar to time.Ticker. -// You can use it if you need to work with channels. -// -// See Examples section below for usage examples. -package backoff - -import "time" - -// BackOff is a backoff policy for retrying an operation. -type BackOff interface { - // NextBackOff returns the duration to wait before retrying the operation, - // or backoff. Stop to indicate that no more retries should be made. - // - // Example usage: - // - // duration := backoff.NextBackOff(); - // if (duration == backoff.Stop) { - // // Do not retry operation. - // } else { - // // Sleep for duration and retry operation. - // } - // - NextBackOff() time.Duration - - // Reset to initial state. - Reset() -} - -// Stop indicates that no more retries should be made for use in NextBackOff(). -const Stop time.Duration = -1 - -// ZeroBackOff is a fixed backoff policy whose backoff time is always zero, -// meaning that the operation is retried immediately without waiting, indefinitely. -type ZeroBackOff struct{} - -func (b *ZeroBackOff) Reset() {} - -func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 } - -// StopBackOff is a fixed backoff policy that always returns backoff.Stop for -// NextBackOff(), meaning that the operation should never be retried. -type StopBackOff struct{} - -func (b *StopBackOff) Reset() {} - -func (b *StopBackOff) NextBackOff() time.Duration { return Stop } - -// ConstantBackOff is a backoff policy that always returns the same backoff delay. -// This is in contrast to an exponential backoff policy, -// which returns a delay that grows longer as you call NextBackOff() over and over again. -type ConstantBackOff struct { - Interval time.Duration -} - -func (b *ConstantBackOff) Reset() {} -func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval } - -func NewConstantBackOff(d time.Duration) *ConstantBackOff { - return &ConstantBackOff{Interval: d} -} diff --git a/vendor/github.com/cenkalti/backoff/context.go b/vendor/github.com/cenkalti/backoff/context.go deleted file mode 100644 index 7706faa2..00000000 --- a/vendor/github.com/cenkalti/backoff/context.go +++ /dev/null @@ -1,63 +0,0 @@ -package backoff - -import ( - "context" - "time" -) - -// BackOffContext is a backoff policy that stops retrying after the context -// is canceled. -type BackOffContext interface { - BackOff - Context() context.Context -} - -type backOffContext struct { - BackOff - ctx context.Context -} - -// WithContext returns a BackOffContext with context ctx -// -// ctx must not be nil -func WithContext(b BackOff, ctx context.Context) BackOffContext { - if ctx == nil { - panic("nil context") - } - - if b, ok := b.(*backOffContext); ok { - return &backOffContext{ - BackOff: b.BackOff, - ctx: ctx, - } - } - - return &backOffContext{ - BackOff: b, - ctx: ctx, - } -} - -func ensureContext(b BackOff) BackOffContext { - if cb, ok := b.(BackOffContext); ok { - return cb - } - return WithContext(b, context.Background()) -} - -func (b *backOffContext) Context() context.Context { - return b.ctx -} - -func (b *backOffContext) NextBackOff() time.Duration { - select { - case <-b.ctx.Done(): - return Stop - default: - } - next := b.BackOff.NextBackOff() - if deadline, ok := b.ctx.Deadline(); ok && deadline.Sub(time.Now()) < next { - return Stop - } - return next -} diff --git a/vendor/github.com/cenkalti/backoff/exponential.go b/vendor/github.com/cenkalti/backoff/exponential.go deleted file mode 100644 index a031a659..00000000 --- a/vendor/github.com/cenkalti/backoff/exponential.go +++ /dev/null @@ -1,153 +0,0 @@ -package backoff - -import ( - "math/rand" - "time" -) - -/* -ExponentialBackOff is a backoff implementation that increases the backoff -period for each retry attempt using a randomization function that grows exponentially. - -NextBackOff() is calculated using the following formula: - - randomized interval = - RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor]) - -In other words NextBackOff() will range between the randomization factor -percentage below and above the retry interval. - -For example, given the following parameters: - - RetryInterval = 2 - RandomizationFactor = 0.5 - Multiplier = 2 - -the actual backoff period used in the next retry attempt will range between 1 and 3 seconds, -multiplied by the exponential, that is, between 2 and 6 seconds. - -Note: MaxInterval caps the RetryInterval and not the randomized interval. - -If the time elapsed since an ExponentialBackOff instance is created goes past the -MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. - -The elapsed time can be reset by calling Reset(). - -Example: Given the following default arguments, for 10 tries the sequence will be, -and assuming we go over the MaxElapsedTime on the 10th try: - - Request # RetryInterval (seconds) Randomized Interval (seconds) - - 1 0.5 [0.25, 0.75] - 2 0.75 [0.375, 1.125] - 3 1.125 [0.562, 1.687] - 4 1.687 [0.8435, 2.53] - 5 2.53 [1.265, 3.795] - 6 3.795 [1.897, 5.692] - 7 5.692 [2.846, 8.538] - 8 8.538 [4.269, 12.807] - 9 12.807 [6.403, 19.210] - 10 19.210 backoff.Stop - -Note: Implementation is not thread-safe. -*/ -type ExponentialBackOff struct { - InitialInterval time.Duration - RandomizationFactor float64 - Multiplier float64 - MaxInterval time.Duration - // After MaxElapsedTime the ExponentialBackOff stops. - // It never stops if MaxElapsedTime == 0. - MaxElapsedTime time.Duration - Clock Clock - - currentInterval time.Duration - startTime time.Time -} - -// Clock is an interface that returns current time for BackOff. -type Clock interface { - Now() time.Time -} - -// Default values for ExponentialBackOff. -const ( - DefaultInitialInterval = 500 * time.Millisecond - DefaultRandomizationFactor = 0.5 - DefaultMultiplier = 1.5 - DefaultMaxInterval = 60 * time.Second - DefaultMaxElapsedTime = 15 * time.Minute -) - -// NewExponentialBackOff creates an instance of ExponentialBackOff using default values. -func NewExponentialBackOff() *ExponentialBackOff { - b := &ExponentialBackOff{ - InitialInterval: DefaultInitialInterval, - RandomizationFactor: DefaultRandomizationFactor, - Multiplier: DefaultMultiplier, - MaxInterval: DefaultMaxInterval, - MaxElapsedTime: DefaultMaxElapsedTime, - Clock: SystemClock, - } - b.Reset() - return b -} - -type systemClock struct{} - -func (t systemClock) Now() time.Time { - return time.Now() -} - -// SystemClock implements Clock interface that uses time.Now(). -var SystemClock = systemClock{} - -// Reset the interval back to the initial retry interval and restarts the timer. -func (b *ExponentialBackOff) Reset() { - b.currentInterval = b.InitialInterval - b.startTime = b.Clock.Now() -} - -// NextBackOff calculates the next backoff interval using the formula: -// Randomized interval = RetryInterval +/- (RandomizationFactor * RetryInterval) -func (b *ExponentialBackOff) NextBackOff() time.Duration { - // Make sure we have not gone over the maximum elapsed time. - if b.MaxElapsedTime != 0 && b.GetElapsedTime() > b.MaxElapsedTime { - return Stop - } - defer b.incrementCurrentInterval() - return getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval) -} - -// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance -// is created and is reset when Reset() is called. -// -// The elapsed time is computed using time.Now().UnixNano(). It is -// safe to call even while the backoff policy is used by a running -// ticker. -func (b *ExponentialBackOff) GetElapsedTime() time.Duration { - return b.Clock.Now().Sub(b.startTime) -} - -// Increments the current interval by multiplying it with the multiplier. -func (b *ExponentialBackOff) incrementCurrentInterval() { - // Check for overflow, if overflow is detected set the current interval to the max interval. - if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier { - b.currentInterval = b.MaxInterval - } else { - b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier) - } -} - -// Returns a random value from the following interval: -// [randomizationFactor * currentInterval, randomizationFactor * currentInterval]. -func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { - var delta = randomizationFactor * float64(currentInterval) - var minInterval = float64(currentInterval) - delta - var maxInterval = float64(currentInterval) + delta - - // Get a random value from the range [minInterval, maxInterval]. - // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then - // we want a 33% chance for selecting either 1, 2 or 3. - return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) -} diff --git a/vendor/github.com/cenkalti/backoff/retry.go b/vendor/github.com/cenkalti/backoff/retry.go deleted file mode 100644 index e936a506..00000000 --- a/vendor/github.com/cenkalti/backoff/retry.go +++ /dev/null @@ -1,82 +0,0 @@ -package backoff - -import "time" - -// An Operation is executing by Retry() or RetryNotify(). -// The operation will be retried using a backoff policy if it returns an error. -type Operation func() error - -// Notify is a notify-on-error function. It receives an operation error and -// backoff delay if the operation failed (with an error). -// -// NOTE that if the backoff policy stated to stop retrying, -// the notify function isn't called. -type Notify func(error, time.Duration) - -// Retry the operation o until it does not return error or BackOff stops. -// o is guaranteed to be run at least once. -// -// If o returns a *PermanentError, the operation is not retried, and the -// wrapped error is returned. -// -// Retry sleeps the goroutine for the duration returned by BackOff after a -// failed operation returns. -func Retry(o Operation, b BackOff) error { return RetryNotify(o, b, nil) } - -// RetryNotify calls notify function with the error and wait duration -// for each failed attempt before sleep. -func RetryNotify(operation Operation, b BackOff, notify Notify) error { - var err error - var next time.Duration - var t *time.Timer - - cb := ensureContext(b) - - b.Reset() - for { - if err = operation(); err == nil { - return nil - } - - if permanent, ok := err.(*PermanentError); ok { - return permanent.Err - } - - if next = cb.NextBackOff(); next == Stop { - return err - } - - if notify != nil { - notify(err, next) - } - - if t == nil { - t = time.NewTimer(next) - defer t.Stop() - } else { - t.Reset(next) - } - - select { - case <-cb.Context().Done(): - return err - case <-t.C: - } - } -} - -// PermanentError signals that the operation should not be retried. -type PermanentError struct { - Err error -} - -func (e *PermanentError) Error() string { - return e.Err.Error() -} - -// Permanent wraps the given err in a *PermanentError. -func Permanent(err error) *PermanentError { - return &PermanentError{ - Err: err, - } -} diff --git a/vendor/github.com/cenkalti/backoff/ticker.go b/vendor/github.com/cenkalti/backoff/ticker.go deleted file mode 100644 index e41084b0..00000000 --- a/vendor/github.com/cenkalti/backoff/ticker.go +++ /dev/null @@ -1,82 +0,0 @@ -package backoff - -import ( - "sync" - "time" -) - -// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff. -// -// Ticks will continue to arrive when the previous operation is still running, -// so operations that take a while to fail could run in quick succession. -type Ticker struct { - C <-chan time.Time - c chan time.Time - b BackOffContext - stop chan struct{} - stopOnce sync.Once -} - -// NewTicker returns a new Ticker containing a channel that will send -// the time at times specified by the BackOff argument. Ticker is -// guaranteed to tick at least once. The channel is closed when Stop -// method is called or BackOff stops. It is not safe to manipulate the -// provided backoff policy (notably calling NextBackOff or Reset) -// while the ticker is running. -func NewTicker(b BackOff) *Ticker { - c := make(chan time.Time) - t := &Ticker{ - C: c, - c: c, - b: ensureContext(b), - stop: make(chan struct{}), - } - t.b.Reset() - go t.run() - return t -} - -// Stop turns off a ticker. After Stop, no more ticks will be sent. -func (t *Ticker) Stop() { - t.stopOnce.Do(func() { close(t.stop) }) -} - -func (t *Ticker) run() { - c := t.c - defer close(c) - - // Ticker is guaranteed to tick at least once. - afterC := t.send(time.Now()) - - for { - if afterC == nil { - return - } - - select { - case tick := <-afterC: - afterC = t.send(tick) - case <-t.stop: - t.c = nil // Prevent future ticks from being sent to the channel. - return - case <-t.b.Context().Done(): - return - } - } -} - -func (t *Ticker) send(tick time.Time) <-chan time.Time { - select { - case t.c <- tick: - case <-t.stop: - return nil - } - - next := t.b.NextBackOff() - if next == Stop { - t.Stop() - return nil - } - - return time.After(next) -} diff --git a/vendor/github.com/cenkalti/backoff/tries.go b/vendor/github.com/cenkalti/backoff/tries.go deleted file mode 100644 index cfeefd9b..00000000 --- a/vendor/github.com/cenkalti/backoff/tries.go +++ /dev/null @@ -1,35 +0,0 @@ -package backoff - -import "time" - -/* -WithMaxRetries creates a wrapper around another BackOff, which will -return Stop if NextBackOff() has been called too many times since -the last time Reset() was called - -Note: Implementation is not thread-safe. -*/ -func WithMaxRetries(b BackOff, max uint64) BackOff { - return &backOffTries{delegate: b, maxTries: max} -} - -type backOffTries struct { - delegate BackOff - maxTries uint64 - numTries uint64 -} - -func (b *backOffTries) NextBackOff() time.Duration { - if b.maxTries > 0 { - if b.maxTries <= b.numTries { - return Stop - } - b.numTries++ - } - return b.delegate.NextBackOff() -} - -func (b *backOffTries) Reset() { - b.numTries = 0 - b.delegate.Reset() -} diff --git a/vendor/github.com/danwakefield/fnmatch/.gitignore b/vendor/github.com/danwakefield/fnmatch/.gitignore deleted file mode 100644 index daf913b1..00000000 --- a/vendor/github.com/danwakefield/fnmatch/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/danwakefield/fnmatch/LICENSE b/vendor/github.com/danwakefield/fnmatch/LICENSE deleted file mode 100644 index 0dc9851a..00000000 --- a/vendor/github.com/danwakefield/fnmatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2016, Daniel Wakefield -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/danwakefield/fnmatch/README.md b/vendor/github.com/danwakefield/fnmatch/README.md deleted file mode 100644 index b8d71566..00000000 --- a/vendor/github.com/danwakefield/fnmatch/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# fnmatch -Updated clone of kballards golang fnmatch gist (https://gist.github.com/kballard/272720) - - diff --git a/vendor/github.com/danwakefield/fnmatch/fnmatch.go b/vendor/github.com/danwakefield/fnmatch/fnmatch.go deleted file mode 100644 index 07ac7b37..00000000 --- a/vendor/github.com/danwakefield/fnmatch/fnmatch.go +++ /dev/null @@ -1,219 +0,0 @@ -// Provide string-matching based on fnmatch.3 -package fnmatch - -// There are a few issues that I believe to be bugs, but this implementation is -// based as closely as possible on BSD fnmatch. These bugs are present in the -// source of BSD fnmatch, and so are replicated here. The issues are as follows: -// -// * FNM_PERIOD is no longer observed after the first * in a pattern -// This only applies to matches done with FNM_PATHNAME as well -// * FNM_PERIOD doesn't apply to ranges. According to the documentation, -// a period must be matched explicitly, but a range will match it too - -import ( - "unicode" - "unicode/utf8" -) - -const ( - FNM_NOESCAPE = (1 << iota) - FNM_PATHNAME - FNM_PERIOD - - FNM_LEADING_DIR - FNM_CASEFOLD - - FNM_IGNORECASE = FNM_CASEFOLD - FNM_FILE_NAME = FNM_PATHNAME -) - -func unpackRune(str *string) rune { - rune, size := utf8.DecodeRuneInString(*str) - *str = (*str)[size:] - return rune -} - -// Matches the pattern against the string, with the given flags, -// and returns true if the match is successful. -// This function should match fnmatch.3 as closely as possible. -func Match(pattern, s string, flags int) bool { - // The implementation for this function was patterned after the BSD fnmatch.c - // source found at http://src.gnu-darwin.org/src/contrib/csup/fnmatch.c.html - noescape := (flags&FNM_NOESCAPE != 0) - pathname := (flags&FNM_PATHNAME != 0) - period := (flags&FNM_PERIOD != 0) - leadingdir := (flags&FNM_LEADING_DIR != 0) - casefold := (flags&FNM_CASEFOLD != 0) - // the following is some bookkeeping that the original fnmatch.c implementation did not do - // We are forced to do this because we're not keeping indexes into C strings but rather - // processing utf8-encoded strings. Use a custom unpacker to maintain our state for us - sAtStart := true - sLastAtStart := true - sLastSlash := false - sLastUnpacked := rune(0) - unpackS := func() rune { - sLastSlash = (sLastUnpacked == '/') - sLastUnpacked = unpackRune(&s) - sLastAtStart = sAtStart - sAtStart = false - return sLastUnpacked - } - for len(pattern) > 0 { - c := unpackRune(&pattern) - switch c { - case '?': - if len(s) == 0 { - return false - } - sc := unpackS() - if pathname && sc == '/' { - return false - } - if period && sc == '.' && (sLastAtStart || (pathname && sLastSlash)) { - return false - } - case '*': - // collapse multiple *'s - // don't use unpackRune here, the only char we care to detect is ASCII - for len(pattern) > 0 && pattern[0] == '*' { - pattern = pattern[1:] - } - if period && s[0] == '.' && (sAtStart || (pathname && sLastUnpacked == '/')) { - return false - } - // optimize for patterns with * at end or before / - if len(pattern) == 0 { - if pathname { - return leadingdir || (strchr(s, '/') == -1) - } else { - return true - } - return !(pathname && strchr(s, '/') >= 0) - } else if pathname && pattern[0] == '/' { - offset := strchr(s, '/') - if offset == -1 { - return false - } else { - // we already know our pattern and string have a /, skip past it - s = s[offset:] // use unpackS here to maintain our bookkeeping state - unpackS() - pattern = pattern[1:] // we know / is one byte long - break - } - } - // general case, recurse - for test := s; len(test) > 0; unpackRune(&test) { - // I believe the (flags &^ FNM_PERIOD) is a bug when FNM_PATHNAME is specified - // but this follows exactly from how fnmatch.c implements it - if Match(pattern, test, (flags &^ FNM_PERIOD)) { - return true - } else if pathname && test[0] == '/' { - break - } - } - return false - case '[': - if len(s) == 0 { - return false - } - if pathname && s[0] == '/' { - return false - } - sc := unpackS() - if !rangematch(&pattern, sc, flags) { - return false - } - case '\\': - if !noescape { - if len(pattern) > 0 { - c = unpackRune(&pattern) - } - } - fallthrough - default: - if len(s) == 0 { - return false - } - sc := unpackS() - switch { - case sc == c: - case casefold && unicode.ToLower(sc) == unicode.ToLower(c): - default: - return false - } - } - } - return len(s) == 0 || (leadingdir && s[0] == '/') -} - -func rangematch(pattern *string, test rune, flags int) bool { - if len(*pattern) == 0 { - return false - } - casefold := (flags&FNM_CASEFOLD != 0) - noescape := (flags&FNM_NOESCAPE != 0) - if casefold { - test = unicode.ToLower(test) - } - var negate, matched bool - if (*pattern)[0] == '^' || (*pattern)[0] == '!' { - negate = true - (*pattern) = (*pattern)[1:] - } - for !matched && len(*pattern) > 1 && (*pattern)[0] != ']' { - c := unpackRune(pattern) - if !noescape && c == '\\' { - if len(*pattern) > 1 { - c = unpackRune(pattern) - } else { - return false - } - } - if casefold { - c = unicode.ToLower(c) - } - if (*pattern)[0] == '-' && len(*pattern) > 1 && (*pattern)[1] != ']' { - unpackRune(pattern) // skip the - - c2 := unpackRune(pattern) - if !noescape && c2 == '\\' { - if len(*pattern) > 0 { - c2 = unpackRune(pattern) - } else { - return false - } - } - if casefold { - c2 = unicode.ToLower(c2) - } - // this really should be more intelligent, but it looks like - // fnmatch.c does simple int comparisons, therefore we will as well - if c <= test && test <= c2 { - matched = true - } - } else if c == test { - matched = true - } - } - // skip past the rest of the pattern - ok := false - for !ok && len(*pattern) > 0 { - c := unpackRune(pattern) - if c == '\\' && len(*pattern) > 0 { - unpackRune(pattern) - } else if c == ']' { - ok = true - } - } - return ok && matched != negate -} - -// define strchr because strings.Index() seems a bit overkill -// returns the index of c in s, or -1 if there is no match -func strchr(s string, c rune) int { - for i, sc := range s { - if sc == c { - return i - } - } - return -1 -} diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE deleted file mode 100644 index bc52e96f..00000000 --- a/vendor/github.com/davecgh/go-spew/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2012-2016 Dave Collins - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go deleted file mode 100644 index 79299478..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2015-2016 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when the code is not running on Google App Engine, compiled by GopherJS, and -// "-tags safe" is not added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// Go versions prior to 1.4 are disabled because they use a different layout -// for interfaces which make the implementation of unsafeReflectValue more complex. -// +build !js,!appengine,!safe,!disableunsafe,go1.4 - -package spew - -import ( - "reflect" - "unsafe" -) - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = false - - // ptrSize is the size of a pointer on the current arch. - ptrSize = unsafe.Sizeof((*byte)(nil)) -) - -type flag uintptr - -var ( - // flagRO indicates whether the value field of a reflect.Value - // is read-only. - flagRO flag - - // flagAddr indicates whether the address of the reflect.Value's - // value may be taken. - flagAddr flag -) - -// flagKindMask holds the bits that make up the kind -// part of the flags field. In all the supported versions, -// it is in the lower 5 bits. -const flagKindMask = flag(0x1f) - -// Different versions of Go have used different -// bit layouts for the flags type. This table -// records the known combinations. -var okFlags = []struct { - ro, addr flag -}{{ - // From Go 1.4 to 1.5 - ro: 1 << 5, - addr: 1 << 7, -}, { - // Up to Go tip. - ro: 1<<5 | 1<<6, - addr: 1 << 8, -}} - -var flagValOffset = func() uintptr { - field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") - if !ok { - panic("reflect.Value has no flag field") - } - return field.Offset -}() - -// flagField returns a pointer to the flag field of a reflect.Value. -func flagField(v *reflect.Value) *flag { - return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset)) -} - -// unsafeReflectValue converts the passed reflect.Value into a one that bypasses -// the typical safety restrictions preventing access to unaddressable and -// unexported data. It works by digging the raw pointer to the underlying -// value out of the protected value and generating a new unprotected (unsafe) -// reflect.Value to it. -// -// This allows us to check for implementations of the Stringer and error -// interfaces to be used for pretty printing ordinarily unaddressable and -// inaccessible values such as unexported struct fields. -func unsafeReflectValue(v reflect.Value) reflect.Value { - if !v.IsValid() || (v.CanInterface() && v.CanAddr()) { - return v - } - flagFieldPtr := flagField(&v) - *flagFieldPtr &^= flagRO - *flagFieldPtr |= flagAddr - return v -} - -// Sanity checks against future reflect package changes -// to the type or semantics of the Value.flag field. -func init() { - field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") - if !ok { - panic("reflect.Value has no flag field") - } - if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() { - panic("reflect.Value flag field has changed kind") - } - type t0 int - var t struct { - A t0 - // t0 will have flagEmbedRO set. - t0 - // a will have flagStickyRO set - a t0 - } - vA := reflect.ValueOf(t).FieldByName("A") - va := reflect.ValueOf(t).FieldByName("a") - vt0 := reflect.ValueOf(t).FieldByName("t0") - - // Infer flagRO from the difference between the flags - // for the (otherwise identical) fields in t. - flagPublic := *flagField(&vA) - flagWithRO := *flagField(&va) | *flagField(&vt0) - flagRO = flagPublic ^ flagWithRO - - // Infer flagAddr from the difference between a value - // taken from a pointer and not. - vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A") - flagNoPtr := *flagField(&vA) - flagPtr := *flagField(&vPtrA) - flagAddr = flagNoPtr ^ flagPtr - - // Check that the inferred flags tally with one of the known versions. - for _, f := range okFlags { - if flagRO == f.ro && flagAddr == f.addr { - return - } - } - panic("reflect.Value read-only flag has changed semantics") -} diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go deleted file mode 100644 index 205c28d6..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2015-2016 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when the code is running on Google App Engine, compiled by GopherJS, or -// "-tags safe" is added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// +build js appengine safe disableunsafe !go1.4 - -package spew - -import "reflect" - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = true -) - -// unsafeReflectValue typically converts the passed reflect.Value into a one -// that bypasses the typical safety restrictions preventing access to -// unaddressable and unexported data. However, doing this relies on access to -// the unsafe package. This is a stub version which simply returns the passed -// reflect.Value when the unsafe package is not available. -func unsafeReflectValue(v reflect.Value) reflect.Value { - return v -} diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go deleted file mode 100644 index 1be8ce94..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/common.go +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "reflect" - "sort" - "strconv" -) - -// Some constants in the form of bytes to avoid string overhead. This mirrors -// the technique used in the fmt package. -var ( - panicBytes = []byte("(PANIC=") - plusBytes = []byte("+") - iBytes = []byte("i") - trueBytes = []byte("true") - falseBytes = []byte("false") - interfaceBytes = []byte("(interface {})") - commaNewlineBytes = []byte(",\n") - newlineBytes = []byte("\n") - openBraceBytes = []byte("{") - openBraceNewlineBytes = []byte("{\n") - closeBraceBytes = []byte("}") - asteriskBytes = []byte("*") - colonBytes = []byte(":") - colonSpaceBytes = []byte(": ") - openParenBytes = []byte("(") - closeParenBytes = []byte(")") - spaceBytes = []byte(" ") - pointerChainBytes = []byte("->") - nilAngleBytes = []byte("") - maxNewlineBytes = []byte("\n") - maxShortBytes = []byte("") - circularBytes = []byte("") - circularShortBytes = []byte("") - invalidAngleBytes = []byte("") - openBracketBytes = []byte("[") - closeBracketBytes = []byte("]") - percentBytes = []byte("%") - precisionBytes = []byte(".") - openAngleBytes = []byte("<") - closeAngleBytes = []byte(">") - openMapBytes = []byte("map[") - closeMapBytes = []byte("]") - lenEqualsBytes = []byte("len=") - capEqualsBytes = []byte("cap=") -) - -// hexDigits is used to map a decimal value to a hex digit. -var hexDigits = "0123456789abcdef" - -// catchPanic handles any panics that might occur during the handleMethods -// calls. -func catchPanic(w io.Writer, v reflect.Value) { - if err := recover(); err != nil { - w.Write(panicBytes) - fmt.Fprintf(w, "%v", err) - w.Write(closeParenBytes) - } -} - -// handleMethods attempts to call the Error and String methods on the underlying -// type the passed reflect.Value represents and outputes the result to Writer w. -// -// It handles panics in any called methods by catching and displaying the error -// as the formatted value. -func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { - // We need an interface to check if the type implements the error or - // Stringer interface. However, the reflect package won't give us an - // interface on certain things like unexported struct fields in order - // to enforce visibility rules. We use unsafe, when it's available, - // to bypass these restrictions since this package does not mutate the - // values. - if !v.CanInterface() { - if UnsafeDisabled { - return false - } - - v = unsafeReflectValue(v) - } - - // Choose whether or not to do error and Stringer interface lookups against - // the base type or a pointer to the base type depending on settings. - // Technically calling one of these methods with a pointer receiver can - // mutate the value, however, types which choose to satisify an error or - // Stringer interface with a pointer receiver should not be mutating their - // state inside these interface methods. - if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { - v = unsafeReflectValue(v) - } - if v.CanAddr() { - v = v.Addr() - } - - // Is it an error or Stringer? - switch iface := v.Interface().(type) { - case error: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.Error())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - - w.Write([]byte(iface.Error())) - return true - - case fmt.Stringer: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.String())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - w.Write([]byte(iface.String())) - return true - } - return false -} - -// printBool outputs a boolean value as true or false to Writer w. -func printBool(w io.Writer, val bool) { - if val { - w.Write(trueBytes) - } else { - w.Write(falseBytes) - } -} - -// printInt outputs a signed integer value to Writer w. -func printInt(w io.Writer, val int64, base int) { - w.Write([]byte(strconv.FormatInt(val, base))) -} - -// printUint outputs an unsigned integer value to Writer w. -func printUint(w io.Writer, val uint64, base int) { - w.Write([]byte(strconv.FormatUint(val, base))) -} - -// printFloat outputs a floating point value using the specified precision, -// which is expected to be 32 or 64bit, to Writer w. -func printFloat(w io.Writer, val float64, precision int) { - w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) -} - -// printComplex outputs a complex value using the specified float precision -// for the real and imaginary parts to Writer w. -func printComplex(w io.Writer, c complex128, floatPrecision int) { - r := real(c) - w.Write(openParenBytes) - w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) - i := imag(c) - if i >= 0 { - w.Write(plusBytes) - } - w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) - w.Write(iBytes) - w.Write(closeParenBytes) -} - -// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x' -// prefix to Writer w. -func printHexPtr(w io.Writer, p uintptr) { - // Null pointer. - num := uint64(p) - if num == 0 { - w.Write(nilAngleBytes) - return - } - - // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix - buf := make([]byte, 18) - - // It's simpler to construct the hex string right to left. - base := uint64(16) - i := len(buf) - 1 - for num >= base { - buf[i] = hexDigits[num%base] - num /= base - i-- - } - buf[i] = hexDigits[num] - - // Add '0x' prefix. - i-- - buf[i] = 'x' - i-- - buf[i] = '0' - - // Strip unused leading bytes. - buf = buf[i:] - w.Write(buf) -} - -// valuesSorter implements sort.Interface to allow a slice of reflect.Value -// elements to be sorted. -type valuesSorter struct { - values []reflect.Value - strings []string // either nil or same len and values - cs *ConfigState -} - -// newValuesSorter initializes a valuesSorter instance, which holds a set of -// surrogate keys on which the data should be sorted. It uses flags in -// ConfigState to decide if and how to populate those surrogate keys. -func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { - vs := &valuesSorter{values: values, cs: cs} - if canSortSimply(vs.values[0].Kind()) { - return vs - } - if !cs.DisableMethods { - vs.strings = make([]string, len(values)) - for i := range vs.values { - b := bytes.Buffer{} - if !handleMethods(cs, &b, vs.values[i]) { - vs.strings = nil - break - } - vs.strings[i] = b.String() - } - } - if vs.strings == nil && cs.SpewKeys { - vs.strings = make([]string, len(values)) - for i := range vs.values { - vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) - } - } - return vs -} - -// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted -// directly, or whether it should be considered for sorting by surrogate keys -// (if the ConfigState allows it). -func canSortSimply(kind reflect.Kind) bool { - // This switch parallels valueSortLess, except for the default case. - switch kind { - case reflect.Bool: - return true - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return true - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return true - case reflect.Float32, reflect.Float64: - return true - case reflect.String: - return true - case reflect.Uintptr: - return true - case reflect.Array: - return true - } - return false -} - -// Len returns the number of values in the slice. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Len() int { - return len(s.values) -} - -// Swap swaps the values at the passed indices. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Swap(i, j int) { - s.values[i], s.values[j] = s.values[j], s.values[i] - if s.strings != nil { - s.strings[i], s.strings[j] = s.strings[j], s.strings[i] - } -} - -// valueSortLess returns whether the first value should sort before the second -// value. It is used by valueSorter.Less as part of the sort.Interface -// implementation. -func valueSortLess(a, b reflect.Value) bool { - switch a.Kind() { - case reflect.Bool: - return !a.Bool() && b.Bool() - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return a.Int() < b.Int() - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return a.Uint() < b.Uint() - case reflect.Float32, reflect.Float64: - return a.Float() < b.Float() - case reflect.String: - return a.String() < b.String() - case reflect.Uintptr: - return a.Uint() < b.Uint() - case reflect.Array: - // Compare the contents of both arrays. - l := a.Len() - for i := 0; i < l; i++ { - av := a.Index(i) - bv := b.Index(i) - if av.Interface() == bv.Interface() { - continue - } - return valueSortLess(av, bv) - } - } - return a.String() < b.String() -} - -// Less returns whether the value at index i should sort before the -// value at index j. It is part of the sort.Interface implementation. -func (s *valuesSorter) Less(i, j int) bool { - if s.strings == nil { - return valueSortLess(s.values[i], s.values[j]) - } - return s.strings[i] < s.strings[j] -} - -// sortValues is a sort function that handles both native types and any type that -// can be converted to error or Stringer. Other inputs are sorted according to -// their Value.String() value to ensure display stability. -func sortValues(values []reflect.Value, cs *ConfigState) { - if len(values) == 0 { - return - } - sort.Sort(newValuesSorter(values, cs)) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/davecgh/go-spew/spew/config.go deleted file mode 100644 index 2e3d22f3..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/config.go +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "os" -) - -// ConfigState houses the configuration options used by spew to format and -// display values. There is a global instance, Config, that is used to control -// all top-level Formatter and Dump functionality. Each ConfigState instance -// provides methods equivalent to the top-level functions. -// -// The zero value for ConfigState provides no indentation. You would typically -// want to set it to a space or a tab. -// -// Alternatively, you can use NewDefaultConfig to get a ConfigState instance -// with default settings. See the documentation of NewDefaultConfig for default -// values. -type ConfigState struct { - // Indent specifies the string to use for each indentation level. The - // global config instance that all top-level functions use set this to a - // single space by default. If you would like more indentation, you might - // set this to a tab with "\t" or perhaps two spaces with " ". - Indent string - - // MaxDepth controls the maximum number of levels to descend into nested - // data structures. The default, 0, means there is no limit. - // - // NOTE: Circular data structures are properly detected, so it is not - // necessary to set this value unless you specifically want to limit deeply - // nested data structures. - MaxDepth int - - // DisableMethods specifies whether or not error and Stringer interfaces are - // invoked for types that implement them. - DisableMethods bool - - // DisablePointerMethods specifies whether or not to check for and invoke - // error and Stringer interfaces on types which only accept a pointer - // receiver when the current type is not a pointer. - // - // NOTE: This might be an unsafe action since calling one of these methods - // with a pointer receiver could technically mutate the value, however, - // in practice, types which choose to satisify an error or Stringer - // interface with a pointer receiver should not be mutating their state - // inside these interface methods. As a result, this option relies on - // access to the unsafe package, so it will not have any effect when - // running in environments without access to the unsafe package such as - // Google App Engine or with the "safe" build tag specified. - DisablePointerMethods bool - - // DisablePointerAddresses specifies whether to disable the printing of - // pointer addresses. This is useful when diffing data structures in tests. - DisablePointerAddresses bool - - // DisableCapacities specifies whether to disable the printing of capacities - // for arrays, slices, maps and channels. This is useful when diffing - // data structures in tests. - DisableCapacities bool - - // ContinueOnMethod specifies whether or not recursion should continue once - // a custom error or Stringer interface is invoked. The default, false, - // means it will print the results of invoking the custom error or Stringer - // interface and return immediately instead of continuing to recurse into - // the internals of the data type. - // - // NOTE: This flag does not have any effect if method invocation is disabled - // via the DisableMethods or DisablePointerMethods options. - ContinueOnMethod bool - - // SortKeys specifies map keys should be sorted before being printed. Use - // this to have a more deterministic, diffable output. Note that only - // native types (bool, int, uint, floats, uintptr and string) and types - // that support the error or Stringer interfaces (if methods are - // enabled) are supported, with other types sorted according to the - // reflect.Value.String() output which guarantees display stability. - SortKeys bool - - // SpewKeys specifies that, as a last resort attempt, map keys should - // be spewed to strings and sorted by those strings. This is only - // considered if SortKeys is true. - SpewKeys bool -} - -// Config is the active configuration of the top-level functions. -// The configuration can be changed by modifying the contents of spew.Config. -var Config = ConfigState{Indent: " "} - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the formatted string as a value that satisfies error. See NewFormatter -// for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, c.convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, c.convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, c.convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a Formatter interface returned by c.NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, c.convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Print(a ...interface{}) (n int, err error) { - return fmt.Print(c.convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, c.convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Println(a ...interface{}) (n int, err error) { - return fmt.Println(c.convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprint(a ...interface{}) string { - return fmt.Sprint(c.convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, c.convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a Formatter interface returned by c.NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintln(a ...interface{}) string { - return fmt.Sprintln(c.convertArgs(a)...) -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -c.Printf, c.Println, or c.Printf. -*/ -func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(c, v) -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { - fdump(c, w, a...) -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by modifying the public members -of c. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func (c *ConfigState) Dump(a ...interface{}) { - fdump(c, os.Stdout, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func (c *ConfigState) Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(c, &buf, a...) - return buf.String() -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a spew Formatter interface using -// the ConfigState associated with s. -func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = newFormatter(c, arg) - } - return formatters -} - -// NewDefaultConfig returns a ConfigState with the following default settings. -// -// Indent: " " -// MaxDepth: 0 -// DisableMethods: false -// DisablePointerMethods: false -// ContinueOnMethod: false -// SortKeys: false -func NewDefaultConfig() *ConfigState { - return &ConfigState{Indent: " "} -} diff --git a/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/davecgh/go-spew/spew/doc.go deleted file mode 100644 index aacaac6f..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/doc.go +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* -Package spew implements a deep pretty printer for Go data structures to aid in -debugging. - -A quick overview of the additional features spew provides over the built-in -printing facilities for Go data types are as follows: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output (only when using - Dump style) - -There are two different approaches spew allows for dumping Go data structures: - - * Dump style which prints with newlines, customizable indentation, - and additional debug information such as types and all pointer addresses - used to indirect to the final value - * A custom Formatter interface that integrates cleanly with the standard fmt - package and replaces %v, %+v, %#v, and %#+v to provide inline printing - similar to the default %v while providing the additional functionality - outlined above and passing unsupported format verbs such as %x and %q - along to fmt - -Quick Start - -This section demonstrates how to quickly get started with spew. See the -sections below for further details on formatting and configuration options. - -To dump a variable with full newlines, indentation, type, and pointer -information use Dump, Fdump, or Sdump: - spew.Dump(myVar1, myVar2, ...) - spew.Fdump(someWriter, myVar1, myVar2, ...) - str := spew.Sdump(myVar1, myVar2, ...) - -Alternatively, if you would prefer to use format strings with a compacted inline -printing style, use the convenience wrappers Printf, Fprintf, etc with -%v (most compact), %+v (adds pointer addresses), %#v (adds types), or -%#+v (adds types and pointer addresses): - spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - -Configuration Options - -Configuration of spew is handled by fields in the ConfigState type. For -convenience, all of the top-level functions use a global state available -via the spew.Config global. - -It is also possible to create a ConfigState instance that provides methods -equivalent to the top-level functions. This allows concurrent configuration -options. See the ConfigState documentation for more details. - -The following configuration options are available: - * Indent - String to use for each indentation level for Dump functions. - It is a single space by default. A popular alternative is "\t". - - * MaxDepth - Maximum number of levels to descend into nested data structures. - There is no limit by default. - - * DisableMethods - Disables invocation of error and Stringer interface methods. - Method invocation is enabled by default. - - * DisablePointerMethods - Disables invocation of error and Stringer interface methods on types - which only accept pointer receivers from non-pointer variables. - Pointer method invocation is enabled by default. - - * DisablePointerAddresses - DisablePointerAddresses specifies whether to disable the printing of - pointer addresses. This is useful when diffing data structures in tests. - - * DisableCapacities - DisableCapacities specifies whether to disable the printing of - capacities for arrays, slices, maps and channels. This is useful when - diffing data structures in tests. - - * ContinueOnMethod - Enables recursion into types after invoking error and Stringer interface - methods. Recursion after method invocation is disabled by default. - - * SortKeys - Specifies map keys should be sorted before being printed. Use - this to have a more deterministic, diffable output. Note that - only native types (bool, int, uint, floats, uintptr and string) - and types which implement error or Stringer interfaces are - supported with other types sorted according to the - reflect.Value.String() output which guarantees display - stability. Natural map order is used by default. - - * SpewKeys - Specifies that, as a last resort attempt, map keys should be - spewed to strings and sorted by those strings. This is only - considered if SortKeys is true. - -Dump Usage - -Simply call spew.Dump with a list of variables you want to dump: - - spew.Dump(myVar1, myVar2, ...) - -You may also call spew.Fdump if you would prefer to output to an arbitrary -io.Writer. For example, to dump to standard error: - - spew.Fdump(os.Stderr, myVar1, myVar2, ...) - -A third option is to call spew.Sdump to get the formatted output as a string: - - str := spew.Sdump(myVar1, myVar2, ...) - -Sample Dump Output - -See the Dump example for details on the setup of the types and variables being -shown here. - - (main.Foo) { - unexportedField: (*main.Bar)(0xf84002e210)({ - flag: (main.Flag) flagTwo, - data: (uintptr) - }), - ExportedField: (map[interface {}]interface {}) (len=1) { - (string) (len=3) "one": (bool) true - } - } - -Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C -command as shown. - ([]uint8) (len=32 cap=32) { - 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | - 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| - 00000020 31 32 |12| - } - -Custom Formatter - -Spew provides a custom formatter that implements the fmt.Formatter interface -so that it integrates cleanly with standard fmt package printing functions. The -formatter is useful for inline printing of smaller data types similar to the -standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Custom Formatter Usage - -The simplest way to make use of the spew custom formatter is to call one of the -convenience functions such as spew.Printf, spew.Println, or spew.Printf. The -functions have syntax you are most likely already familiar with: - - spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - spew.Println(myVar, myVar2) - spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - -See the Index for the full list convenience functions. - -Sample Formatter Output - -Double pointer to a uint8: - %v: <**>5 - %+v: <**>(0xf8400420d0->0xf8400420c8)5 - %#v: (**uint8)5 - %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 - -Pointer to circular struct with a uint8 field and a pointer to itself: - %v: <*>{1 <*>} - %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} - %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} - %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} - -See the Printf example for details on the setup of variables being shown -here. - -Errors - -Since it is possible for custom Stringer/error interfaces to panic, spew -detects them and handles them internally by printing the panic information -inline with the output. Since spew is intended to provide deep pretty printing -capabilities on structures, it intentionally does not return any errors. -*/ -package spew diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go deleted file mode 100644 index f78d89fc..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/dump.go +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "encoding/hex" - "fmt" - "io" - "os" - "reflect" - "regexp" - "strconv" - "strings" -) - -var ( - // uint8Type is a reflect.Type representing a uint8. It is used to - // convert cgo types to uint8 slices for hexdumping. - uint8Type = reflect.TypeOf(uint8(0)) - - // cCharRE is a regular expression that matches a cgo char. - // It is used to detect character arrays to hexdump them. - cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`) - - // cUnsignedCharRE is a regular expression that matches a cgo unsigned - // char. It is used to detect unsigned character arrays to hexdump - // them. - cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`) - - // cUint8tCharRE is a regular expression that matches a cgo uint8_t. - // It is used to detect uint8_t arrays to hexdump them. - cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`) -) - -// dumpState contains information about the state of a dump operation. -type dumpState struct { - w io.Writer - depth int - pointers map[uintptr]int - ignoreNextType bool - ignoreNextIndent bool - cs *ConfigState -} - -// indent performs indentation according to the depth level and cs.Indent -// option. -func (d *dumpState) indent() { - if d.ignoreNextIndent { - d.ignoreNextIndent = false - return - } - d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) -} - -// unpackValue returns values inside of non-nil interfaces when possible. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface && !v.IsNil() { - v = v.Elem() - } - return v -} - -// dumpPtr handles formatting of pointers by indirecting them as necessary. -func (d *dumpState) dumpPtr(v reflect.Value) { - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range d.pointers { - if depth >= d.depth { - delete(d.pointers, k) - } - } - - // Keep list of all dereferenced pointers to show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by dereferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := d.pointers[addr]; ok && pd < d.depth { - cycleFound = true - indirects-- - break - } - d.pointers[addr] = d.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type information. - d.w.Write(openParenBytes) - d.w.Write(bytes.Repeat(asteriskBytes, indirects)) - d.w.Write([]byte(ve.Type().String())) - d.w.Write(closeParenBytes) - - // Display pointer information. - if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { - d.w.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - d.w.Write(pointerChainBytes) - } - printHexPtr(d.w, addr) - } - d.w.Write(closeParenBytes) - } - - // Display dereferenced value. - d.w.Write(openParenBytes) - switch { - case nilFound: - d.w.Write(nilAngleBytes) - - case cycleFound: - d.w.Write(circularBytes) - - default: - d.ignoreNextType = true - d.dump(ve) - } - d.w.Write(closeParenBytes) -} - -// dumpSlice handles formatting of arrays and slices. Byte (uint8 under -// reflection) arrays and slices are dumped in hexdump -C fashion. -func (d *dumpState) dumpSlice(v reflect.Value) { - // Determine whether this type should be hex dumped or not. Also, - // for types which should be hexdumped, try to use the underlying data - // first, then fall back to trying to convert them to a uint8 slice. - var buf []uint8 - doConvert := false - doHexDump := false - numEntries := v.Len() - if numEntries > 0 { - vt := v.Index(0).Type() - vts := vt.String() - switch { - // C types that need to be converted. - case cCharRE.MatchString(vts): - fallthrough - case cUnsignedCharRE.MatchString(vts): - fallthrough - case cUint8tCharRE.MatchString(vts): - doConvert = true - - // Try to use existing uint8 slices and fall back to converting - // and copying if that fails. - case vt.Kind() == reflect.Uint8: - // We need an addressable interface to convert the type - // to a byte slice. However, the reflect package won't - // give us an interface on certain things like - // unexported struct fields in order to enforce - // visibility rules. We use unsafe, when available, to - // bypass these restrictions since this package does not - // mutate the values. - vs := v - if !vs.CanInterface() || !vs.CanAddr() { - vs = unsafeReflectValue(vs) - } - if !UnsafeDisabled { - vs = vs.Slice(0, numEntries) - - // Use the existing uint8 slice if it can be - // type asserted. - iface := vs.Interface() - if slice, ok := iface.([]uint8); ok { - buf = slice - doHexDump = true - break - } - } - - // The underlying data needs to be converted if it can't - // be type asserted to a uint8 slice. - doConvert = true - } - - // Copy and convert the underlying type if needed. - if doConvert && vt.ConvertibleTo(uint8Type) { - // Convert and copy each element into a uint8 byte - // slice. - buf = make([]uint8, numEntries) - for i := 0; i < numEntries; i++ { - vv := v.Index(i) - buf[i] = uint8(vv.Convert(uint8Type).Uint()) - } - doHexDump = true - } - } - - // Hexdump the entire slice as needed. - if doHexDump { - indent := strings.Repeat(d.cs.Indent, d.depth) - str := indent + hex.Dump(buf) - str = strings.Replace(str, "\n", "\n"+indent, -1) - str = strings.TrimRight(str, d.cs.Indent) - d.w.Write([]byte(str)) - return - } - - // Recursively call dump for each item. - for i := 0; i < numEntries; i++ { - d.dump(d.unpackValue(v.Index(i))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } -} - -// dump is the main workhorse for dumping a value. It uses the passed reflect -// value to figure out what kind of object we are dealing with and formats it -// appropriately. It is a recursive function, however circular data structures -// are detected and handled properly. -func (d *dumpState) dump(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - d.w.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - d.indent() - d.dumpPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !d.ignoreNextType { - d.indent() - d.w.Write(openParenBytes) - d.w.Write([]byte(v.Type().String())) - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - d.ignoreNextType = false - - // Display length and capacity if the built-in len and cap functions - // work with the value's kind and the len/cap itself is non-zero. - valueLen, valueCap := 0, 0 - switch v.Kind() { - case reflect.Array, reflect.Slice, reflect.Chan: - valueLen, valueCap = v.Len(), v.Cap() - case reflect.Map, reflect.String: - valueLen = v.Len() - } - if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { - d.w.Write(openParenBytes) - if valueLen != 0 { - d.w.Write(lenEqualsBytes) - printInt(d.w, int64(valueLen), 10) - } - if !d.cs.DisableCapacities && valueCap != 0 { - if valueLen != 0 { - d.w.Write(spaceBytes) - } - d.w.Write(capEqualsBytes) - printInt(d.w, int64(valueCap), 10) - } - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - - // Call Stringer/error interfaces if they exist and the handle methods flag - // is enabled - if !d.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(d.cs, d.w, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(d.w, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(d.w, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(d.w, v.Uint(), 10) - - case reflect.Float32: - printFloat(d.w, v.Float(), 32) - - case reflect.Float64: - printFloat(d.w, v.Float(), 64) - - case reflect.Complex64: - printComplex(d.w, v.Complex(), 32) - - case reflect.Complex128: - printComplex(d.w, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - d.dumpSlice(v) - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.String: - d.w.Write([]byte(strconv.Quote(v.String()))) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - d.w.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - numEntries := v.Len() - keys := v.MapKeys() - if d.cs.SortKeys { - sortValues(keys, d.cs) - } - for i, key := range keys { - d.dump(d.unpackValue(key)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.MapIndex(key))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Struct: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - vt := v.Type() - numFields := v.NumField() - for i := 0; i < numFields; i++ { - d.indent() - vtf := vt.Field(i) - d.w.Write([]byte(vtf.Name)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.Field(i))) - if i < (numFields - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(d.w, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(d.w, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it in case any new - // types are added. - default: - if v.CanInterface() { - fmt.Fprintf(d.w, "%v", v.Interface()) - } else { - fmt.Fprintf(d.w, "%v", v.String()) - } - } -} - -// fdump is a helper function to consolidate the logic from the various public -// methods which take varying writers and config states. -func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { - for _, arg := range a { - if arg == nil { - w.Write(interfaceBytes) - w.Write(spaceBytes) - w.Write(nilAngleBytes) - w.Write(newlineBytes) - continue - } - - d := dumpState{w: w, cs: cs} - d.pointers = make(map[uintptr]int) - d.dump(reflect.ValueOf(arg)) - d.w.Write(newlineBytes) - } -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func Fdump(w io.Writer, a ...interface{}) { - fdump(&Config, w, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(&Config, &buf, a...) - return buf.String() -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by an exported package global, -spew.Config. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func Dump(a ...interface{}) { - fdump(&Config, os.Stdout, a...) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go deleted file mode 100644 index b04edb7d..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/format.go +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "reflect" - "strconv" - "strings" -) - -// supportedFlags is a list of all the character flags supported by fmt package. -const supportedFlags = "0-+# " - -// formatState implements the fmt.Formatter interface and contains information -// about the state of a formatting operation. The NewFormatter function can -// be used to get a new Formatter which can be used directly as arguments -// in standard fmt package printing calls. -type formatState struct { - value interface{} - fs fmt.State - depth int - pointers map[uintptr]int - ignoreNextType bool - cs *ConfigState -} - -// buildDefaultFormat recreates the original format string without precision -// and width information to pass in to fmt.Sprintf in the case of an -// unrecognized type. Unless new types are added to the language, this -// function won't ever be called. -func (f *formatState) buildDefaultFormat() (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - buf.WriteRune('v') - - format = buf.String() - return format -} - -// constructOrigFormat recreates the original format string including precision -// and width information to pass along to the standard fmt package. This allows -// automatic deferral of all format strings this package doesn't support. -func (f *formatState) constructOrigFormat(verb rune) (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - if width, ok := f.fs.Width(); ok { - buf.WriteString(strconv.Itoa(width)) - } - - if precision, ok := f.fs.Precision(); ok { - buf.Write(precisionBytes) - buf.WriteString(strconv.Itoa(precision)) - } - - buf.WriteRune(verb) - - format = buf.String() - return format -} - -// unpackValue returns values inside of non-nil interfaces when possible and -// ensures that types for values which have been unpacked from an interface -// are displayed when the show types flag is also set. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (f *formatState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface { - f.ignoreNextType = false - if !v.IsNil() { - v = v.Elem() - } - } - return v -} - -// formatPtr handles formatting of pointers by indirecting them as necessary. -func (f *formatState) formatPtr(v reflect.Value) { - // Display nil if top level pointer is nil. - showTypes := f.fs.Flag('#') - if v.IsNil() && (!showTypes || f.ignoreNextType) { - f.fs.Write(nilAngleBytes) - return - } - - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range f.pointers { - if depth >= f.depth { - delete(f.pointers, k) - } - } - - // Keep list of all dereferenced pointers to possibly show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by derferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := f.pointers[addr]; ok && pd < f.depth { - cycleFound = true - indirects-- - break - } - f.pointers[addr] = f.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type or indirection level depending on flags. - if showTypes && !f.ignoreNextType { - f.fs.Write(openParenBytes) - f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) - f.fs.Write([]byte(ve.Type().String())) - f.fs.Write(closeParenBytes) - } else { - if nilFound || cycleFound { - indirects += strings.Count(ve.Type().String(), "*") - } - f.fs.Write(openAngleBytes) - f.fs.Write([]byte(strings.Repeat("*", indirects))) - f.fs.Write(closeAngleBytes) - } - - // Display pointer information depending on flags. - if f.fs.Flag('+') && (len(pointerChain) > 0) { - f.fs.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - f.fs.Write(pointerChainBytes) - } - printHexPtr(f.fs, addr) - } - f.fs.Write(closeParenBytes) - } - - // Display dereferenced value. - switch { - case nilFound: - f.fs.Write(nilAngleBytes) - - case cycleFound: - f.fs.Write(circularShortBytes) - - default: - f.ignoreNextType = true - f.format(ve) - } -} - -// format is the main workhorse for providing the Formatter interface. It -// uses the passed reflect value to figure out what kind of object we are -// dealing with and formats it appropriately. It is a recursive function, -// however circular data structures are detected and handled properly. -func (f *formatState) format(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - f.fs.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - f.formatPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !f.ignoreNextType && f.fs.Flag('#') { - f.fs.Write(openParenBytes) - f.fs.Write([]byte(v.Type().String())) - f.fs.Write(closeParenBytes) - } - f.ignoreNextType = false - - // Call Stringer/error interfaces if they exist and the handle methods - // flag is enabled. - if !f.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(f.cs, f.fs, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(f.fs, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(f.fs, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(f.fs, v.Uint(), 10) - - case reflect.Float32: - printFloat(f.fs, v.Float(), 32) - - case reflect.Float64: - printFloat(f.fs, v.Float(), 64) - - case reflect.Complex64: - printComplex(f.fs, v.Complex(), 32) - - case reflect.Complex128: - printComplex(f.fs, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - f.fs.Write(openBracketBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - numEntries := v.Len() - for i := 0; i < numEntries; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(v.Index(i))) - } - } - f.depth-- - f.fs.Write(closeBracketBytes) - - case reflect.String: - f.fs.Write([]byte(v.String())) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - f.fs.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - - f.fs.Write(openMapBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - keys := v.MapKeys() - if f.cs.SortKeys { - sortValues(keys, f.cs) - } - for i, key := range keys { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(key)) - f.fs.Write(colonBytes) - f.ignoreNextType = true - f.format(f.unpackValue(v.MapIndex(key))) - } - } - f.depth-- - f.fs.Write(closeMapBytes) - - case reflect.Struct: - numFields := v.NumField() - f.fs.Write(openBraceBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - vt := v.Type() - for i := 0; i < numFields; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - vtf := vt.Field(i) - if f.fs.Flag('+') || f.fs.Flag('#') { - f.fs.Write([]byte(vtf.Name)) - f.fs.Write(colonBytes) - } - f.format(f.unpackValue(v.Field(i))) - } - } - f.depth-- - f.fs.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(f.fs, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(f.fs, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it if any get added. - default: - format := f.buildDefaultFormat() - if v.CanInterface() { - fmt.Fprintf(f.fs, format, v.Interface()) - } else { - fmt.Fprintf(f.fs, format, v.String()) - } - } -} - -// Format satisfies the fmt.Formatter interface. See NewFormatter for usage -// details. -func (f *formatState) Format(fs fmt.State, verb rune) { - f.fs = fs - - // Use standard formatting for verbs that are not v. - if verb != 'v' { - format := f.constructOrigFormat(verb) - fmt.Fprintf(fs, format, f.value) - return - } - - if f.value == nil { - if fs.Flag('#') { - fs.Write(interfaceBytes) - } - fs.Write(nilAngleBytes) - return - } - - f.format(reflect.ValueOf(f.value)) -} - -// newFormatter is a helper function to consolidate the logic from the various -// public methods which take varying config states. -func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { - fs := &formatState{value: v, cs: cs} - fs.pointers = make(map[uintptr]int) - return fs -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -Printf, Println, or Fprintf. -*/ -func NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(&Config, v) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/spew.go b/vendor/github.com/davecgh/go-spew/spew/spew.go deleted file mode 100644 index 32c0e338..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/spew.go +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "fmt" - "io" -) - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the formatted string as a value that satisfies error. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a default Formatter interface returned by NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) -func Print(a ...interface{}) (n int, err error) { - return fmt.Print(convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) -func Println(a ...interface{}) (n int, err error) { - return fmt.Println(convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprint(a ...interface{}) string { - return fmt.Sprint(convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintln(a ...interface{}) string { - return fmt.Sprintln(convertArgs(a)...) -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a default spew Formatter interface. -func convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = NewFormatter(arg) - } - return formatters -} diff --git a/vendor/github.com/dgrijalva/jwt-go/.gitignore b/vendor/github.com/dgrijalva/jwt-go/.gitignore deleted file mode 100644 index 80bed650..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -bin - - diff --git a/vendor/github.com/dgrijalva/jwt-go/.travis.yml b/vendor/github.com/dgrijalva/jwt-go/.travis.yml deleted file mode 100644 index 1027f56c..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -script: - - go vet ./... - - go test -v ./... - -go: - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 - - tip diff --git a/vendor/github.com/dgrijalva/jwt-go/LICENSE b/vendor/github.com/dgrijalva/jwt-go/LICENSE deleted file mode 100644 index df83a9c2..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -Copyright (c) 2012 Dave Grijalva - -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. - diff --git a/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md b/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md deleted file mode 100644 index 7fc1f793..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md +++ /dev/null @@ -1,97 +0,0 @@ -## Migration Guide from v2 -> v3 - -Version 3 adds several new, frequently requested features. To do so, it introduces a few breaking changes. We've worked to keep these as minimal as possible. This guide explains the breaking changes and how you can quickly update your code. - -### `Token.Claims` is now an interface type - -The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`. We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`. - -`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior. It is the default claims type when using `Parse`. The usage is unchanged except you must type cast the claims property. - -The old example for parsing a token looked like this.. - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is now directly mapped to... - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -`StandardClaims` is designed to be embedded in your custom type. You can supply a custom claims type with the new `ParseWithClaims` function. Here's an example of using a custom claims type. - -```go - type MyCustomClaims struct { - User string - *StandardClaims - } - - if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil { - claims := token.Claims.(*MyCustomClaims) - fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt) - } -``` - -### `ParseFromRequest` has been moved - -To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`. The method signatues have also been augmented to receive a new argument: `Extractor`. - -`Extractors` do the work of picking the token string out of a request. The interface is simple and composable. - -This simple parsing example: - -```go - if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is directly mapped to: - -```go - if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -There are several concrete `Extractor` types provided for your convenience: - -* `HeaderExtractor` will search a list of headers until one contains content. -* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content. -* `MultiExtractor` will try a list of `Extractors` in order until one returns content. -* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token. -* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument -* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed. A simple example is stripping the `Bearer ` text from a header - - -### RSA signing methods no longer accept `[]byte` keys - -Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse. - -To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`. These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types. - -```go - func keyLookupFunc(*Token) (interface{}, error) { - // Don't forget to validate the alg is what you expect: - if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { - return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) - } - - // Look up key - key, err := lookupPublicKey(token.Header["kid"]) - if err != nil { - return nil, err - } - - // Unpack key from PEM encoded PKCS8 - return jwt.ParseRSAPublicKeyFromPEM(key) - } -``` diff --git a/vendor/github.com/dgrijalva/jwt-go/README.md b/vendor/github.com/dgrijalva/jwt-go/README.md deleted file mode 100644 index d358d881..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# jwt-go - -[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go) -[![GoDoc](https://godoc.org/github.com/dgrijalva/jwt-go?status.svg)](https://godoc.org/github.com/dgrijalva/jwt-go) - -A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) - -**NEW VERSION COMING:** There have been a lot of improvements suggested since the version 3.0.0 released in 2016. I'm working now on cutting two different releases: 3.2.0 will contain any non-breaking changes or enhancements. 4.0.0 will follow shortly which will include breaking changes. See the 4.0.0 milestone to get an idea of what's coming. If you have other ideas, or would like to participate in 4.0.0, now's the time. If you depend on this library and don't want to be interrupted, I recommend you use your dependency mangement tool to pin to version 3. - -**SECURITY NOTICE:** Some older versions of Go have a security issue in the cryotp/elliptic. Recommendation is to upgrade to at least 1.8.3. See issue #216 for more detail. - -**SECURITY NOTICE:** It's important that you [validate the `alg` presented is what you expect](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/). This library attempts to make it easy to do the right thing by requiring key types match the expected alg, but you should take the extra step to verify it in your usage. See the examples provided. - -## What the heck is a JWT? - -JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens. - -In short, it's a signed JSON object that does something useful (for example, authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is made of three parts, separated by `.`'s. The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded. The last part is the signature, encoded the same way. - -The first part is called the header. It contains the necessary information for verifying the last part, the signature. For example, which encryption method was used for signing and what key was used. - -The part in the middle is the interesting bit. It's called the Claims and contains the actual stuff you care about. Refer to [the RFC](http://self-issued.info/docs/draft-jones-json-web-token.html) for information about reserved keys and the proper way to add your own. - -## What's in the box? - -This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. - -## Examples - -See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage: - -* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) -* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac) -* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples) - -## Extensions - -This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. - -Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go - -## Compliance - -This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences: - -* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key. - -## Project Status & Versioning - -This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason). - -This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases). - -While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users. You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v3`. It will do the right thing WRT semantic versioning. - -**BREAKING CHANGES:*** -* Version 3.0.0 includes _a lot_ of changes from the 2.x line, including a few that break the API. We've tried to break as few things as possible, so there should just be a few type signature changes. A full list of breaking changes is available in `VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating your code. - -## Usage Tips - -### Signing vs Encryption - -A token is simply a JSON object that is signed by its author. this tells you exactly two things about the data: - -* The author of the token was in the possession of the signing secret -* The data has not been modified since it was signed - -It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. - -### Choosing a Signing Method - -There are several signing methods available, and you should probably take the time to learn about the various options before choosing one. The principal design decision is most likely going to be symmetric vs asymmetric. - -Symmetric signing methods, such as HSA, use only a single secret. This is probably the simplest signing method to use since any `[]byte` can be used as a valid secret. They are also slightly computationally faster to use, though this rarely is enough to matter. Symmetric signing methods work the best when both producers and consumers of tokens are trusted, or even the same system. Since the same secret is used to both sign and validate tokens, you can't easily distribute the key for validation. - -Asymmetric signing methods, such as RSA, use different keys for signing and verifying tokens. This makes it possible to produce tokens with a private key, and allow any consumer to access the public key for verification. - -### Signing Methods and Key Types - -Each signing method expects a different object type for its signing keys. See the package documentation for details. Here are the most common ones: - -* The [HMAC signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation -* The [RSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation -* The [ECDSA signing method](https://godoc.org/github.com/dgrijalva/jwt-go#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation - -### JWT and OAuth - -It's worth mentioning that OAuth and JWT are not the same thing. A JWT token is simply a signed JSON object. It can be used anywhere such a thing is useful. There is some confusion, though, as JWT is the most common type of bearer token used in OAuth2 authentication. - -Without going too far down the rabbit hole, here's a description of the interaction of these technologies: - -* OAuth is a protocol for allowing an identity provider to be separate from the service a user is logging in to. For example, whenever you use Facebook to log into a different service (Yelp, Spotify, etc), you are using OAuth. -* OAuth defines several options for passing around authentication data. One popular method is called a "bearer token". A bearer token is simply a string that _should_ only be held by an authenticated user. Thus, simply presenting this token proves your identity. You can probably derive from here why a JWT might make a good bearer token. -* Because bearer tokens are used for authentication, it's important they're kept secret. This is why transactions that use bearer tokens typically happen over SSL. - -## More - -Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go). - -The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in the documentation. diff --git a/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md b/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md deleted file mode 100644 index 63702983..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md +++ /dev/null @@ -1,118 +0,0 @@ -## `jwt-go` Version History - -#### 3.2.0 - -* Added method `ParseUnverified` to allow users to split up the tasks of parsing and validation -* HMAC signing method returns `ErrInvalidKeyType` instead of `ErrInvalidKey` where appropriate -* Added options to `request.ParseFromRequest`, which allows for an arbitrary list of modifiers to parsing behavior. Initial set include `WithClaims` and `WithParser`. Existing usage of this function will continue to work as before. -* Deprecated `ParseFromRequestWithClaims` to simplify API in the future. - -#### 3.1.0 - -* Improvements to `jwt` command line tool -* Added `SkipClaimsValidation` option to `Parser` -* Documentation updates - -#### 3.0.0 - -* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code - * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods. - * `ParseFromRequest` has been moved to `request` subpackage and usage has changed - * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims. -* Other Additions and Changes - * Added `Claims` interface type to allow users to decode the claims into a custom type - * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into. - * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage - * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims` - * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`. - * Added several new, more specific, validation errors to error type bitmask - * Moved examples from README to executable example files - * Signing method registry is now thread safe - * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser) - -#### 2.7.0 - -This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes. - -* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying -* Error text for expired tokens includes how long it's been expired -* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM` -* Documentation updates - -#### 2.6.0 - -* Exposed inner error within ValidationError -* Fixed validation errors when using UseJSONNumber flag -* Added several unit tests - -#### 2.5.0 - -* Added support for signing method none. You shouldn't use this. The API tries to make this clear. -* Updated/fixed some documentation -* Added more helpful error message when trying to parse tokens that begin with `BEARER ` - -#### 2.4.0 - -* Added new type, Parser, to allow for configuration of various parsing parameters - * You can now specify a list of valid signing methods. Anything outside this set will be rejected. - * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON -* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go) -* Fixed some bugs with ECDSA parsing - -#### 2.3.0 - -* Added support for ECDSA signing methods -* Added support for RSA PSS signing methods (requires go v1.4) - -#### 2.2.0 - -* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic. - -#### 2.1.0 - -Backwards compatible API change that was missed in 2.0.0. - -* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte` - -#### 2.0.0 - -There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change. - -The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`. - -It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`. - -* **Compatibility Breaking Changes** - * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct` - * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct` - * `KeyFunc` now returns `interface{}` instead of `[]byte` - * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key - * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key -* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodHS256` - * Added public package global `SigningMethodHS384` - * Added public package global `SigningMethodHS512` -* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodRS256` - * Added public package global `SigningMethodRS384` - * Added public package global `SigningMethodRS512` -* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged. -* Refactored the RSA implementation to be easier to read -* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM` - -#### 1.0.2 - -* Fixed bug in parsing public keys from certificates -* Added more tests around the parsing of keys for RS256 -* Code refactoring in RS256 implementation. No functional changes - -#### 1.0.1 - -* Fixed panic if RS256 signing method was passed an invalid key - -#### 1.0.0 - -* First versioned release -* API stabilized -* Supports creating, signing, parsing, and validating JWT tokens -* Supports RS256 and HS256 signing methods \ No newline at end of file diff --git a/vendor/github.com/dgrijalva/jwt-go/claims.go b/vendor/github.com/dgrijalva/jwt-go/claims.go deleted file mode 100644 index f0228f02..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/claims.go +++ /dev/null @@ -1,134 +0,0 @@ -package jwt - -import ( - "crypto/subtle" - "fmt" - "time" -) - -// For a type to be a Claims object, it must just have a Valid method that determines -// if the token is invalid for any supported reason -type Claims interface { - Valid() error -} - -// Structured version of Claims Section, as referenced at -// https://tools.ietf.org/html/rfc7519#section-4.1 -// See examples for how to use this with your own claim types -type StandardClaims struct { - Audience string `json:"aud,omitempty"` - ExpiresAt int64 `json:"exp,omitempty"` - Id string `json:"jti,omitempty"` - IssuedAt int64 `json:"iat,omitempty"` - Issuer string `json:"iss,omitempty"` - NotBefore int64 `json:"nbf,omitempty"` - Subject string `json:"sub,omitempty"` -} - -// Validates time based claims "exp, iat, nbf". -// There is no accounting for clock skew. -// As well, if any of the above claims are not in the token, it will still -// be considered a valid claim. -func (c StandardClaims) Valid() error { - vErr := new(ValidationError) - now := TimeFunc().Unix() - - // The claims below are optional, by default, so if they are set to the - // default value in Go, let's not fail the verification for them. - if c.VerifyExpiresAt(now, false) == false { - delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0)) - vErr.Inner = fmt.Errorf("token is expired by %v", delta) - vErr.Errors |= ValidationErrorExpired - } - - if c.VerifyIssuedAt(now, false) == false { - vErr.Inner = fmt.Errorf("Token used before issued") - vErr.Errors |= ValidationErrorIssuedAt - } - - if c.VerifyNotBefore(now, false) == false { - vErr.Inner = fmt.Errorf("token is not valid yet") - vErr.Errors |= ValidationErrorNotValidYet - } - - if vErr.valid() { - return nil - } - - return vErr -} - -// Compares the aud claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool { - return verifyAud(c.Audience, cmp, req) -} - -// Compares the exp claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool { - return verifyExp(c.ExpiresAt, cmp, req) -} - -// Compares the iat claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool { - return verifyIat(c.IssuedAt, cmp, req) -} - -// Compares the iss claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool { - return verifyIss(c.Issuer, cmp, req) -} - -// Compares the nbf claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool { - return verifyNbf(c.NotBefore, cmp, req) -} - -// ----- helpers - -func verifyAud(aud string, cmp string, required bool) bool { - if aud == "" { - return !required - } - if subtle.ConstantTimeCompare([]byte(aud), []byte(cmp)) != 0 { - return true - } else { - return false - } -} - -func verifyExp(exp int64, now int64, required bool) bool { - if exp == 0 { - return !required - } - return now <= exp -} - -func verifyIat(iat int64, now int64, required bool) bool { - if iat == 0 { - return !required - } - return now >= iat -} - -func verifyIss(iss string, cmp string, required bool) bool { - if iss == "" { - return !required - } - if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 { - return true - } else { - return false - } -} - -func verifyNbf(nbf int64, now int64, required bool) bool { - if nbf == 0 { - return !required - } - return now >= nbf -} diff --git a/vendor/github.com/dgrijalva/jwt-go/doc.go b/vendor/github.com/dgrijalva/jwt-go/doc.go deleted file mode 100644 index a86dc1a3..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html -// -// See README.md for more info. -package jwt diff --git a/vendor/github.com/dgrijalva/jwt-go/ecdsa.go b/vendor/github.com/dgrijalva/jwt-go/ecdsa.go deleted file mode 100644 index f9773812..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/ecdsa.go +++ /dev/null @@ -1,148 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rand" - "errors" - "math/big" -) - -var ( - // Sadly this is missing from crypto/ecdsa compared to crypto/rsa - ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") -) - -// Implements the ECDSA family of signing methods signing methods -// Expects *ecdsa.PrivateKey for signing and *ecdsa.PublicKey for verification -type SigningMethodECDSA struct { - Name string - Hash crypto.Hash - KeySize int - CurveBits int -} - -// Specific instances for EC256 and company -var ( - SigningMethodES256 *SigningMethodECDSA - SigningMethodES384 *SigningMethodECDSA - SigningMethodES512 *SigningMethodECDSA -) - -func init() { - // ES256 - SigningMethodES256 = &SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256} - RegisterSigningMethod(SigningMethodES256.Alg(), func() SigningMethod { - return SigningMethodES256 - }) - - // ES384 - SigningMethodES384 = &SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384} - RegisterSigningMethod(SigningMethodES384.Alg(), func() SigningMethod { - return SigningMethodES384 - }) - - // ES512 - SigningMethodES512 = &SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521} - RegisterSigningMethod(SigningMethodES512.Alg(), func() SigningMethod { - return SigningMethodES512 - }) -} - -func (m *SigningMethodECDSA) Alg() string { - return m.Name -} - -// Implements the Verify method from SigningMethod -// For this verify method, key must be an ecdsa.PublicKey struct -func (m *SigningMethodECDSA) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - // Get the key - var ecdsaKey *ecdsa.PublicKey - switch k := key.(type) { - case *ecdsa.PublicKey: - ecdsaKey = k - default: - return ErrInvalidKeyType - } - - if len(sig) != 2*m.KeySize { - return ErrECDSAVerification - } - - r := big.NewInt(0).SetBytes(sig[:m.KeySize]) - s := big.NewInt(0).SetBytes(sig[m.KeySize:]) - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Verify the signature - if verifystatus := ecdsa.Verify(ecdsaKey, hasher.Sum(nil), r, s); verifystatus == true { - return nil - } else { - return ErrECDSAVerification - } -} - -// Implements the Sign method from SigningMethod -// For this signing method, key must be an ecdsa.PrivateKey struct -func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string, error) { - // Get the key - var ecdsaKey *ecdsa.PrivateKey - switch k := key.(type) { - case *ecdsa.PrivateKey: - ecdsaKey = k - default: - return "", ErrInvalidKeyType - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return r, s - if r, s, err := ecdsa.Sign(rand.Reader, ecdsaKey, hasher.Sum(nil)); err == nil { - curveBits := ecdsaKey.Curve.Params().BitSize - - if m.CurveBits != curveBits { - return "", ErrInvalidKey - } - - keyBytes := curveBits / 8 - if curveBits%8 > 0 { - keyBytes += 1 - } - - // We serialize the outpus (r and s) into big-endian byte arrays and pad - // them with zeros on the left to make sure the sizes work out. Both arrays - // must be keyBytes long, and the output must be 2*keyBytes long. - rBytes := r.Bytes() - rBytesPadded := make([]byte, keyBytes) - copy(rBytesPadded[keyBytes-len(rBytes):], rBytes) - - sBytes := s.Bytes() - sBytesPadded := make([]byte, keyBytes) - copy(sBytesPadded[keyBytes-len(sBytes):], sBytes) - - out := append(rBytesPadded, sBytesPadded...) - - return EncodeSegment(out), nil - } else { - return "", err - } -} diff --git a/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go b/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go deleted file mode 100644 index d19624b7..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go +++ /dev/null @@ -1,67 +0,0 @@ -package jwt - -import ( - "crypto/ecdsa" - "crypto/x509" - "encoding/pem" - "errors" -) - -var ( - ErrNotECPublicKey = errors.New("Key is not a valid ECDSA public key") - ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key") -) - -// Parse PEM encoded Elliptic Curve Private Key Structure -func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil { - return nil, err - } - - var pkey *ecdsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok { - return nil, ErrNotECPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 public key -func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { - if cert, err := x509.ParseCertificate(block.Bytes); err == nil { - parsedKey = cert.PublicKey - } else { - return nil, err - } - } - - var pkey *ecdsa.PublicKey - var ok bool - if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok { - return nil, ErrNotECPublicKey - } - - return pkey, nil -} diff --git a/vendor/github.com/dgrijalva/jwt-go/errors.go b/vendor/github.com/dgrijalva/jwt-go/errors.go deleted file mode 100644 index 1c93024a..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/errors.go +++ /dev/null @@ -1,59 +0,0 @@ -package jwt - -import ( - "errors" -) - -// Error constants -var ( - ErrInvalidKey = errors.New("key is invalid") - ErrInvalidKeyType = errors.New("key is of invalid type") - ErrHashUnavailable = errors.New("the requested hash function is unavailable") -) - -// The errors that might occur when parsing and validating a token -const ( - ValidationErrorMalformed uint32 = 1 << iota // Token is malformed - ValidationErrorUnverifiable // Token could not be verified because of signing problems - ValidationErrorSignatureInvalid // Signature validation failed - - // Standard Claim validation errors - ValidationErrorAudience // AUD validation failed - ValidationErrorExpired // EXP validation failed - ValidationErrorIssuedAt // IAT validation failed - ValidationErrorIssuer // ISS validation failed - ValidationErrorNotValidYet // NBF validation failed - ValidationErrorId // JTI validation failed - ValidationErrorClaimsInvalid // Generic claims validation error -) - -// Helper for constructing a ValidationError with a string error message -func NewValidationError(errorText string, errorFlags uint32) *ValidationError { - return &ValidationError{ - text: errorText, - Errors: errorFlags, - } -} - -// The error from Parse if token is not valid -type ValidationError struct { - Inner error // stores the error returned by external dependencies, i.e.: KeyFunc - Errors uint32 // bitfield. see ValidationError... constants - text string // errors that do not have a valid error just have text -} - -// Validation error is an error type -func (e ValidationError) Error() string { - if e.Inner != nil { - return e.Inner.Error() - } else if e.text != "" { - return e.text - } else { - return "token is invalid" - } -} - -// No errors -func (e *ValidationError) valid() bool { - return e.Errors == 0 -} diff --git a/vendor/github.com/dgrijalva/jwt-go/hmac.go b/vendor/github.com/dgrijalva/jwt-go/hmac.go deleted file mode 100644 index addbe5d4..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/hmac.go +++ /dev/null @@ -1,95 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/hmac" - "errors" -) - -// Implements the HMAC-SHA family of signing methods signing methods -// Expects key type of []byte for both signing and validation -type SigningMethodHMAC struct { - Name string - Hash crypto.Hash -} - -// Specific instances for HS256 and company -var ( - SigningMethodHS256 *SigningMethodHMAC - SigningMethodHS384 *SigningMethodHMAC - SigningMethodHS512 *SigningMethodHMAC - ErrSignatureInvalid = errors.New("signature is invalid") -) - -func init() { - // HS256 - SigningMethodHS256 = &SigningMethodHMAC{"HS256", crypto.SHA256} - RegisterSigningMethod(SigningMethodHS256.Alg(), func() SigningMethod { - return SigningMethodHS256 - }) - - // HS384 - SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384} - RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod { - return SigningMethodHS384 - }) - - // HS512 - SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512} - RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod { - return SigningMethodHS512 - }) -} - -func (m *SigningMethodHMAC) Alg() string { - return m.Name -} - -// Verify the signature of HSXXX tokens. Returns nil if the signature is valid. -func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error { - // Verify the key is the right type - keyBytes, ok := key.([]byte) - if !ok { - return ErrInvalidKeyType - } - - // Decode signature, for comparison - sig, err := DecodeSegment(signature) - if err != nil { - return err - } - - // Can we use the specified hashing method? - if !m.Hash.Available() { - return ErrHashUnavailable - } - - // This signing method is symmetric, so we validate the signature - // by reproducing the signature from the signing string and key, then - // comparing that against the provided signature. - hasher := hmac.New(m.Hash.New, keyBytes) - hasher.Write([]byte(signingString)) - if !hmac.Equal(sig, hasher.Sum(nil)) { - return ErrSignatureInvalid - } - - // No validation errors. Signature is good. - return nil -} - -// Implements the Sign method from SigningMethod for this signing method. -// Key must be []byte -func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) { - if keyBytes, ok := key.([]byte); ok { - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := hmac.New(m.Hash.New, keyBytes) - hasher.Write([]byte(signingString)) - - return EncodeSegment(hasher.Sum(nil)), nil - } - - return "", ErrInvalidKeyType -} diff --git a/vendor/github.com/dgrijalva/jwt-go/map_claims.go b/vendor/github.com/dgrijalva/jwt-go/map_claims.go deleted file mode 100644 index 291213c4..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/map_claims.go +++ /dev/null @@ -1,94 +0,0 @@ -package jwt - -import ( - "encoding/json" - "errors" - // "fmt" -) - -// Claims type that uses the map[string]interface{} for JSON decoding -// This is the default claims type if you don't supply one -type MapClaims map[string]interface{} - -// Compares the aud claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyAudience(cmp string, req bool) bool { - aud, _ := m["aud"].(string) - return verifyAud(aud, cmp, req) -} - -// Compares the exp claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool { - switch exp := m["exp"].(type) { - case float64: - return verifyExp(int64(exp), cmp, req) - case json.Number: - v, _ := exp.Int64() - return verifyExp(v, cmp, req) - } - return req == false -} - -// Compares the iat claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool { - switch iat := m["iat"].(type) { - case float64: - return verifyIat(int64(iat), cmp, req) - case json.Number: - v, _ := iat.Int64() - return verifyIat(v, cmp, req) - } - return req == false -} - -// Compares the iss claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyIssuer(cmp string, req bool) bool { - iss, _ := m["iss"].(string) - return verifyIss(iss, cmp, req) -} - -// Compares the nbf claim against cmp. -// If required is false, this method will return true if the value matches or is unset -func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool { - switch nbf := m["nbf"].(type) { - case float64: - return verifyNbf(int64(nbf), cmp, req) - case json.Number: - v, _ := nbf.Int64() - return verifyNbf(v, cmp, req) - } - return req == false -} - -// Validates time based claims "exp, iat, nbf". -// There is no accounting for clock skew. -// As well, if any of the above claims are not in the token, it will still -// be considered a valid claim. -func (m MapClaims) Valid() error { - vErr := new(ValidationError) - now := TimeFunc().Unix() - - if m.VerifyExpiresAt(now, false) == false { - vErr.Inner = errors.New("Token is expired") - vErr.Errors |= ValidationErrorExpired - } - - if m.VerifyIssuedAt(now, false) == false { - vErr.Inner = errors.New("Token used before issued") - vErr.Errors |= ValidationErrorIssuedAt - } - - if m.VerifyNotBefore(now, false) == false { - vErr.Inner = errors.New("Token is not valid yet") - vErr.Errors |= ValidationErrorNotValidYet - } - - if vErr.valid() { - return nil - } - - return vErr -} diff --git a/vendor/github.com/dgrijalva/jwt-go/none.go b/vendor/github.com/dgrijalva/jwt-go/none.go deleted file mode 100644 index f04d189d..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/none.go +++ /dev/null @@ -1,52 +0,0 @@ -package jwt - -// Implements the none signing method. This is required by the spec -// but you probably should never use it. -var SigningMethodNone *signingMethodNone - -const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed" - -var NoneSignatureTypeDisallowedError error - -type signingMethodNone struct{} -type unsafeNoneMagicConstant string - -func init() { - SigningMethodNone = &signingMethodNone{} - NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid) - - RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod { - return SigningMethodNone - }) -} - -func (m *signingMethodNone) Alg() string { - return "none" -} - -// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) { - // Key must be UnsafeAllowNoneSignatureType to prevent accidentally - // accepting 'none' signing method - if _, ok := key.(unsafeNoneMagicConstant); !ok { - return NoneSignatureTypeDisallowedError - } - // If signing method is none, signature must be an empty string - if signature != "" { - return NewValidationError( - "'none' signing method with non-empty signature", - ValidationErrorSignatureInvalid, - ) - } - - // Accept 'none' signing method. - return nil -} - -// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key -func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) { - if _, ok := key.(unsafeNoneMagicConstant); ok { - return "", nil - } - return "", NoneSignatureTypeDisallowedError -} diff --git a/vendor/github.com/dgrijalva/jwt-go/parser.go b/vendor/github.com/dgrijalva/jwt-go/parser.go deleted file mode 100644 index d6901d9a..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/parser.go +++ /dev/null @@ -1,148 +0,0 @@ -package jwt - -import ( - "bytes" - "encoding/json" - "fmt" - "strings" -) - -type Parser struct { - ValidMethods []string // If populated, only these methods will be considered valid - UseJSONNumber bool // Use JSON Number format in JSON decoder - SkipClaimsValidation bool // Skip claims validation during token parsing -} - -// Parse, validate, and return a token. -// keyFunc will receive the parsed token and should return the key for validating. -// If everything is kosher, err will be nil -func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { - return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) -} - -func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { - token, parts, err := p.ParseUnverified(tokenString, claims) - if err != nil { - return token, err - } - - // Verify signing method is in the required set - if p.ValidMethods != nil { - var signingMethodValid = false - var alg = token.Method.Alg() - for _, m := range p.ValidMethods { - if m == alg { - signingMethodValid = true - break - } - } - if !signingMethodValid { - // signing method is not in the listed set - return token, NewValidationError(fmt.Sprintf("signing method %v is invalid", alg), ValidationErrorSignatureInvalid) - } - } - - // Lookup key - var key interface{} - if keyFunc == nil { - // keyFunc was not provided. short circuiting validation - return token, NewValidationError("no Keyfunc was provided.", ValidationErrorUnverifiable) - } - if key, err = keyFunc(token); err != nil { - // keyFunc returned an error - if ve, ok := err.(*ValidationError); ok { - return token, ve - } - return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable} - } - - vErr := &ValidationError{} - - // Validate Claims - if !p.SkipClaimsValidation { - if err := token.Claims.Valid(); err != nil { - - // If the Claims Valid returned an error, check if it is a validation error, - // If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set - if e, ok := err.(*ValidationError); !ok { - vErr = &ValidationError{Inner: err, Errors: ValidationErrorClaimsInvalid} - } else { - vErr = e - } - } - } - - // Perform validation - token.Signature = parts[2] - if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil { - vErr.Inner = err - vErr.Errors |= ValidationErrorSignatureInvalid - } - - if vErr.valid() { - token.Valid = true - return token, nil - } - - return token, vErr -} - -// WARNING: Don't use this method unless you know what you're doing -// -// This method parses the token but doesn't validate the signature. It's only -// ever useful in cases where you know the signature is valid (because it has -// been checked previously in the stack) and you want to extract values from -// it. -func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) { - parts = strings.Split(tokenString, ".") - if len(parts) != 3 { - return nil, parts, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed) - } - - token = &Token{Raw: tokenString} - - // parse Header - var headerBytes []byte - if headerBytes, err = DecodeSegment(parts[0]); err != nil { - if strings.HasPrefix(strings.ToLower(tokenString), "bearer ") { - return token, parts, NewValidationError("tokenstring should not contain 'bearer '", ValidationErrorMalformed) - } - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - if err = json.Unmarshal(headerBytes, &token.Header); err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - - // parse Claims - var claimBytes []byte - token.Claims = claims - - if claimBytes, err = DecodeSegment(parts[1]); err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - dec := json.NewDecoder(bytes.NewBuffer(claimBytes)) - if p.UseJSONNumber { - dec.UseNumber() - } - // JSON Decode. Special case for map type to avoid weird pointer behavior - if c, ok := token.Claims.(MapClaims); ok { - err = dec.Decode(&c) - } else { - err = dec.Decode(&claims) - } - // Handle decode error - if err != nil { - return token, parts, &ValidationError{Inner: err, Errors: ValidationErrorMalformed} - } - - // Lookup signature method - if method, ok := token.Header["alg"].(string); ok { - if token.Method = GetSigningMethod(method); token.Method == nil { - return token, parts, NewValidationError("signing method (alg) is unavailable.", ValidationErrorUnverifiable) - } - } else { - return token, parts, NewValidationError("signing method (alg) is unspecified.", ValidationErrorUnverifiable) - } - - return token, parts, nil -} diff --git a/vendor/github.com/dgrijalva/jwt-go/rsa.go b/vendor/github.com/dgrijalva/jwt-go/rsa.go deleted file mode 100644 index e4caf1ca..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/rsa.go +++ /dev/null @@ -1,101 +0,0 @@ -package jwt - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" -) - -// Implements the RSA family of signing methods signing methods -// Expects *rsa.PrivateKey for signing and *rsa.PublicKey for validation -type SigningMethodRSA struct { - Name string - Hash crypto.Hash -} - -// Specific instances for RS256 and company -var ( - SigningMethodRS256 *SigningMethodRSA - SigningMethodRS384 *SigningMethodRSA - SigningMethodRS512 *SigningMethodRSA -) - -func init() { - // RS256 - SigningMethodRS256 = &SigningMethodRSA{"RS256", crypto.SHA256} - RegisterSigningMethod(SigningMethodRS256.Alg(), func() SigningMethod { - return SigningMethodRS256 - }) - - // RS384 - SigningMethodRS384 = &SigningMethodRSA{"RS384", crypto.SHA384} - RegisterSigningMethod(SigningMethodRS384.Alg(), func() SigningMethod { - return SigningMethodRS384 - }) - - // RS512 - SigningMethodRS512 = &SigningMethodRSA{"RS512", crypto.SHA512} - RegisterSigningMethod(SigningMethodRS512.Alg(), func() SigningMethod { - return SigningMethodRS512 - }) -} - -func (m *SigningMethodRSA) Alg() string { - return m.Name -} - -// Implements the Verify method from SigningMethod -// For this signing method, must be an *rsa.PublicKey structure. -func (m *SigningMethodRSA) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - var rsaKey *rsa.PublicKey - var ok bool - - if rsaKey, ok = key.(*rsa.PublicKey); !ok { - return ErrInvalidKeyType - } - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Verify the signature - return rsa.VerifyPKCS1v15(rsaKey, m.Hash, hasher.Sum(nil), sig) -} - -// Implements the Sign method from SigningMethod -// For this signing method, must be an *rsa.PrivateKey structure. -func (m *SigningMethodRSA) Sign(signingString string, key interface{}) (string, error) { - var rsaKey *rsa.PrivateKey - var ok bool - - // Validate type of key - if rsaKey, ok = key.(*rsa.PrivateKey); !ok { - return "", ErrInvalidKey - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return the encoded bytes - if sigBytes, err := rsa.SignPKCS1v15(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil)); err == nil { - return EncodeSegment(sigBytes), nil - } else { - return "", err - } -} diff --git a/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go b/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go deleted file mode 100644 index 10ee9db8..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/rsa_pss.go +++ /dev/null @@ -1,126 +0,0 @@ -// +build go1.4 - -package jwt - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" -) - -// Implements the RSAPSS family of signing methods signing methods -type SigningMethodRSAPSS struct { - *SigningMethodRSA - Options *rsa.PSSOptions -} - -// Specific instances for RS/PS and company -var ( - SigningMethodPS256 *SigningMethodRSAPSS - SigningMethodPS384 *SigningMethodRSAPSS - SigningMethodPS512 *SigningMethodRSAPSS -) - -func init() { - // PS256 - SigningMethodPS256 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS256", - Hash: crypto.SHA256, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA256, - }, - } - RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod { - return SigningMethodPS256 - }) - - // PS384 - SigningMethodPS384 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS384", - Hash: crypto.SHA384, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA384, - }, - } - RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod { - return SigningMethodPS384 - }) - - // PS512 - SigningMethodPS512 = &SigningMethodRSAPSS{ - &SigningMethodRSA{ - Name: "PS512", - Hash: crypto.SHA512, - }, - &rsa.PSSOptions{ - SaltLength: rsa.PSSSaltLengthAuto, - Hash: crypto.SHA512, - }, - } - RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod { - return SigningMethodPS512 - }) -} - -// Implements the Verify method from SigningMethod -// For this verify method, key must be an rsa.PublicKey struct -func (m *SigningMethodRSAPSS) Verify(signingString, signature string, key interface{}) error { - var err error - - // Decode the signature - var sig []byte - if sig, err = DecodeSegment(signature); err != nil { - return err - } - - var rsaKey *rsa.PublicKey - switch k := key.(type) { - case *rsa.PublicKey: - rsaKey = k - default: - return ErrInvalidKey - } - - // Create hasher - if !m.Hash.Available() { - return ErrHashUnavailable - } - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, m.Options) -} - -// Implements the Sign method from SigningMethod -// For this signing method, key must be an rsa.PrivateKey struct -func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) (string, error) { - var rsaKey *rsa.PrivateKey - - switch k := key.(type) { - case *rsa.PrivateKey: - rsaKey = k - default: - return "", ErrInvalidKeyType - } - - // Create the hasher - if !m.Hash.Available() { - return "", ErrHashUnavailable - } - - hasher := m.Hash.New() - hasher.Write([]byte(signingString)) - - // Sign the string and return the encoded bytes - if sigBytes, err := rsa.SignPSS(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil), m.Options); err == nil { - return EncodeSegment(sigBytes), nil - } else { - return "", err - } -} diff --git a/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go b/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go deleted file mode 100644 index a5ababf9..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/rsa_utils.go +++ /dev/null @@ -1,101 +0,0 @@ -package jwt - -import ( - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "errors" -) - -var ( - ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key") - ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key") - ErrNotRSAPublicKey = errors.New("Key is not a valid RSA public key") -) - -// Parse PEM encoded PKCS1 or PKCS8 private key -func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - var parsedKey interface{} - if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil { - if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { - return nil, err - } - } - - var pkey *rsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { - return nil, ErrNotRSAPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 private key protected with password -func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - var parsedKey interface{} - - var blockDecrypted []byte - if blockDecrypted, err = x509.DecryptPEMBlock(block, []byte(password)); err != nil { - return nil, err - } - - if parsedKey, err = x509.ParsePKCS1PrivateKey(blockDecrypted); err != nil { - if parsedKey, err = x509.ParsePKCS8PrivateKey(blockDecrypted); err != nil { - return nil, err - } - } - - var pkey *rsa.PrivateKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { - return nil, ErrNotRSAPrivateKey - } - - return pkey, nil -} - -// Parse PEM encoded PKCS1 or PKCS8 public key -func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) { - var err error - - // Parse PEM block - var block *pem.Block - if block, _ = pem.Decode(key); block == nil { - return nil, ErrKeyMustBePEMEncoded - } - - // Parse the key - var parsedKey interface{} - if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { - if cert, err := x509.ParseCertificate(block.Bytes); err == nil { - parsedKey = cert.PublicKey - } else { - return nil, err - } - } - - var pkey *rsa.PublicKey - var ok bool - if pkey, ok = parsedKey.(*rsa.PublicKey); !ok { - return nil, ErrNotRSAPublicKey - } - - return pkey, nil -} diff --git a/vendor/github.com/dgrijalva/jwt-go/signing_method.go b/vendor/github.com/dgrijalva/jwt-go/signing_method.go deleted file mode 100644 index ed1f212b..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/signing_method.go +++ /dev/null @@ -1,35 +0,0 @@ -package jwt - -import ( - "sync" -) - -var signingMethods = map[string]func() SigningMethod{} -var signingMethodLock = new(sync.RWMutex) - -// Implement SigningMethod to add new methods for signing or verifying tokens. -type SigningMethod interface { - Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid - Sign(signingString string, key interface{}) (string, error) // Returns encoded signature or error - Alg() string // returns the alg identifier for this method (example: 'HS256') -} - -// Register the "alg" name and a factory function for signing method. -// This is typically done during init() in the method's implementation -func RegisterSigningMethod(alg string, f func() SigningMethod) { - signingMethodLock.Lock() - defer signingMethodLock.Unlock() - - signingMethods[alg] = f -} - -// Get a signing method from an "alg" string -func GetSigningMethod(alg string) (method SigningMethod) { - signingMethodLock.RLock() - defer signingMethodLock.RUnlock() - - if methodF, ok := signingMethods[alg]; ok { - method = methodF() - } - return -} diff --git a/vendor/github.com/dgrijalva/jwt-go/token.go b/vendor/github.com/dgrijalva/jwt-go/token.go deleted file mode 100644 index d637e086..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/token.go +++ /dev/null @@ -1,108 +0,0 @@ -package jwt - -import ( - "encoding/base64" - "encoding/json" - "strings" - "time" -) - -// TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time). -// You can override it to use another time value. This is useful for testing or if your -// server uses a different time zone than your tokens. -var TimeFunc = time.Now - -// Parse methods use this callback function to supply -// the key for verification. The function receives the parsed, -// but unverified Token. This allows you to use properties in the -// Header of the token (such as `kid`) to identify which key to use. -type Keyfunc func(*Token) (interface{}, error) - -// A JWT Token. Different fields will be used depending on whether you're -// creating or parsing/verifying a token. -type Token struct { - Raw string // The raw token. Populated when you Parse a token - Method SigningMethod // The signing method used or to be used - Header map[string]interface{} // The first segment of the token - Claims Claims // The second segment of the token - Signature string // The third segment of the token. Populated when you Parse a token - Valid bool // Is the token valid? Populated when you Parse/Verify a token -} - -// Create a new Token. Takes a signing method -func New(method SigningMethod) *Token { - return NewWithClaims(method, MapClaims{}) -} - -func NewWithClaims(method SigningMethod, claims Claims) *Token { - return &Token{ - Header: map[string]interface{}{ - "typ": "JWT", - "alg": method.Alg(), - }, - Claims: claims, - Method: method, - } -} - -// Get the complete, signed token -func (t *Token) SignedString(key interface{}) (string, error) { - var sig, sstr string - var err error - if sstr, err = t.SigningString(); err != nil { - return "", err - } - if sig, err = t.Method.Sign(sstr, key); err != nil { - return "", err - } - return strings.Join([]string{sstr, sig}, "."), nil -} - -// Generate the signing string. This is the -// most expensive part of the whole deal. Unless you -// need this for something special, just go straight for -// the SignedString. -func (t *Token) SigningString() (string, error) { - var err error - parts := make([]string, 2) - for i, _ := range parts { - var jsonValue []byte - if i == 0 { - if jsonValue, err = json.Marshal(t.Header); err != nil { - return "", err - } - } else { - if jsonValue, err = json.Marshal(t.Claims); err != nil { - return "", err - } - } - - parts[i] = EncodeSegment(jsonValue) - } - return strings.Join(parts, "."), nil -} - -// Parse, validate, and return a token. -// keyFunc will receive the parsed token and should return the key for validating. -// If everything is kosher, err will be nil -func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { - return new(Parser).Parse(tokenString, keyFunc) -} - -func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { - return new(Parser).ParseWithClaims(tokenString, claims, keyFunc) -} - -// Encode JWT specific base64url encoding with padding stripped -func EncodeSegment(seg []byte) string { - return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=") -} - -// Decode JWT specific base64url encoding with padding stripped -func DecodeSegment(seg string) ([]byte, error) { - if l := len(seg) % 4; l > 0 { - seg += strings.Repeat("=", 4-l) - } - - return base64.URLEncoding.DecodeString(seg) -} diff --git a/vendor/github.com/digitalocean/godo/.gitignore b/vendor/github.com/digitalocean/godo/.gitignore deleted file mode 100644 index 48b8bf90..00000000 --- a/vendor/github.com/digitalocean/godo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor/ diff --git a/vendor/github.com/digitalocean/godo/.travis.yml b/vendor/github.com/digitalocean/godo/.travis.yml deleted file mode 100644 index 20997870..00000000 --- a/vendor/github.com/digitalocean/godo/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -matrix: - allow_failures: - - go: tip diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md deleted file mode 100644 index 50830055..00000000 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ /dev/null @@ -1,209 +0,0 @@ -# Change Log - -## unreleased - -## [v1.29.0] - 2019-12-13 - -- #288 Add Balance Get method - @rbutler -- #286,#289 Deserialize meta field - @timoreimann - -## [v1.28.0] - 2019-12-04 - -- #282 Add valid Redis eviction policy constants - @bentranter -- #281 Remove databases info from top-level godoc string - @bentranter -- #280 Fix VolumeSnapshotResourceType value volumesnapshot -> volume_snapshot - @aqche - -## [v1.27.0] - 2019-11-18 - -- #278 add mysql user auth settings for database users - @gregmankes - -## [v1.26.0] - 2019-11-13 - -- #272 dbaas: get and set mysql sql mode - @mikejholly - -## [v1.25.0] - 2019-11-13 - -- #275 registry/docker-credentials: add support for the read/write parameter - @kamaln7 -- #273 implement the registry/docker-credentials endpoint - @kamaln7 -- #271 Add registry resource - @snormore - -## [v1.24.1] - 2019-11-04 - -- #264 Update isLast to check p.Next - @aqche - -## [v1.24.0] - 2019-10-30 - -- #267 Return []DatabaseFirewallRule in addition to raw response. - @andrewsomething - -## [v1.23.1] - 2019-10-30 - -- #265 add support for getting/setting firewall rules - @gregmankes -- #262 remove ResolveReference call - @mdanzinger -- #261 Update CONTRIBUTING.md - @mdanzinger - -## [v1.22.0] - 2019-09-24 - -- #259 Add Kubernetes GetCredentials method - @snormore - -## [v1.21.1] - 2019-09-19 - -- #257 Upgrade to Go 1.13 - @bentranter - -## [v1.21.0] - 2019-09-16 - -- #255 Add DropletID to Kubernetes Node instance - @snormore -- #254 Add tags to Database, DatabaseReplica - @Zyqsempai - -## [v1.20.0] - 2019-09-06 - -- #252 Add Kubernetes autoscale config fields - @snormore -- #251 Support unset fields on Kubernetes cluster and node pool updates - @snormore -- #250 Add Kubernetes GetUser method - @snormore - -## [v1.19.0] - 2019-07-19 - -- #244 dbaas: add private-network-uuid field to create request - -## [v1.18.0] - 2019-07-17 - -- #241 Databases: support for custom VPC UUID on migrate @mikejholly -- #240 Add the ability to get URN for a Database @stack72 -- #236 Fix omitempty typos in JSON struct tags @amccarthy1 - -## [v1.17.0] - 2019-06-21 - -- #238 Add support for Redis eviction policy in Databases @mikejholly - -## [v1.16.0] - 2019-06-04 - -- #233 Add Kubernetes DeleteNode method, deprecate RecycleNodePoolNodes @bouk - -## [v1.15.0] - 2019-05-13 - -- #231 Add private connection fields to Databases - @mikejholly -- #223 Introduce Go modules - @andreiavrammsd - -## [v1.14.0] - 2019-05-13 - -- #229 Add support for upgrading Kubernetes clusters - @adamwg - -## [v1.13.0] - 2019-04-19 - -- #213 Add tagging support for volume snapshots - @jcodybaker - -## [v1.12.0] - 2019-04-18 - -- #224 Add maintenance window support for Kubernetes- @fatih - -## [v1.11.1] - 2019-04-04 - -- #222 Fix Create Database Pools json fields - @sunny-b - -## [v1.11.0] - 2019-04-03 - -- #220 roll out vpc functionality - @jheimann - -## [v1.10.1] - 2019-03-27 - -- #219 Fix Database Pools json field - @sunny-b - -## [v1.10.0] - 2019-03-20 - -- #215 Add support for Databases - @mikejholly - -## [v1.9.0] - 2019-03-18 - -- #214 add support for enable_proxy_protocol. - @mregmi - -## [v1.8.0] - 2019-03-13 - -- #210 Expose tags on storage volume create/list/get. - @jcodybaker - -## [v1.7.5] - 2019-03-04 - -- #207 Add support for custom subdomains for Spaces CDN [beta] - @xornivore - -## [v1.7.4] - 2019-02-08 - -- #202 Allow tagging volumes - @mchitten - -## [v1.7.3] - 2018-12-18 - -- #196 Expose tag support for creating Load Balancers. - -## [v1.7.2] - 2018-12-04 - -- #192 Exposes more options for Kubernetes clusters. - -## [v1.7.1] - 2018-11-27 - -- #190 Expose constants for the state of Kubernetes clusters. - -## [v1.7.0] - 2018-11-13 - -- #188 Kubernetes support [beta] - @aybabtme - -## [v1.6.0] - 2018-10-16 - -- #185 Projects support [beta] - @mchitten - -## [v1.5.0] - 2018-10-01 - -- #181 Adding tagging images support - @hugocorbucci - -## [v1.4.2] - 2018-08-30 - -- #178 Allowing creating domain records with weight of 0 - @TFaga -- #177 Adding `VolumeLimit` to account - @lxfontes - -## [v1.4.1] - 2018-08-23 - -- #176 Fix cdn flush cache API endpoint - @sunny-b - -## [v1.4.0] - 2018-08-22 - -- #175 Add support for Spaces CDN - @sunny-b - -## [v1.3.0] - 2018-05-24 - -- #170 Add support for volume formatting - @adamwg - -## [v1.2.0] - 2018-05-08 - -- #166 Remove support for Go 1.6 - @iheanyi -- #165 Add support for Let's Encrypt Certificates - @viola - -## [v1.1.3] - 2018-03-07 - -- #156 Handle non-json errors from the API - @aknuds1 -- #158 Update droplet example to use latest instance type - @dan-v - -## [v1.1.2] - 2018-03-06 - -- #157 storage: list volumes should handle only name or only region params - @andrewsykim -- #154 docs: replace first example with fully-runnable example - @xmudrii -- #152 Handle flags & tag properties of domain record - @jaymecd - -## [v1.1.1] - 2017-09-29 - -- #151 Following user agent field recommendations - @joonas -- #148 AsRequest method to create load balancers requests - @lukegb - -## [v1.1.0] - 2017-06-06 - -### Added -- #145 Add FirewallsService for managing Firewalls with the DigitalOcean API. - @viola -- #139 Add TTL field to the Domains. - @xmudrii - -### Fixed -- #143 Fix oauth2.NoContext depreciation. - @jbowens -- #141 Fix DropletActions on tagged resources. - @xmudrii - -## [v1.0.0] - 2017-03-10 - -### Added -- #130 Add Convert to ImageActionsService. - @xmudrii -- #126 Add CertificatesService for managing certificates with the DigitalOcean API. - @viola -- #125 Add LoadBalancersService for managing load balancers with the DigitalOcean API. - @viola -- #122 Add GetVolumeByName to StorageService. - @protochron -- #113 Add context.Context to all calls. - @aybabtme diff --git a/vendor/github.com/digitalocean/godo/CONTRIBUTING.md b/vendor/github.com/digitalocean/godo/CONTRIBUTING.md deleted file mode 100644 index 43de4fad..00000000 --- a/vendor/github.com/digitalocean/godo/CONTRIBUTING.md +++ /dev/null @@ -1,54 +0,0 @@ -# Contributing - -If you submit a pull request, please keep the following guidelines in mind: - -1. Code should be `go fmt` compliant. -2. Types, structs and funcs should be documented. -3. Tests pass. - -## Getting set up - -Assuming your `$GOPATH` is set up according to your desires, run: - -```sh -go get github.com/digitalocean/godo -go get -u github.com/stretchr/testify/assert -``` - -If outside `$GOPATH`, just clone the repository: - -```sh -git clone https://github.com/digitalocean/godo -``` - -## Running tests - -When working on code in this repository, tests can be run via: - -```sh -go test . -``` - -## Versioning - -Godo follows [semver](https://www.semver.org) versioning semantics. New functionality should be accompanied by increment to the minor version number. The current strategy is to release often. Any code which is complete, tested, reviewed, and merged to master is worthy of release. - -## Releasing - -Releasing a new version of godo is currently a manual process. - -1. Update the `CHANGELOG.md` with your changes. If a version header for the next (unreleased) version does not exist, create one. Include one bullet point for each piece of new functionality in the release, including the pull request ID, description, and author(s). - -``` -## [v1.8.0] - 2019-03-13 - -- #210 Expose tags on storage volume create/list/get. - @jcodybaker -- #123 Update test dependencies - @digitalocean -``` - -2. Update the `libraryVersion` number in `godo.go`. -3. Make a pull request with these changes. This PR should be separate from the PR containing the godo changes. -4. Once the pull request has been merged, [draft a new release](https://github.com/digitalocean/godo/releases/new). -5. Update the `Tag version` and `Release title` field with the new godo version. Be sure the version has a `v` prefixed in both places. Ex `v1.8.0`. -6. Copy the changelog bullet points to the description field. -7. Publish the release. diff --git a/vendor/github.com/digitalocean/godo/LICENSE.txt b/vendor/github.com/digitalocean/godo/LICENSE.txt deleted file mode 100644 index 43c5d2ee..00000000 --- a/vendor/github.com/digitalocean/godo/LICENSE.txt +++ /dev/null @@ -1,55 +0,0 @@ -Copyright (c) 2014-2016 The godo AUTHORS. All rights reserved. - -MIT License - -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. - -====================== -Portions of the client are based on code at: -https://github.com/google/go-github/ - -Copyright (c) 2013 The go-github AUTHORS. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/digitalocean/godo/README.md b/vendor/github.com/digitalocean/godo/README.md deleted file mode 100644 index b52a5439..00000000 --- a/vendor/github.com/digitalocean/godo/README.md +++ /dev/null @@ -1,159 +0,0 @@ -# Godo - -[![Build Status](https://travis-ci.org/digitalocean/godo.svg)](https://travis-ci.org/digitalocean/godo) -[![GoDoc](https://godoc.org/github.com/digitalocean/godo?status.svg)](https://godoc.org/github.com/digitalocean/godo) - -Godo is a Go client library for accessing the DigitalOcean V2 API. - -You can view the client API docs here: [http://godoc.org/github.com/digitalocean/godo](http://godoc.org/github.com/digitalocean/godo) - -You can view DigitalOcean API docs here: [https://developers.digitalocean.com/documentation/v2/](https://developers.digitalocean.com/documentation/v2/) - -## Install -```sh -go get github.com/digitalocean/godo@vX.Y.Z -``` - -where X.Y.Z is the [version](https://github.com/digitalocean/godo/releases) you need. - -or -```sh -go get github.com/digitalocean/godo -``` -for non Go modules usage or latest version. - -## Usage - -```go -import "github.com/digitalocean/godo" -``` - -Create a new DigitalOcean client, then use the exposed services to -access different parts of the DigitalOcean API. - -### Authentication - -Currently, Personal Access Token (PAT) is the only method of -authenticating with the API. You can manage your tokens -at the DigitalOcean Control Panel [Applications Page](https://cloud.digitalocean.com/settings/applications). - -You can then use your token to create a new client: - -```go -package main - -import ( - "context" - "github.com/digitalocean/godo" - "golang.org/x/oauth2" -) - -const ( - pat = "mytoken" -) - -type TokenSource struct { - AccessToken string -} - -func (t *TokenSource) Token() (*oauth2.Token, error) { - token := &oauth2.Token{ - AccessToken: t.AccessToken, - } - return token, nil -} - -func main() { - tokenSource := &TokenSource{ - AccessToken: pat, - } - - oauthClient := oauth2.NewClient(context.Background(), tokenSource) - client := godo.NewClient(oauthClient) -} -``` - -## Examples - - -To create a new Droplet: - -```go -dropletName := "super-cool-droplet" - -createRequest := &godo.DropletCreateRequest{ - Name: dropletName, - Region: "nyc3", - Size: "s-1vcpu-1gb", - Image: godo.DropletCreateImage{ - Slug: "ubuntu-14-04-x64", - }, -} - -ctx := context.TODO() - -newDroplet, _, err := client.Droplets.Create(ctx, createRequest) - -if err != nil { - fmt.Printf("Something bad happened: %s\n\n", err) - return err -} -``` - -### Pagination - -If a list of items is paginated by the API, you must request pages individually. For example, to fetch all Droplets: - -```go -func DropletList(ctx context.Context, client *godo.Client) ([]godo.Droplet, error) { - // create a list to hold our droplets - list := []godo.Droplet{} - - // create options. initially, these will be blank - opt := &godo.ListOptions{} - for { - droplets, resp, err := client.Droplets.List(ctx, opt) - if err != nil { - return nil, err - } - - // append the current page's droplets to our list - for _, d := range droplets { - list = append(list, d) - } - - // if we are at the last page, break out the for loop - if resp.Links == nil || resp.Links.IsLastPage() { - break - } - - page, err := resp.Links.CurrentPage() - if err != nil { - return nil, err - } - - // set the page we want for the next request - opt.Page = page + 1 - } - - return list, nil -} -``` - -## Versioning - -Each version of the client is tagged and the version is updated accordingly. - -To see the list of past versions, run `git tag`. - - -## Documentation - -For a comprehensive list of examples, check out the [API documentation](https://developers.digitalocean.com/documentation/v2/). - -For details on all the functionality in this library, see the [GoDoc](http://godoc.org/github.com/digitalocean/godo) documentation. - - -## Contributing - -We love pull requests! Please see the [contribution guidelines](CONTRIBUTING.md). diff --git a/vendor/github.com/digitalocean/godo/account.go b/vendor/github.com/digitalocean/godo/account.go deleted file mode 100644 index 7d3e105d..00000000 --- a/vendor/github.com/digitalocean/godo/account.go +++ /dev/null @@ -1,60 +0,0 @@ -package godo - -import ( - "context" - "net/http" -) - -// AccountService is an interface for interfacing with the Account -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2/#account -type AccountService interface { - Get(context.Context) (*Account, *Response, error) -} - -// AccountServiceOp handles communication with the Account related methods of -// the DigitalOcean API. -type AccountServiceOp struct { - client *Client -} - -var _ AccountService = &AccountServiceOp{} - -// Account represents a DigitalOcean Account -type Account struct { - DropletLimit int `json:"droplet_limit,omitempty"` - FloatingIPLimit int `json:"floating_ip_limit,omitempty"` - VolumeLimit int `json:"volume_limit,omitempty"` - Email string `json:"email,omitempty"` - UUID string `json:"uuid,omitempty"` - EmailVerified bool `json:"email_verified,omitempty"` - Status string `json:"status,omitempty"` - StatusMessage string `json:"status_message,omitempty"` -} - -type accountRoot struct { - Account *Account `json:"account"` -} - -func (r Account) String() string { - return Stringify(r) -} - -// Get DigitalOcean account info -func (s *AccountServiceOp) Get(ctx context.Context) (*Account, *Response, error) { - - path := "v2/account" - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(accountRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Account, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/action.go b/vendor/github.com/digitalocean/godo/action.go deleted file mode 100644 index e3176005..00000000 --- a/vendor/github.com/digitalocean/godo/action.go +++ /dev/null @@ -1,108 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const ( - actionsBasePath = "v2/actions" - - // ActionInProgress is an in progress action status - ActionInProgress = "in-progress" - - //ActionCompleted is a completed action status - ActionCompleted = "completed" -) - -// ActionsService handles communction with action related methods of the -// DigitalOcean API: https://developers.digitalocean.com/documentation/v2#actions -type ActionsService interface { - List(context.Context, *ListOptions) ([]Action, *Response, error) - Get(context.Context, int) (*Action, *Response, error) -} - -// ActionsServiceOp handles communition with the image action related methods of the -// DigitalOcean API. -type ActionsServiceOp struct { - client *Client -} - -var _ ActionsService = &ActionsServiceOp{} - -type actionsRoot struct { - Actions []Action `json:"actions"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type actionRoot struct { - Event *Action `json:"action"` -} - -// Action represents a DigitalOcean Action -type Action struct { - ID int `json:"id"` - Status string `json:"status"` - Type string `json:"type"` - StartedAt *Timestamp `json:"started_at"` - CompletedAt *Timestamp `json:"completed_at"` - ResourceID int `json:"resource_id"` - ResourceType string `json:"resource_type"` - Region *Region `json:"region,omitempty"` - RegionSlug string `json:"region_slug,omitempty"` -} - -// List all actions -func (s *ActionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Action, *Response, error) { - path := actionsBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Actions, resp, err -} - -// Get an action by ID. -func (s *ActionsServiceOp) Get(ctx context.Context, id int) (*Action, *Response, error) { - if id < 1 { - return nil, nil, NewArgError("id", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", actionsBasePath, id) - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (a Action) String() string { - return Stringify(a) -} diff --git a/vendor/github.com/digitalocean/godo/balance.go b/vendor/github.com/digitalocean/godo/balance.go deleted file mode 100644 index 4da69783..00000000 --- a/vendor/github.com/digitalocean/godo/balance.go +++ /dev/null @@ -1,52 +0,0 @@ -package godo - -import ( - "context" - "net/http" - "time" -) - -// BalanceService is an interface for interfacing with the Balance -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2/#balance -type BalanceService interface { - Get(context.Context) (*Balance, *Response, error) -} - -// BalanceServiceOp handles communication with the Balance related methods of -// the DigitalOcean API. -type BalanceServiceOp struct { - client *Client -} - -var _ BalanceService = &BalanceServiceOp{} - -// Balance represents a DigitalOcean Balance -type Balance struct { - MonthToDateBalance string `json:"month_to_date_balance"` - AccountBalance string `json:"account_balance"` - MonthToDateUsage string `json:"month_to_date_usage"` - GeneratedAt time.Time `json:"generated_at"` -} - -func (r Balance) String() string { - return Stringify(r) -} - -// Get DigitalOcean balance info -func (s *BalanceServiceOp) Get(ctx context.Context) (*Balance, *Response, error) { - path := "v2/customers/my/balance" - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(Balance) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/cdn.go b/vendor/github.com/digitalocean/godo/cdn.go deleted file mode 100644 index 4c97d117..00000000 --- a/vendor/github.com/digitalocean/godo/cdn.go +++ /dev/null @@ -1,218 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" - "time" -) - -const cdnBasePath = "v2/cdn/endpoints" - -// CDNService is an interface for managing Spaces CDN with the DigitalOcean API. -type CDNService interface { - List(context.Context, *ListOptions) ([]CDN, *Response, error) - Get(context.Context, string) (*CDN, *Response, error) - Create(context.Context, *CDNCreateRequest) (*CDN, *Response, error) - UpdateTTL(context.Context, string, *CDNUpdateTTLRequest) (*CDN, *Response, error) - UpdateCustomDomain(context.Context, string, *CDNUpdateCustomDomainRequest) (*CDN, *Response, error) - FlushCache(context.Context, string, *CDNFlushCacheRequest) (*Response, error) - Delete(context.Context, string) (*Response, error) -} - -// CDNServiceOp handles communication with the CDN related methods of the -// DigitalOcean API. -type CDNServiceOp struct { - client *Client -} - -var _ CDNService = &CDNServiceOp{} - -// CDN represents a DigitalOcean CDN -type CDN struct { - ID string `json:"id"` - Origin string `json:"origin"` - Endpoint string `json:"endpoint"` - CreatedAt time.Time `json:"created_at"` - TTL uint32 `json:"ttl"` - CertificateID string `json:"certificate_id,omitempty"` - CustomDomain string `json:"custom_domain,omitempty"` -} - -// CDNRoot represents a response from the DigitalOcean API -type cdnRoot struct { - Endpoint *CDN `json:"endpoint"` -} - -type cdnsRoot struct { - Endpoints []CDN `json:"endpoints"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// CDNCreateRequest represents a request to create a CDN. -type CDNCreateRequest struct { - Origin string `json:"origin"` - TTL uint32 `json:"ttl"` - CustomDomain string `json:"custom_domain,omitempty"` - CertificateID string `json:"certificate_id,omitempty"` -} - -// CDNUpdateTTLRequest represents a request to update the ttl of a CDN. -type CDNUpdateTTLRequest struct { - TTL uint32 `json:"ttl"` -} - -// CDNUpdateCustomDomainRequest represents a request to update the custom domain of a CDN. -type CDNUpdateCustomDomainRequest struct { - CustomDomain string `json:"custom_domain"` - CertificateID string `json:"certificate_id"` -} - -// CDNFlushCacheRequest represents a request to flush cache of a CDN. -type CDNFlushCacheRequest struct { - Files []string `json:"files"` -} - -// List all CDN endpoints -func (c CDNServiceOp) List(ctx context.Context, opt *ListOptions) ([]CDN, *Response, error) { - path, err := addOptions(cdnBasePath, opt) - if err != nil { - return nil, nil, err - } - - req, err := c.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(cdnsRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Endpoints, resp, err -} - -// Get individual CDN. It requires a non-empty cdn id. -func (c CDNServiceOp) Get(ctx context.Context, id string) (*CDN, *Response, error) { - if len(id) == 0 { - return nil, nil, NewArgError("id", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s", cdnBasePath, id) - - req, err := c.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(cdnRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Endpoint, resp, err -} - -// Create a new CDN -func (c CDNServiceOp) Create(ctx context.Context, createRequest *CDNCreateRequest) (*CDN, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - req, err := c.client.NewRequest(ctx, http.MethodPost, cdnBasePath, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(cdnRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Endpoint, resp, err -} - -// UpdateTTL updates the ttl of an individual CDN -func (c CDNServiceOp) UpdateTTL(ctx context.Context, id string, updateRequest *CDNUpdateTTLRequest) (*CDN, *Response, error) { - return c.update(ctx, id, updateRequest) -} - -// UpdateCustomDomain sets or removes the custom domain of an individual CDN -func (c CDNServiceOp) UpdateCustomDomain(ctx context.Context, id string, updateRequest *CDNUpdateCustomDomainRequest) (*CDN, *Response, error) { - return c.update(ctx, id, updateRequest) -} - -func (c CDNServiceOp) update(ctx context.Context, id string, updateRequest interface{}) (*CDN, *Response, error) { - if updateRequest == nil { - return nil, nil, NewArgError("updateRequest", "cannot be nil") - } - - if len(id) == 0 { - return nil, nil, NewArgError("id", "cannot be an empty string") - } - path := fmt.Sprintf("%s/%s", cdnBasePath, id) - - req, err := c.client.NewRequest(ctx, http.MethodPut, path, updateRequest) - if err != nil { - return nil, nil, err - } - - root := new(cdnRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Endpoint, resp, err -} - -// FlushCache flushes the cache of an individual CDN. Requires a non-empty slice of file paths and/or wildcards -func (c CDNServiceOp) FlushCache(ctx context.Context, id string, flushCacheRequest *CDNFlushCacheRequest) (*Response, error) { - if flushCacheRequest == nil { - return nil, NewArgError("flushCacheRequest", "cannot be nil") - } - - if len(id) == 0 { - return nil, NewArgError("id", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s/cache", cdnBasePath, id) - - req, err := c.client.NewRequest(ctx, http.MethodDelete, path, flushCacheRequest) - if err != nil { - return nil, err - } - - resp, err := c.client.Do(ctx, req, nil) - - return resp, err -} - -// Delete an individual CDN -func (c CDNServiceOp) Delete(ctx context.Context, id string) (*Response, error) { - if len(id) == 0 { - return nil, NewArgError("id", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s", cdnBasePath, id) - - req, err := c.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := c.client.Do(ctx, req, nil) - - return resp, err -} diff --git a/vendor/github.com/digitalocean/godo/certificates.go b/vendor/github.com/digitalocean/godo/certificates.go deleted file mode 100644 index 9a6bdb2d..00000000 --- a/vendor/github.com/digitalocean/godo/certificates.go +++ /dev/null @@ -1,130 +0,0 @@ -package godo - -import ( - "context" - "net/http" - "path" -) - -const certificatesBasePath = "/v2/certificates" - -// CertificatesService is an interface for managing certificates with the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2/#certificates -type CertificatesService interface { - Get(context.Context, string) (*Certificate, *Response, error) - List(context.Context, *ListOptions) ([]Certificate, *Response, error) - Create(context.Context, *CertificateRequest) (*Certificate, *Response, error) - Delete(context.Context, string) (*Response, error) -} - -// Certificate represents a DigitalOcean certificate configuration. -type Certificate struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - DNSNames []string `json:"dns_names,omitempty"` - NotAfter string `json:"not_after,omitempty"` - SHA1Fingerprint string `json:"sha1_fingerprint,omitempty"` - Created string `json:"created_at,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` -} - -// CertificateRequest represents configuration for a new certificate. -type CertificateRequest struct { - Name string `json:"name,omitempty"` - DNSNames []string `json:"dns_names,omitempty"` - PrivateKey string `json:"private_key,omitempty"` - LeafCertificate string `json:"leaf_certificate,omitempty"` - CertificateChain string `json:"certificate_chain,omitempty"` - Type string `json:"type,omitempty"` -} - -type certificateRoot struct { - Certificate *Certificate `json:"certificate"` -} - -type certificatesRoot struct { - Certificates []Certificate `json:"certificates"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// CertificatesServiceOp handles communication with certificates methods of the DigitalOcean API. -type CertificatesServiceOp struct { - client *Client -} - -var _ CertificatesService = &CertificatesServiceOp{} - -// Get an existing certificate by its identifier. -func (c *CertificatesServiceOp) Get(ctx context.Context, cID string) (*Certificate, *Response, error) { - urlStr := path.Join(certificatesBasePath, cID) - - req, err := c.client.NewRequest(ctx, http.MethodGet, urlStr, nil) - if err != nil { - return nil, nil, err - } - - root := new(certificateRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Certificate, resp, nil -} - -// List all certificates. -func (c *CertificatesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Certificate, *Response, error) { - urlStr, err := addOptions(certificatesBasePath, opt) - if err != nil { - return nil, nil, err - } - - req, err := c.client.NewRequest(ctx, http.MethodGet, urlStr, nil) - if err != nil { - return nil, nil, err - } - - root := new(certificatesRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Certificates, resp, nil -} - -// Create a new certificate with provided configuration. -func (c *CertificatesServiceOp) Create(ctx context.Context, cr *CertificateRequest) (*Certificate, *Response, error) { - req, err := c.client.NewRequest(ctx, http.MethodPost, certificatesBasePath, cr) - if err != nil { - return nil, nil, err - } - - root := new(certificateRoot) - resp, err := c.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Certificate, resp, nil -} - -// Delete a certificate by its identifier. -func (c *CertificatesServiceOp) Delete(ctx context.Context, cID string) (*Response, error) { - urlStr := path.Join(certificatesBasePath, cID) - - req, err := c.client.NewRequest(ctx, http.MethodDelete, urlStr, nil) - if err != nil { - return nil, err - } - - return c.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/digitalocean/godo/databases.go b/vendor/github.com/digitalocean/godo/databases.go deleted file mode 100644 index 47ba9620..00000000 --- a/vendor/github.com/digitalocean/godo/databases.go +++ /dev/null @@ -1,824 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" - "strings" - "time" -) - -const ( - databaseBasePath = "/v2/databases" - databaseSinglePath = databaseBasePath + "/%s" - databaseResizePath = databaseBasePath + "/%s/resize" - databaseMigratePath = databaseBasePath + "/%s/migrate" - databaseMaintenancePath = databaseBasePath + "/%s/maintenance" - databaseBackupsPath = databaseBasePath + "/%s/backups" - databaseUsersPath = databaseBasePath + "/%s/users" - databaseUserPath = databaseBasePath + "/%s/users/%s" - databaseDBPath = databaseBasePath + "/%s/dbs/%s" - databaseDBsPath = databaseBasePath + "/%s/dbs" - databasePoolPath = databaseBasePath + "/%s/pools/%s" - databasePoolsPath = databaseBasePath + "/%s/pools" - databaseReplicaPath = databaseBasePath + "/%s/replicas/%s" - databaseReplicasPath = databaseBasePath + "/%s/replicas" - databaseEvictionPolicyPath = databaseBasePath + "/%s/eviction_policy" - databaseSQLModePath = databaseBasePath + "/%s/sql_mode" - databaseFirewallRulesPath = databaseBasePath + "/%s/firewall" -) - -// SQL Mode constants allow for MySQL-specific SQL flavor configuration. -const ( - SQLModeAllowInvalidDates = "ALLOW_INVALID_DATES" - SQLModeANSIQuotes = "ANSI_QUOTES" - SQLModeHighNotPrecedence = "HIGH_NOT_PRECEDENCE" - SQLModeIgnoreSpace = "IGNORE_SPACE" - SQLModeNoAuthCreateUser = "NO_AUTO_CREATE_USER" - SQLModeNoAutoValueOnZero = "NO_AUTO_VALUE_ON_ZERO" - SQLModeNoBackslashEscapes = "NO_BACKSLASH_ESCAPES" - SQLModeNoDirInCreate = "NO_DIR_IN_CREATE" - SQLModeNoEngineSubstitution = "NO_ENGINE_SUBSTITUTION" - SQLModeNoFieldOptions = "NO_FIELD_OPTIONS" - SQLModeNoKeyOptions = "NO_KEY_OPTIONS" - SQLModeNoTableOptions = "NO_TABLE_OPTIONS" - SQLModeNoUnsignedSubtraction = "NO_UNSIGNED_SUBTRACTION" - SQLModeNoZeroDate = "NO_ZERO_DATE" - SQLModeNoZeroInDate = "NO_ZERO_IN_DATE" - SQLModeOnlyFullGroupBy = "ONLY_FULL_GROUP_BY" - SQLModePadCharToFullLength = "PAD_CHAR_TO_FULL_LENGTH" - SQLModePipesAsConcat = "PIPES_AS_CONCAT" - SQLModeRealAsFloat = "REAL_AS_FLOAT" - SQLModeStrictAllTables = "STRICT_ALL_TABLES" - SQLModeStrictTransTables = "STRICT_TRANS_TABLES" - SQLModeANSI = "ANSI" - SQLModeDB2 = "DB2" - SQLModeMaxDB = "MAXDB" - SQLModeMSSQL = "MSSQL" - SQLModeMYSQL323 = "MYSQL323" - SQLModeMYSQL40 = "MYSQL40" - SQLModeOracle = "ORACLE" - SQLModePostgreSQL = "POSTGRESQL" - SQLModeTraditional = "TRADITIONAL" -) - -// SQL Auth constants allow for MySQL-specific user auth plugins -const ( - SQLAuthPluginNative = "mysql_native_password" - SQLAuthPluginCachingSHA2 = "caching_sha2_password" -) - -// Redis eviction policies supported by the managed Redis product. -const ( - EvictionPolicyNoEviction = "noeviction" - EvictionPolicyAllKeysLRU = "allkeys_lru" - EvictionPolicyAllKeysRandom = "allkeys_random" - EvictionPolicyVolatileLRU = "volatile_lru" - EvictionPolicyVolatileRandom = "volatile_random" - EvictionPolicyVolatileTTL = "volatile_ttl" -) - -// The DatabasesService provides access to the DigitalOcean managed database -// suite of products through the public API. Customers can create new database -// clusters, migrate them between regions, create replicas and interact with -// their configurations. Each database service is refered to as a Database. A -// SQL database service can have multiple databases residing in the system. To -// help make these entities distinct from Databases in godo, we refer to them -// here as DatabaseDBs. -// -// See: https://developers.digitalocean.com/documentation/v2#databases -type DatabasesService interface { - List(context.Context, *ListOptions) ([]Database, *Response, error) - Get(context.Context, string) (*Database, *Response, error) - Create(context.Context, *DatabaseCreateRequest) (*Database, *Response, error) - Delete(context.Context, string) (*Response, error) - Resize(context.Context, string, *DatabaseResizeRequest) (*Response, error) - Migrate(context.Context, string, *DatabaseMigrateRequest) (*Response, error) - UpdateMaintenance(context.Context, string, *DatabaseUpdateMaintenanceRequest) (*Response, error) - ListBackups(context.Context, string, *ListOptions) ([]DatabaseBackup, *Response, error) - GetUser(context.Context, string, string) (*DatabaseUser, *Response, error) - ListUsers(context.Context, string, *ListOptions) ([]DatabaseUser, *Response, error) - CreateUser(context.Context, string, *DatabaseCreateUserRequest) (*DatabaseUser, *Response, error) - DeleteUser(context.Context, string, string) (*Response, error) - ListDBs(context.Context, string, *ListOptions) ([]DatabaseDB, *Response, error) - CreateDB(context.Context, string, *DatabaseCreateDBRequest) (*DatabaseDB, *Response, error) - GetDB(context.Context, string, string) (*DatabaseDB, *Response, error) - DeleteDB(context.Context, string, string) (*Response, error) - ListPools(context.Context, string, *ListOptions) ([]DatabasePool, *Response, error) - CreatePool(context.Context, string, *DatabaseCreatePoolRequest) (*DatabasePool, *Response, error) - GetPool(context.Context, string, string) (*DatabasePool, *Response, error) - DeletePool(context.Context, string, string) (*Response, error) - GetReplica(context.Context, string, string) (*DatabaseReplica, *Response, error) - ListReplicas(context.Context, string, *ListOptions) ([]DatabaseReplica, *Response, error) - CreateReplica(context.Context, string, *DatabaseCreateReplicaRequest) (*DatabaseReplica, *Response, error) - DeleteReplica(context.Context, string, string) (*Response, error) - GetEvictionPolicy(context.Context, string) (string, *Response, error) - SetEvictionPolicy(context.Context, string, string) (*Response, error) - GetSQLMode(context.Context, string) (string, *Response, error) - SetSQLMode(context.Context, string, ...string) (*Response, error) - GetFirewallRules(context.Context, string) ([]DatabaseFirewallRule, *Response, error) - UpdateFirewallRules(context.Context, string, *DatabaseUpdateFirewallRulesRequest) (*Response, error) -} - -// DatabasesServiceOp handles communication with the Databases related methods -// of the DigitalOcean API. -type DatabasesServiceOp struct { - client *Client -} - -var _ DatabasesService = &DatabasesServiceOp{} - -// Database represents a DigitalOcean managed database product. These managed databases -// are usually comprised of a cluster of database nodes, a primary and 0 or more replicas. -// The EngineSlug is a string which indicates the type of database service. Some examples are -// "pg", "mysql" or "redis". A Database also includes connection information and other -// properties of the service like region, size and current status. -type Database struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - EngineSlug string `json:"engine,omitempty"` - VersionSlug string `json:"version,omitempty"` - Connection *DatabaseConnection `json:"connection,omitempty"` - PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"` - Users []DatabaseUser `json:"users,omitempty"` - NumNodes int `json:"num_nodes,omitempty"` - SizeSlug string `json:"size,omitempty"` - DBNames []string `json:"db_names,omitempty"` - RegionSlug string `json:"region,omitempty"` - Status string `json:"status,omitempty"` - MaintenanceWindow *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - PrivateNetworkUUID string `json:"private_network_uuid,omitempty"` - Tags []string `json:"tags,omitempty"` -} - -// DatabaseConnection represents a database connection -type DatabaseConnection struct { - URI string `json:"uri,omitempty"` - Database string `json:"database,omitempty"` - Host string `json:"host,omitempty"` - Port int `json:"port,omitempty"` - User string `json:"user,omitempty"` - Password string `json:"password,omitempty"` - SSL bool `json:"ssl,omitempty"` -} - -// DatabaseUser represents a user in the database -type DatabaseUser struct { - Name string `json:"name,omitempty"` - Role string `json:"role,omitempty"` - Password string `json:"password,omitempty"` - MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"` -} - -// DatabaseMySQLUserSettings contains MySQL-specific user settings -type DatabaseMySQLUserSettings struct { - AuthPlugin string `json:"auth_plugin"` -} - -// DatabaseMaintenanceWindow represents the maintenance_window of a database -// cluster -type DatabaseMaintenanceWindow struct { - Day string `json:"day,omitempty"` - Hour string `json:"hour,omitempty"` - Pending bool `json:"pending,omitempty"` - Description []string `json:"description,omitempty"` -} - -// DatabaseBackup represents a database backup. -type DatabaseBackup struct { - CreatedAt time.Time `json:"created_at,omitempty"` - SizeGigabytes float64 `json:"size_gigabytes,omitempty"` -} - -// DatabaseCreateRequest represents a request to create a database cluster -type DatabaseCreateRequest struct { - Name string `json:"name,omitempty"` - EngineSlug string `json:"engine,omitempty"` - Version string `json:"version,omitempty"` - SizeSlug string `json:"size,omitempty"` - Region string `json:"region,omitempty"` - NumNodes int `json:"num_nodes,omitempty"` - PrivateNetworkUUID string `json:"private_network_uuid"` - Tags []string `json:"tags,omitempty"` -} - -// DatabaseResizeRequest can be used to initiate a database resize operation. -type DatabaseResizeRequest struct { - SizeSlug string `json:"size,omitempty"` - NumNodes int `json:"num_nodes,omitempty"` -} - -// DatabaseMigrateRequest can be used to initiate a database migrate operation. -type DatabaseMigrateRequest struct { - Region string `json:"region,omitempty"` - PrivateNetworkUUID string `json:"private_network_uuid"` -} - -// DatabaseUpdateMaintenanceRequest can be used to update the database's maintenance window. -type DatabaseUpdateMaintenanceRequest struct { - Day string `json:"day,omitempty"` - Hour string `json:"hour,omitempty"` -} - -// DatabaseDB represents an engine-specific database created within a database cluster. For SQL -// databases like PostgreSQL or MySQL, a "DB" refers to a database created on the RDBMS. For instance, -// a PostgreSQL database server can contain many database schemas, each with it's own settings, access -// permissions and data. ListDBs will return all databases present on the server. -type DatabaseDB struct { - Name string `json:"name"` -} - -// DatabaseReplica represents a read-only replica of a particular database -type DatabaseReplica struct { - Name string `json:"name"` - Connection *DatabaseConnection `json:"connection"` - PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"` - Region string `json:"region"` - Status string `json:"status"` - CreatedAt time.Time `json:"created_at"` - PrivateNetworkUUID string `json:"private_network_uuid,omitempty"` - Tags []string `json:"tags,omitempty"` -} - -// DatabasePool represents a database connection pool -type DatabasePool struct { - User string `json:"user"` - Name string `json:"name"` - Size int `json:"size"` - Database string `json:"db"` - Mode string `json:"mode"` - Connection *DatabaseConnection `json:"connection"` - PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"` -} - -// DatabaseCreatePoolRequest is used to create a new database connection pool -type DatabaseCreatePoolRequest struct { - User string `json:"user"` - Name string `json:"name"` - Size int `json:"size"` - Database string `json:"db"` - Mode string `json:"mode"` -} - -// DatabaseCreateUserRequest is used to create a new database user -type DatabaseCreateUserRequest struct { - Name string `json:"name"` - MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"` -} - -// DatabaseCreateDBRequest is used to create a new engine-specific database within the cluster -type DatabaseCreateDBRequest struct { - Name string `json:"name"` -} - -// DatabaseCreateReplicaRequest is used to create a new read-only replica -type DatabaseCreateReplicaRequest struct { - Name string `json:"name"` - Region string `json:"region"` - Size string `json:"size"` - PrivateNetworkUUID string `json:"private_network_uuid"` - Tags []string `json:"tags,omitempty"` -} - -// DatabaseUpdateFirewallRulesRequest is used to set the firewall rules for a database -type DatabaseUpdateFirewallRulesRequest struct { - Rules []*DatabaseFirewallRule `json:"rules"` -} - -// DatabaseFirewallRule is a rule describing an inbound source to a database -type DatabaseFirewallRule struct { - UUID string `json:"uuid"` - ClusterUUID string `json:"cluster_uuid"` - Type string `json:"type"` - Value string `json:"value"` - CreatedAt time.Time `json:"created_at"` -} - -type databaseUserRoot struct { - User *DatabaseUser `json:"user"` -} - -type databaseUsersRoot struct { - Users []DatabaseUser `json:"users"` -} - -type databaseDBRoot struct { - DB *DatabaseDB `json:"db"` -} - -type databaseDBsRoot struct { - DBs []DatabaseDB `json:"dbs"` -} - -type databasesRoot struct { - Databases []Database `json:"databases"` -} - -type databaseRoot struct { - Database *Database `json:"database"` -} - -type databaseBackupsRoot struct { - Backups []DatabaseBackup `json:"backups"` -} - -type databasePoolRoot struct { - Pool *DatabasePool `json:"pool"` -} - -type databasePoolsRoot struct { - Pools []DatabasePool `json:"pools"` -} - -type databaseReplicaRoot struct { - Replica *DatabaseReplica `json:"replica"` -} - -type databaseReplicasRoot struct { - Replicas []DatabaseReplica `json:"replicas"` -} - -type evictionPolicyRoot struct { - EvictionPolicy string `json:"eviction_policy"` -} - -type sqlModeRoot struct { - SQLMode string `json:"sql_mode"` -} - -type databaseFirewallRuleRoot struct { - Rules []DatabaseFirewallRule `json:"rules"` -} - -// URN returns a URN identifier for the database -func (d Database) URN() string { - return ToURN("dbaas", d.ID) -} - -// List returns a list of the Databases visible with the caller's API token -func (svc *DatabasesServiceOp) List(ctx context.Context, opts *ListOptions) ([]Database, *Response, error) { - path := databaseBasePath - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databasesRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Databases, resp, nil -} - -// Get retrieves the details of a database cluster -func (svc *DatabasesServiceOp) Get(ctx context.Context, databaseID string) (*Database, *Response, error) { - path := fmt.Sprintf(databaseSinglePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Database, resp, nil -} - -// Create creates a database cluster -func (svc *DatabasesServiceOp) Create(ctx context.Context, create *DatabaseCreateRequest) (*Database, *Response, error) { - path := databaseBasePath - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, create) - if err != nil { - return nil, nil, err - } - root := new(databaseRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Database, resp, nil -} - -// Delete deletes a database cluster. There is no way to recover a cluster once -// it has been destroyed. -func (svc *DatabasesServiceOp) Delete(ctx context.Context, databaseID string) (*Response, error) { - path := fmt.Sprintf("%s/%s", databaseBasePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// Resize resizes a database cluster by number of nodes or size -func (svc *DatabasesServiceOp) Resize(ctx context.Context, databaseID string, resize *DatabaseResizeRequest) (*Response, error) { - path := fmt.Sprintf(databaseResizePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, resize) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// Migrate migrates a database cluster to a new region -func (svc *DatabasesServiceOp) Migrate(ctx context.Context, databaseID string, migrate *DatabaseMigrateRequest) (*Response, error) { - path := fmt.Sprintf(databaseMigratePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, migrate) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// UpdateMaintenance updates the maintenance window on a cluster -func (svc *DatabasesServiceOp) UpdateMaintenance(ctx context.Context, databaseID string, maintenance *DatabaseUpdateMaintenanceRequest) (*Response, error) { - path := fmt.Sprintf(databaseMaintenancePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, maintenance) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// ListBackups returns a list of the current backups of a database -func (svc *DatabasesServiceOp) ListBackups(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseBackup, *Response, error) { - path := fmt.Sprintf(databaseBackupsPath, databaseID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseBackupsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Backups, resp, nil -} - -// GetUser returns the database user identified by userID -func (svc *DatabasesServiceOp) GetUser(ctx context.Context, databaseID, userID string) (*DatabaseUser, *Response, error) { - path := fmt.Sprintf(databaseUserPath, databaseID, userID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseUserRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.User, resp, nil -} - -// ListUsers returns all database users for the database -func (svc *DatabasesServiceOp) ListUsers(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseUser, *Response, error) { - path := fmt.Sprintf(databaseUsersPath, databaseID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseUsersRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Users, resp, nil -} - -// CreateUser will create a new database user -func (svc *DatabasesServiceOp) CreateUser(ctx context.Context, databaseID string, createUser *DatabaseCreateUserRequest) (*DatabaseUser, *Response, error) { - path := fmt.Sprintf(databaseUsersPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createUser) - if err != nil { - return nil, nil, err - } - root := new(databaseUserRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.User, resp, nil -} - -// DeleteUser will delete an existing database user -func (svc *DatabasesServiceOp) DeleteUser(ctx context.Context, databaseID, userID string) (*Response, error) { - path := fmt.Sprintf(databaseUserPath, databaseID, userID) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// ListDBs returns all databases for a given database cluster -func (svc *DatabasesServiceOp) ListDBs(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseDB, *Response, error) { - path := fmt.Sprintf(databaseDBsPath, databaseID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseDBsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.DBs, resp, nil -} - -// GetDB returns a single database by name -func (svc *DatabasesServiceOp) GetDB(ctx context.Context, databaseID, name string) (*DatabaseDB, *Response, error) { - path := fmt.Sprintf(databaseDBPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseDBRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.DB, resp, nil -} - -// CreateDB will create a new database -func (svc *DatabasesServiceOp) CreateDB(ctx context.Context, databaseID string, createDB *DatabaseCreateDBRequest) (*DatabaseDB, *Response, error) { - path := fmt.Sprintf(databaseDBsPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createDB) - if err != nil { - return nil, nil, err - } - root := new(databaseDBRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.DB, resp, nil -} - -// DeleteDB will delete an existing database -func (svc *DatabasesServiceOp) DeleteDB(ctx context.Context, databaseID, name string) (*Response, error) { - path := fmt.Sprintf(databaseDBPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// ListPools returns all connection pools for a given database cluster -func (svc *DatabasesServiceOp) ListPools(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabasePool, *Response, error) { - path := fmt.Sprintf(databasePoolsPath, databaseID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databasePoolsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Pools, resp, nil -} - -// GetPool returns a single database connection pool by name -func (svc *DatabasesServiceOp) GetPool(ctx context.Context, databaseID, name string) (*DatabasePool, *Response, error) { - path := fmt.Sprintf(databasePoolPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databasePoolRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Pool, resp, nil -} - -// CreatePool will create a new database connection pool -func (svc *DatabasesServiceOp) CreatePool(ctx context.Context, databaseID string, createPool *DatabaseCreatePoolRequest) (*DatabasePool, *Response, error) { - path := fmt.Sprintf(databasePoolsPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createPool) - if err != nil { - return nil, nil, err - } - root := new(databasePoolRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Pool, resp, nil -} - -// DeletePool will delete an existing database connection pool -func (svc *DatabasesServiceOp) DeletePool(ctx context.Context, databaseID, name string) (*Response, error) { - path := fmt.Sprintf(databasePoolPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// GetReplica returns a single database replica -func (svc *DatabasesServiceOp) GetReplica(ctx context.Context, databaseID, name string) (*DatabaseReplica, *Response, error) { - path := fmt.Sprintf(databaseReplicaPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseReplicaRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Replica, resp, nil -} - -// ListReplicas returns all read-only replicas for a given database cluster -func (svc *DatabasesServiceOp) ListReplicas(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseReplica, *Response, error) { - path := fmt.Sprintf(databaseReplicasPath, databaseID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(databaseReplicasRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Replicas, resp, nil -} - -// CreateReplica will create a new database connection pool -func (svc *DatabasesServiceOp) CreateReplica(ctx context.Context, databaseID string, createReplica *DatabaseCreateReplicaRequest) (*DatabaseReplica, *Response, error) { - path := fmt.Sprintf(databaseReplicasPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createReplica) - if err != nil { - return nil, nil, err - } - root := new(databaseReplicaRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Replica, resp, nil -} - -// DeleteReplica will delete an existing database replica -func (svc *DatabasesServiceOp) DeleteReplica(ctx context.Context, databaseID, name string) (*Response, error) { - path := fmt.Sprintf(databaseReplicaPath, databaseID, name) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// GetEvictionPolicy loads the eviction policy for a given Redis cluster. -func (svc *DatabasesServiceOp) GetEvictionPolicy(ctx context.Context, databaseID string) (string, *Response, error) { - path := fmt.Sprintf(databaseEvictionPolicyPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return "", nil, err - } - root := new(evictionPolicyRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return "", resp, err - } - return root.EvictionPolicy, resp, nil -} - -// SetEvictionPolicy updates the eviction policy for a given Redis cluster. -// -// The valid eviction policies are documented by the exported string constants -// with the prefix `EvictionPolicy`. -func (svc *DatabasesServiceOp) SetEvictionPolicy(ctx context.Context, databaseID, policy string) (*Response, error) { - path := fmt.Sprintf(databaseEvictionPolicyPath, databaseID) - root := &evictionPolicyRoot{EvictionPolicy: policy} - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, root) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// GetSQLMode loads the SQL Mode settings for a given MySQL cluster. -func (svc *DatabasesServiceOp) GetSQLMode(ctx context.Context, databaseID string) (string, *Response, error) { - path := fmt.Sprintf(databaseSQLModePath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return "", nil, err - } - root := &sqlModeRoot{} - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return "", resp, err - } - return root.SQLMode, resp, nil -} - -// SetSQLMode updates the SQL Mode settings for a given MySQL cluster. -func (svc *DatabasesServiceOp) SetSQLMode(ctx context.Context, databaseID string, sqlModes ...string) (*Response, error) { - path := fmt.Sprintf(databaseSQLModePath, databaseID) - root := &sqlModeRoot{SQLMode: strings.Join(sqlModes, ",")} - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, root) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// GetFirewallRules loads the inbound sources for a given cluster. -func (svc *DatabasesServiceOp) GetFirewallRules(ctx context.Context, databaseID string) ([]DatabaseFirewallRule, *Response, error) { - path := fmt.Sprintf(databaseFirewallRulesPath, databaseID) - root := new(databaseFirewallRuleRoot) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Rules, resp, nil -} - -// UpdateFirewallRules sets the inbound sources for a given cluster. -func (svc *DatabasesServiceOp) UpdateFirewallRules(ctx context.Context, databaseID string, firewallRulesReq *DatabaseUpdateFirewallRulesRequest) (*Response, error) { - path := fmt.Sprintf(databaseFirewallRulesPath, databaseID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, firewallRulesReq) - if err != nil { - return nil, err - } - return svc.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/digitalocean/godo/doc.go b/vendor/github.com/digitalocean/godo/doc.go deleted file mode 100644 index ac812e97..00000000 --- a/vendor/github.com/digitalocean/godo/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package godo is the DigtalOcean API v2 client for Go. -package godo diff --git a/vendor/github.com/digitalocean/godo/domains.go b/vendor/github.com/digitalocean/godo/domains.go deleted file mode 100644 index 43c04244..00000000 --- a/vendor/github.com/digitalocean/godo/domains.go +++ /dev/null @@ -1,341 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const domainsBasePath = "v2/domains" - -// DomainsService is an interface for managing DNS with the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2#domains and -// https://developers.digitalocean.com/documentation/v2#domain-records -type DomainsService interface { - List(context.Context, *ListOptions) ([]Domain, *Response, error) - Get(context.Context, string) (*Domain, *Response, error) - Create(context.Context, *DomainCreateRequest) (*Domain, *Response, error) - Delete(context.Context, string) (*Response, error) - - Records(context.Context, string, *ListOptions) ([]DomainRecord, *Response, error) - Record(context.Context, string, int) (*DomainRecord, *Response, error) - DeleteRecord(context.Context, string, int) (*Response, error) - EditRecord(context.Context, string, int, *DomainRecordEditRequest) (*DomainRecord, *Response, error) - CreateRecord(context.Context, string, *DomainRecordEditRequest) (*DomainRecord, *Response, error) -} - -// DomainsServiceOp handles communication with the domain related methods of the -// DigitalOcean API. -type DomainsServiceOp struct { - client *Client -} - -var _ DomainsService = &DomainsServiceOp{} - -// Domain represents a DigitalOcean domain -type Domain struct { - Name string `json:"name"` - TTL int `json:"ttl"` - ZoneFile string `json:"zone_file"` -} - -// domainRoot represents a response from the DigitalOcean API -type domainRoot struct { - Domain *Domain `json:"domain"` -} - -type domainsRoot struct { - Domains []Domain `json:"domains"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// DomainCreateRequest respresents a request to create a domain. -type DomainCreateRequest struct { - Name string `json:"name"` - IPAddress string `json:"ip_address,omitempty"` -} - -// DomainRecordRoot is the root of an individual Domain Record response -type domainRecordRoot struct { - DomainRecord *DomainRecord `json:"domain_record"` -} - -// DomainRecordsRoot is the root of a group of Domain Record responses -type domainRecordsRoot struct { - DomainRecords []DomainRecord `json:"domain_records"` - Links *Links `json:"links"` -} - -// DomainRecord represents a DigitalOcean DomainRecord -type DomainRecord struct { - ID int `json:"id,float64,omitempty"` - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Data string `json:"data,omitempty"` - Priority int `json:"priority"` - Port int `json:"port,omitempty"` - TTL int `json:"ttl,omitempty"` - Weight int `json:"weight"` - Flags int `json:"flags"` - Tag string `json:"tag,omitempty"` -} - -// DomainRecordEditRequest represents a request to update a domain record. -type DomainRecordEditRequest struct { - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Data string `json:"data,omitempty"` - Priority int `json:"priority"` - Port int `json:"port,omitempty"` - TTL int `json:"ttl,omitempty"` - Weight int `json:"weight"` - Flags int `json:"flags"` - Tag string `json:"tag,omitempty"` -} - -func (d Domain) String() string { - return Stringify(d) -} - -func (d Domain) URN() string { - return ToURN("Domain", d.Name) -} - -// List all domains. -func (s DomainsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Domain, *Response, error) { - path := domainsBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(domainsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Domains, resp, err -} - -// Get individual domain. It requires a non-empty domain name. -func (s *DomainsServiceOp) Get(ctx context.Context, name string) (*Domain, *Response, error) { - if len(name) < 1 { - return nil, nil, NewArgError("name", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s", domainsBasePath, name) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(domainRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Domain, resp, err -} - -// Create a new domain -func (s *DomainsServiceOp) Create(ctx context.Context, createRequest *DomainCreateRequest) (*Domain, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - path := domainsBasePath - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(domainRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Domain, resp, err -} - -// Delete domain -func (s *DomainsServiceOp) Delete(ctx context.Context, name string) (*Response, error) { - if len(name) < 1 { - return nil, NewArgError("name", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s", domainsBasePath, name) - - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// Converts a DomainRecord to a string. -func (d DomainRecord) String() string { - return Stringify(d) -} - -// Converts a DomainRecordEditRequest to a string. -func (d DomainRecordEditRequest) String() string { - return Stringify(d) -} - -// Records returns a slice of DomainRecords for a domain -func (s *DomainsServiceOp) Records(ctx context.Context, domain string, opt *ListOptions) ([]DomainRecord, *Response, error) { - if len(domain) < 1 { - return nil, nil, NewArgError("domain", "cannot be an empty string") - } - - path := fmt.Sprintf("%s/%s/records", domainsBasePath, domain) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(domainRecordsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.DomainRecords, resp, err -} - -// Record returns the record id from a domain -func (s *DomainsServiceOp) Record(ctx context.Context, domain string, id int) (*DomainRecord, *Response, error) { - if len(domain) < 1 { - return nil, nil, NewArgError("domain", "cannot be an empty string") - } - - if id < 1 { - return nil, nil, NewArgError("id", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%s/records/%d", domainsBasePath, domain, id) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - record := new(domainRecordRoot) - resp, err := s.client.Do(ctx, req, record) - if err != nil { - return nil, resp, err - } - - return record.DomainRecord, resp, err -} - -// DeleteRecord deletes a record from a domain identified by id -func (s *DomainsServiceOp) DeleteRecord(ctx context.Context, domain string, id int) (*Response, error) { - if len(domain) < 1 { - return nil, NewArgError("domain", "cannot be an empty string") - } - - if id < 1 { - return nil, NewArgError("id", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%s/records/%d", domainsBasePath, domain, id) - - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// EditRecord edits a record using a DomainRecordEditRequest -func (s *DomainsServiceOp) EditRecord(ctx context.Context, - domain string, - id int, - editRequest *DomainRecordEditRequest, -) (*DomainRecord, *Response, error) { - if len(domain) < 1 { - return nil, nil, NewArgError("domain", "cannot be an empty string") - } - - if id < 1 { - return nil, nil, NewArgError("id", "cannot be less than 1") - } - - if editRequest == nil { - return nil, nil, NewArgError("editRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%s/records/%d", domainsBasePath, domain, id) - - req, err := s.client.NewRequest(ctx, http.MethodPut, path, editRequest) - if err != nil { - return nil, nil, err - } - - root := new(domainRecordRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.DomainRecord, resp, err -} - -// CreateRecord creates a record using a DomainRecordEditRequest -func (s *DomainsServiceOp) CreateRecord(ctx context.Context, - domain string, - createRequest *DomainRecordEditRequest) (*DomainRecord, *Response, error) { - if len(domain) < 1 { - return nil, nil, NewArgError("domain", "cannot be empty string") - } - - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%s/records", domainsBasePath, domain) - req, err := s.client.NewRequest(ctx, http.MethodPost, path, createRequest) - - if err != nil { - return nil, nil, err - } - - d := new(domainRecordRoot) - resp, err := s.client.Do(ctx, req, d) - if err != nil { - return nil, resp, err - } - - return d.DomainRecord, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/droplet_actions.go b/vendor/github.com/digitalocean/godo/droplet_actions.go deleted file mode 100644 index ddeacfc8..00000000 --- a/vendor/github.com/digitalocean/godo/droplet_actions.go +++ /dev/null @@ -1,329 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" - "net/url" -) - -// ActionRequest reprents DigitalOcean Action Request -type ActionRequest map[string]interface{} - -// DropletActionsService is an interface for interfacing with the Droplet actions -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#droplet-actions -type DropletActionsService interface { - Shutdown(context.Context, int) (*Action, *Response, error) - ShutdownByTag(context.Context, string) ([]Action, *Response, error) - PowerOff(context.Context, int) (*Action, *Response, error) - PowerOffByTag(context.Context, string) ([]Action, *Response, error) - PowerOn(context.Context, int) (*Action, *Response, error) - PowerOnByTag(context.Context, string) ([]Action, *Response, error) - PowerCycle(context.Context, int) (*Action, *Response, error) - PowerCycleByTag(context.Context, string) ([]Action, *Response, error) - Reboot(context.Context, int) (*Action, *Response, error) - Restore(context.Context, int, int) (*Action, *Response, error) - Resize(context.Context, int, string, bool) (*Action, *Response, error) - Rename(context.Context, int, string) (*Action, *Response, error) - Snapshot(context.Context, int, string) (*Action, *Response, error) - SnapshotByTag(context.Context, string, string) ([]Action, *Response, error) - EnableBackups(context.Context, int) (*Action, *Response, error) - EnableBackupsByTag(context.Context, string) ([]Action, *Response, error) - DisableBackups(context.Context, int) (*Action, *Response, error) - DisableBackupsByTag(context.Context, string) ([]Action, *Response, error) - PasswordReset(context.Context, int) (*Action, *Response, error) - RebuildByImageID(context.Context, int, int) (*Action, *Response, error) - RebuildByImageSlug(context.Context, int, string) (*Action, *Response, error) - ChangeKernel(context.Context, int, int) (*Action, *Response, error) - EnableIPv6(context.Context, int) (*Action, *Response, error) - EnableIPv6ByTag(context.Context, string) ([]Action, *Response, error) - EnablePrivateNetworking(context.Context, int) (*Action, *Response, error) - EnablePrivateNetworkingByTag(context.Context, string) ([]Action, *Response, error) - Get(context.Context, int, int) (*Action, *Response, error) - GetByURI(context.Context, string) (*Action, *Response, error) -} - -// DropletActionsServiceOp handles communication with the Droplet action related -// methods of the DigitalOcean API. -type DropletActionsServiceOp struct { - client *Client -} - -var _ DropletActionsService = &DropletActionsServiceOp{} - -// Shutdown a Droplet -func (s *DropletActionsServiceOp) Shutdown(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "shutdown"} - return s.doAction(ctx, id, request) -} - -// ShutdownByTag shuts down Droplets matched by a Tag. -func (s *DropletActionsServiceOp) ShutdownByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "shutdown"} - return s.doActionByTag(ctx, tag, request) -} - -// PowerOff a Droplet -func (s *DropletActionsServiceOp) PowerOff(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "power_off"} - return s.doAction(ctx, id, request) -} - -// PowerOffByTag powers off Droplets matched by a Tag. -func (s *DropletActionsServiceOp) PowerOffByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "power_off"} - return s.doActionByTag(ctx, tag, request) -} - -// PowerOn a Droplet -func (s *DropletActionsServiceOp) PowerOn(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "power_on"} - return s.doAction(ctx, id, request) -} - -// PowerOnByTag powers on Droplets matched by a Tag. -func (s *DropletActionsServiceOp) PowerOnByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "power_on"} - return s.doActionByTag(ctx, tag, request) -} - -// PowerCycle a Droplet -func (s *DropletActionsServiceOp) PowerCycle(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "power_cycle"} - return s.doAction(ctx, id, request) -} - -// PowerCycleByTag power cycles Droplets matched by a Tag. -func (s *DropletActionsServiceOp) PowerCycleByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "power_cycle"} - return s.doActionByTag(ctx, tag, request) -} - -// Reboot a Droplet -func (s *DropletActionsServiceOp) Reboot(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "reboot"} - return s.doAction(ctx, id, request) -} - -// Restore an image to a Droplet -func (s *DropletActionsServiceOp) Restore(ctx context.Context, id, imageID int) (*Action, *Response, error) { - requestType := "restore" - request := &ActionRequest{ - "type": requestType, - "image": float64(imageID), - } - return s.doAction(ctx, id, request) -} - -// Resize a Droplet -func (s *DropletActionsServiceOp) Resize(ctx context.Context, id int, sizeSlug string, resizeDisk bool) (*Action, *Response, error) { - requestType := "resize" - request := &ActionRequest{ - "type": requestType, - "size": sizeSlug, - "disk": resizeDisk, - } - return s.doAction(ctx, id, request) -} - -// Rename a Droplet -func (s *DropletActionsServiceOp) Rename(ctx context.Context, id int, name string) (*Action, *Response, error) { - requestType := "rename" - request := &ActionRequest{ - "type": requestType, - "name": name, - } - return s.doAction(ctx, id, request) -} - -// Snapshot a Droplet. -func (s *DropletActionsServiceOp) Snapshot(ctx context.Context, id int, name string) (*Action, *Response, error) { - requestType := "snapshot" - request := &ActionRequest{ - "type": requestType, - "name": name, - } - return s.doAction(ctx, id, request) -} - -// SnapshotByTag snapshots Droplets matched by a Tag. -func (s *DropletActionsServiceOp) SnapshotByTag(ctx context.Context, tag string, name string) ([]Action, *Response, error) { - requestType := "snapshot" - request := &ActionRequest{ - "type": requestType, - "name": name, - } - return s.doActionByTag(ctx, tag, request) -} - -// EnableBackups enables backups for a Droplet. -func (s *DropletActionsServiceOp) EnableBackups(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "enable_backups"} - return s.doAction(ctx, id, request) -} - -// EnableBackupsByTag enables backups for Droplets matched by a Tag. -func (s *DropletActionsServiceOp) EnableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "enable_backups"} - return s.doActionByTag(ctx, tag, request) -} - -// DisableBackups disables backups for a Droplet. -func (s *DropletActionsServiceOp) DisableBackups(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "disable_backups"} - return s.doAction(ctx, id, request) -} - -// DisableBackupsByTag disables backups for Droplet matched by a Tag. -func (s *DropletActionsServiceOp) DisableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "disable_backups"} - return s.doActionByTag(ctx, tag, request) -} - -// PasswordReset resets the password for a Droplet. -func (s *DropletActionsServiceOp) PasswordReset(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "password_reset"} - return s.doAction(ctx, id, request) -} - -// RebuildByImageID rebuilds a Droplet from an image with a given id. -func (s *DropletActionsServiceOp) RebuildByImageID(ctx context.Context, id, imageID int) (*Action, *Response, error) { - request := &ActionRequest{"type": "rebuild", "image": imageID} - return s.doAction(ctx, id, request) -} - -// RebuildByImageSlug rebuilds a Droplet from an Image matched by a given Slug. -func (s *DropletActionsServiceOp) RebuildByImageSlug(ctx context.Context, id int, slug string) (*Action, *Response, error) { - request := &ActionRequest{"type": "rebuild", "image": slug} - return s.doAction(ctx, id, request) -} - -// ChangeKernel changes the kernel for a Droplet. -func (s *DropletActionsServiceOp) ChangeKernel(ctx context.Context, id, kernelID int) (*Action, *Response, error) { - request := &ActionRequest{"type": "change_kernel", "kernel": kernelID} - return s.doAction(ctx, id, request) -} - -// EnableIPv6 enables IPv6 for a Droplet. -func (s *DropletActionsServiceOp) EnableIPv6(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "enable_ipv6"} - return s.doAction(ctx, id, request) -} - -// EnableIPv6ByTag enables IPv6 for Droplets matched by a Tag. -func (s *DropletActionsServiceOp) EnableIPv6ByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "enable_ipv6"} - return s.doActionByTag(ctx, tag, request) -} - -// EnablePrivateNetworking enables private networking for a Droplet. -func (s *DropletActionsServiceOp) EnablePrivateNetworking(ctx context.Context, id int) (*Action, *Response, error) { - request := &ActionRequest{"type": "enable_private_networking"} - return s.doAction(ctx, id, request) -} - -// EnablePrivateNetworkingByTag enables private networking for Droplets matched by a Tag. -func (s *DropletActionsServiceOp) EnablePrivateNetworkingByTag(ctx context.Context, tag string) ([]Action, *Response, error) { - request := &ActionRequest{"type": "enable_private_networking"} - return s.doActionByTag(ctx, tag, request) -} - -func (s *DropletActionsServiceOp) doAction(ctx context.Context, id int, request *ActionRequest) (*Action, *Response, error) { - if id < 1 { - return nil, nil, NewArgError("id", "cannot be less than 1") - } - - if request == nil { - return nil, nil, NewArgError("request", "request can't be nil") - } - - path := dropletActionPath(id) - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, request) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (s *DropletActionsServiceOp) doActionByTag(ctx context.Context, tag string, request *ActionRequest) ([]Action, *Response, error) { - if tag == "" { - return nil, nil, NewArgError("tag", "cannot be empty") - } - - if request == nil { - return nil, nil, NewArgError("request", "request can't be nil") - } - - path := dropletActionPathByTag(tag) - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, request) - if err != nil { - return nil, nil, err - } - - root := new(actionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Actions, resp, err -} - -// Get an action for a particular Droplet by id. -func (s *DropletActionsServiceOp) Get(ctx context.Context, dropletID, actionID int) (*Action, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - if actionID < 1 { - return nil, nil, NewArgError("actionID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", dropletActionPath(dropletID), actionID) - return s.get(ctx, path) -} - -// GetByURI gets an action for a particular Droplet by id. -func (s *DropletActionsServiceOp) GetByURI(ctx context.Context, rawurl string) (*Action, *Response, error) { - u, err := url.Parse(rawurl) - if err != nil { - return nil, nil, err - } - - return s.get(ctx, u.Path) - -} - -func (s *DropletActionsServiceOp) get(ctx context.Context, path string) (*Action, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err - -} - -func dropletActionPath(dropletID int) string { - return fmt.Sprintf("v2/droplets/%d/actions", dropletID) -} - -func dropletActionPathByTag(tag string) string { - return fmt.Sprintf("v2/droplets/actions?tag_name=%s", tag) -} diff --git a/vendor/github.com/digitalocean/godo/droplets.go b/vendor/github.com/digitalocean/godo/droplets.go deleted file mode 100644 index 72edf2b4..00000000 --- a/vendor/github.com/digitalocean/godo/droplets.go +++ /dev/null @@ -1,592 +0,0 @@ -package godo - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" -) - -const dropletBasePath = "v2/droplets" - -var errNoNetworks = errors.New("no networks have been defined") - -// DropletsService is an interface for interfacing with the Droplet -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#droplets -type DropletsService interface { - List(context.Context, *ListOptions) ([]Droplet, *Response, error) - ListByTag(context.Context, string, *ListOptions) ([]Droplet, *Response, error) - Get(context.Context, int) (*Droplet, *Response, error) - Create(context.Context, *DropletCreateRequest) (*Droplet, *Response, error) - CreateMultiple(context.Context, *DropletMultiCreateRequest) ([]Droplet, *Response, error) - Delete(context.Context, int) (*Response, error) - DeleteByTag(context.Context, string) (*Response, error) - Kernels(context.Context, int, *ListOptions) ([]Kernel, *Response, error) - Snapshots(context.Context, int, *ListOptions) ([]Image, *Response, error) - Backups(context.Context, int, *ListOptions) ([]Image, *Response, error) - Actions(context.Context, int, *ListOptions) ([]Action, *Response, error) - Neighbors(context.Context, int) ([]Droplet, *Response, error) -} - -// DropletsServiceOp handles communication with the Droplet related methods of the -// DigitalOcean API. -type DropletsServiceOp struct { - client *Client -} - -var _ DropletsService = &DropletsServiceOp{} - -// Droplet represents a DigitalOcean Droplet -type Droplet struct { - ID int `json:"id,float64,omitempty"` - Name string `json:"name,omitempty"` - Memory int `json:"memory,omitempty"` - Vcpus int `json:"vcpus,omitempty"` - Disk int `json:"disk,omitempty"` - Region *Region `json:"region,omitempty"` - Image *Image `json:"image,omitempty"` - Size *Size `json:"size,omitempty"` - SizeSlug string `json:"size_slug,omitempty"` - BackupIDs []int `json:"backup_ids,omitempty"` - NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"` - SnapshotIDs []int `json:"snapshot_ids,omitempty"` - Features []string `json:"features,omitempty"` - Locked bool `json:"locked,bool,omitempty"` - Status string `json:"status,omitempty"` - Networks *Networks `json:"networks,omitempty"` - Created string `json:"created_at,omitempty"` - Kernel *Kernel `json:"kernel,omitempty"` - Tags []string `json:"tags,omitempty"` - VolumeIDs []string `json:"volume_ids"` - VPCUUID string `json:"vpc_uuid,omitempty"` -} - -// PublicIPv4 returns the public IPv4 address for the Droplet. -func (d *Droplet) PublicIPv4() (string, error) { - if d.Networks == nil { - return "", errNoNetworks - } - - for _, v4 := range d.Networks.V4 { - if v4.Type == "public" { - return v4.IPAddress, nil - } - } - - return "", nil -} - -// PrivateIPv4 returns the private IPv4 address for the Droplet. -func (d *Droplet) PrivateIPv4() (string, error) { - if d.Networks == nil { - return "", errNoNetworks - } - - for _, v4 := range d.Networks.V4 { - if v4.Type == "private" { - return v4.IPAddress, nil - } - } - - return "", nil -} - -// PublicIPv6 returns the public IPv6 address for the Droplet. -func (d *Droplet) PublicIPv6() (string, error) { - if d.Networks == nil { - return "", errNoNetworks - } - - for _, v6 := range d.Networks.V6 { - if v6.Type == "public" { - return v6.IPAddress, nil - } - } - - return "", nil -} - -// Kernel object -type Kernel struct { - ID int `json:"id,float64,omitempty"` - Name string `json:"name,omitempty"` - Version string `json:"version,omitempty"` -} - -// BackupWindow object -type BackupWindow struct { - Start *Timestamp `json:"start,omitempty"` - End *Timestamp `json:"end,omitempty"` -} - -// Convert Droplet to a string -func (d Droplet) String() string { - return Stringify(d) -} - -func (d Droplet) URN() string { - return ToURN("Droplet", d.ID) -} - -// DropletRoot represents a Droplet root -type dropletRoot struct { - Droplet *Droplet `json:"droplet"` - Links *Links `json:"links,omitempty"` -} - -type dropletsRoot struct { - Droplets []Droplet `json:"droplets"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type kernelsRoot struct { - Kernels []Kernel `json:"kernels,omitempty"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type dropletSnapshotsRoot struct { - Snapshots []Image `json:"snapshots,omitempty"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type backupsRoot struct { - Backups []Image `json:"backups,omitempty"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// DropletCreateImage identifies an image for the create request. It prefers slug over ID. -type DropletCreateImage struct { - ID int - Slug string -} - -// MarshalJSON returns either the slug or id of the image. It returns the id -// if the slug is empty. -func (d DropletCreateImage) MarshalJSON() ([]byte, error) { - if d.Slug != "" { - return json.Marshal(d.Slug) - } - - return json.Marshal(d.ID) -} - -// DropletCreateVolume identifies a volume to attach for the create request. It -// prefers Name over ID, -type DropletCreateVolume struct { - ID string - Name string -} - -// MarshalJSON returns an object with either the name or id of the volume. It -// returns the id if the name is empty. -func (d DropletCreateVolume) MarshalJSON() ([]byte, error) { - if d.Name != "" { - return json.Marshal(struct { - Name string `json:"name"` - }{Name: d.Name}) - } - - return json.Marshal(struct { - ID string `json:"id"` - }{ID: d.ID}) -} - -// DropletCreateSSHKey identifies a SSH Key for the create request. It prefers fingerprint over ID. -type DropletCreateSSHKey struct { - ID int - Fingerprint string -} - -// MarshalJSON returns either the fingerprint or id of the ssh key. It returns -// the id if the fingerprint is empty. -func (d DropletCreateSSHKey) MarshalJSON() ([]byte, error) { - if d.Fingerprint != "" { - return json.Marshal(d.Fingerprint) - } - - return json.Marshal(d.ID) -} - -// DropletCreateRequest represents a request to create a Droplet. -type DropletCreateRequest struct { - Name string `json:"name"` - Region string `json:"region"` - Size string `json:"size"` - Image DropletCreateImage `json:"image"` - SSHKeys []DropletCreateSSHKey `json:"ssh_keys"` - Backups bool `json:"backups"` - IPv6 bool `json:"ipv6"` - PrivateNetworking bool `json:"private_networking"` - Monitoring bool `json:"monitoring"` - UserData string `json:"user_data,omitempty"` - Volumes []DropletCreateVolume `json:"volumes,omitempty"` - Tags []string `json:"tags"` - VPCUUID string `json:"vpc_uuid,omitempty"` -} - -// DropletMultiCreateRequest is a request to create multiple Droplets. -type DropletMultiCreateRequest struct { - Names []string `json:"names"` - Region string `json:"region"` - Size string `json:"size"` - Image DropletCreateImage `json:"image"` - SSHKeys []DropletCreateSSHKey `json:"ssh_keys"` - Backups bool `json:"backups"` - IPv6 bool `json:"ipv6"` - PrivateNetworking bool `json:"private_networking"` - Monitoring bool `json:"monitoring"` - UserData string `json:"user_data,omitempty"` - Tags []string `json:"tags"` - VPCUUID string `json:"vpc_uuid,omitempty"` -} - -func (d DropletCreateRequest) String() string { - return Stringify(d) -} - -func (d DropletMultiCreateRequest) String() string { - return Stringify(d) -} - -// Networks represents the Droplet's Networks. -type Networks struct { - V4 []NetworkV4 `json:"v4,omitempty"` - V6 []NetworkV6 `json:"v6,omitempty"` -} - -// NetworkV4 represents a DigitalOcean IPv4 Network. -type NetworkV4 struct { - IPAddress string `json:"ip_address,omitempty"` - Netmask string `json:"netmask,omitempty"` - Gateway string `json:"gateway,omitempty"` - Type string `json:"type,omitempty"` -} - -func (n NetworkV4) String() string { - return Stringify(n) -} - -// NetworkV6 represents a DigitalOcean IPv6 network. -type NetworkV6 struct { - IPAddress string `json:"ip_address,omitempty"` - Netmask int `json:"netmask,omitempty"` - Gateway string `json:"gateway,omitempty"` - Type string `json:"type,omitempty"` -} - -func (n NetworkV6) String() string { - return Stringify(n) -} - -// Performs a list request given a path. -func (s *DropletsServiceOp) list(ctx context.Context, path string) ([]Droplet, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(dropletsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Droplets, resp, err -} - -// List all Droplets. -func (s *DropletsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Droplet, *Response, error) { - path := dropletBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - return s.list(ctx, path) -} - -// ListByTag lists all Droplets matched by a Tag. -func (s *DropletsServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Droplet, *Response, error) { - path := fmt.Sprintf("%s?tag_name=%s", dropletBasePath, tag) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - return s.list(ctx, path) -} - -// Get individual Droplet. -func (s *DropletsServiceOp) Get(ctx context.Context, dropletID int) (*Droplet, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", dropletBasePath, dropletID) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(dropletRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Droplet, resp, err -} - -// Create Droplet -func (s *DropletsServiceOp) Create(ctx context.Context, createRequest *DropletCreateRequest) (*Droplet, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - path := dropletBasePath - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(dropletRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.Droplet, resp, err -} - -// CreateMultiple creates multiple Droplets. -func (s *DropletsServiceOp) CreateMultiple(ctx context.Context, createRequest *DropletMultiCreateRequest) ([]Droplet, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - path := dropletBasePath - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(dropletsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.Droplets, resp, err -} - -// Performs a delete request given a path -func (s *DropletsServiceOp) delete(ctx context.Context, path string) (*Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// Delete Droplet. -func (s *DropletsServiceOp) Delete(ctx context.Context, dropletID int) (*Response, error) { - if dropletID < 1 { - return nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", dropletBasePath, dropletID) - - return s.delete(ctx, path) -} - -// DeleteByTag deletes Droplets matched by a Tag. -func (s *DropletsServiceOp) DeleteByTag(ctx context.Context, tag string) (*Response, error) { - if tag == "" { - return nil, NewArgError("tag", "cannot be empty") - } - - path := fmt.Sprintf("%s?tag_name=%s", dropletBasePath, tag) - - return s.delete(ctx, path) -} - -// Kernels lists kernels available for a Droplet. -func (s *DropletsServiceOp) Kernels(ctx context.Context, dropletID int, opt *ListOptions) ([]Kernel, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d/kernels", dropletBasePath, dropletID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(kernelsRoot) - resp, err := s.client.Do(ctx, req, root) - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Kernels, resp, err -} - -// Actions lists the actions for a Droplet. -func (s *DropletsServiceOp) Actions(ctx context.Context, dropletID int, opt *ListOptions) ([]Action, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d/actions", dropletBasePath, dropletID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Actions, resp, err -} - -// Backups lists the backups for a Droplet. -func (s *DropletsServiceOp) Backups(ctx context.Context, dropletID int, opt *ListOptions) ([]Image, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d/backups", dropletBasePath, dropletID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(backupsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Backups, resp, err -} - -// Snapshots lists the snapshots available for a Droplet. -func (s *DropletsServiceOp) Snapshots(ctx context.Context, dropletID int, opt *ListOptions) ([]Image, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d/snapshots", dropletBasePath, dropletID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(dropletSnapshotsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Snapshots, resp, err -} - -// Neighbors lists the neighbors for a Droplet. -func (s *DropletsServiceOp) Neighbors(ctx context.Context, dropletID int) ([]Droplet, *Response, error) { - if dropletID < 1 { - return nil, nil, NewArgError("dropletID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d/neighbors", dropletBasePath, dropletID) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(dropletsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Droplets, resp, err -} - -func (s *DropletsServiceOp) dropletActionStatus(ctx context.Context, uri string) (string, error) { - action, _, err := s.client.DropletActions.GetByURI(ctx, uri) - - if err != nil { - return "", err - } - - return action.Status, nil -} diff --git a/vendor/github.com/digitalocean/godo/errors.go b/vendor/github.com/digitalocean/godo/errors.go deleted file mode 100644 index a65ebd76..00000000 --- a/vendor/github.com/digitalocean/godo/errors.go +++ /dev/null @@ -1,24 +0,0 @@ -package godo - -import "fmt" - -// ArgError is an error that represents an error with an input to godo. It -// identifies the argument and the cause (if possible). -type ArgError struct { - arg string - reason string -} - -var _ error = &ArgError{} - -// NewArgError creates an InputError. -func NewArgError(arg, reason string) *ArgError { - return &ArgError{ - arg: arg, - reason: reason, - } -} - -func (e *ArgError) Error() string { - return fmt.Sprintf("%s is invalid because %s", e.arg, e.reason) -} diff --git a/vendor/github.com/digitalocean/godo/firewalls.go b/vendor/github.com/digitalocean/godo/firewalls.go deleted file mode 100644 index 8453e664..00000000 --- a/vendor/github.com/digitalocean/godo/firewalls.go +++ /dev/null @@ -1,271 +0,0 @@ -package godo - -import ( - "context" - "net/http" - "path" - "strconv" -) - -const firewallsBasePath = "/v2/firewalls" - -// FirewallsService is an interface for managing Firewalls with the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2/#firewalls -type FirewallsService interface { - Get(context.Context, string) (*Firewall, *Response, error) - Create(context.Context, *FirewallRequest) (*Firewall, *Response, error) - Update(context.Context, string, *FirewallRequest) (*Firewall, *Response, error) - Delete(context.Context, string) (*Response, error) - List(context.Context, *ListOptions) ([]Firewall, *Response, error) - ListByDroplet(context.Context, int, *ListOptions) ([]Firewall, *Response, error) - AddDroplets(context.Context, string, ...int) (*Response, error) - RemoveDroplets(context.Context, string, ...int) (*Response, error) - AddTags(context.Context, string, ...string) (*Response, error) - RemoveTags(context.Context, string, ...string) (*Response, error) - AddRules(context.Context, string, *FirewallRulesRequest) (*Response, error) - RemoveRules(context.Context, string, *FirewallRulesRequest) (*Response, error) -} - -// FirewallsServiceOp handles communication with Firewalls methods of the DigitalOcean API. -type FirewallsServiceOp struct { - client *Client -} - -// Firewall represents a DigitalOcean Firewall configuration. -type Firewall struct { - ID string `json:"id"` - Name string `json:"name"` - Status string `json:"status"` - InboundRules []InboundRule `json:"inbound_rules"` - OutboundRules []OutboundRule `json:"outbound_rules"` - DropletIDs []int `json:"droplet_ids"` - Tags []string `json:"tags"` - Created string `json:"created_at"` - PendingChanges []PendingChange `json:"pending_changes"` -} - -// String creates a human-readable description of a Firewall. -func (fw Firewall) String() string { - return Stringify(fw) -} - -func (fw Firewall) URN() string { - return ToURN("Firewall", fw.ID) -} - -// FirewallRequest represents the configuration to be applied to an existing or a new Firewall. -type FirewallRequest struct { - Name string `json:"name"` - InboundRules []InboundRule `json:"inbound_rules"` - OutboundRules []OutboundRule `json:"outbound_rules"` - DropletIDs []int `json:"droplet_ids"` - Tags []string `json:"tags"` -} - -// FirewallRulesRequest represents rules configuration to be applied to an existing Firewall. -type FirewallRulesRequest struct { - InboundRules []InboundRule `json:"inbound_rules"` - OutboundRules []OutboundRule `json:"outbound_rules"` -} - -// InboundRule represents a DigitalOcean Firewall inbound rule. -type InboundRule struct { - Protocol string `json:"protocol,omitempty"` - PortRange string `json:"ports,omitempty"` - Sources *Sources `json:"sources"` -} - -// OutboundRule represents a DigitalOcean Firewall outbound rule. -type OutboundRule struct { - Protocol string `json:"protocol,omitempty"` - PortRange string `json:"ports,omitempty"` - Destinations *Destinations `json:"destinations"` -} - -// Sources represents a DigitalOcean Firewall InboundRule sources. -type Sources struct { - Addresses []string `json:"addresses,omitempty"` - Tags []string `json:"tags,omitempty"` - DropletIDs []int `json:"droplet_ids,omitempty"` - LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"` -} - -// PendingChange represents a DigitalOcean Firewall status details. -type PendingChange struct { - DropletID int `json:"droplet_id,omitempty"` - Removing bool `json:"removing,omitempty"` - Status string `json:"status,omitempty"` -} - -// Destinations represents a DigitalOcean Firewall OutboundRule destinations. -type Destinations struct { - Addresses []string `json:"addresses,omitempty"` - Tags []string `json:"tags,omitempty"` - DropletIDs []int `json:"droplet_ids,omitempty"` - LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"` -} - -var _ FirewallsService = &FirewallsServiceOp{} - -// Get an existing Firewall by its identifier. -func (fw *FirewallsServiceOp) Get(ctx context.Context, fID string) (*Firewall, *Response, error) { - path := path.Join(firewallsBasePath, fID) - - req, err := fw.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(firewallRoot) - resp, err := fw.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Firewall, resp, err -} - -// Create a new Firewall with a given configuration. -func (fw *FirewallsServiceOp) Create(ctx context.Context, fr *FirewallRequest) (*Firewall, *Response, error) { - req, err := fw.client.NewRequest(ctx, http.MethodPost, firewallsBasePath, fr) - if err != nil { - return nil, nil, err - } - - root := new(firewallRoot) - resp, err := fw.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Firewall, resp, err -} - -// Update an existing Firewall with new configuration. -func (fw *FirewallsServiceOp) Update(ctx context.Context, fID string, fr *FirewallRequest) (*Firewall, *Response, error) { - path := path.Join(firewallsBasePath, fID) - - req, err := fw.client.NewRequest(ctx, "PUT", path, fr) - if err != nil { - return nil, nil, err - } - - root := new(firewallRoot) - resp, err := fw.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Firewall, resp, err -} - -// Delete a Firewall by its identifier. -func (fw *FirewallsServiceOp) Delete(ctx context.Context, fID string) (*Response, error) { - path := path.Join(firewallsBasePath, fID) - return fw.createAndDoReq(ctx, http.MethodDelete, path, nil) -} - -// List Firewalls. -func (fw *FirewallsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Firewall, *Response, error) { - path, err := addOptions(firewallsBasePath, opt) - if err != nil { - return nil, nil, err - } - - return fw.listHelper(ctx, path) -} - -// ListByDroplet Firewalls. -func (fw *FirewallsServiceOp) ListByDroplet(ctx context.Context, dID int, opt *ListOptions) ([]Firewall, *Response, error) { - basePath := path.Join(dropletBasePath, strconv.Itoa(dID), "firewalls") - path, err := addOptions(basePath, opt) - if err != nil { - return nil, nil, err - } - - return fw.listHelper(ctx, path) -} - -// AddDroplets to a Firewall. -func (fw *FirewallsServiceOp) AddDroplets(ctx context.Context, fID string, dropletIDs ...int) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "droplets") - return fw.createAndDoReq(ctx, http.MethodPost, path, &dropletsRequest{IDs: dropletIDs}) -} - -// RemoveDroplets from a Firewall. -func (fw *FirewallsServiceOp) RemoveDroplets(ctx context.Context, fID string, dropletIDs ...int) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "droplets") - return fw.createAndDoReq(ctx, http.MethodDelete, path, &dropletsRequest{IDs: dropletIDs}) -} - -// AddTags to a Firewall. -func (fw *FirewallsServiceOp) AddTags(ctx context.Context, fID string, tags ...string) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "tags") - return fw.createAndDoReq(ctx, http.MethodPost, path, &tagsRequest{Tags: tags}) -} - -// RemoveTags from a Firewall. -func (fw *FirewallsServiceOp) RemoveTags(ctx context.Context, fID string, tags ...string) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "tags") - return fw.createAndDoReq(ctx, http.MethodDelete, path, &tagsRequest{Tags: tags}) -} - -// AddRules to a Firewall. -func (fw *FirewallsServiceOp) AddRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "rules") - return fw.createAndDoReq(ctx, http.MethodPost, path, rr) -} - -// RemoveRules from a Firewall. -func (fw *FirewallsServiceOp) RemoveRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error) { - path := path.Join(firewallsBasePath, fID, "rules") - return fw.createAndDoReq(ctx, http.MethodDelete, path, rr) -} - -type dropletsRequest struct { - IDs []int `json:"droplet_ids"` -} - -type tagsRequest struct { - Tags []string `json:"tags"` -} - -type firewallRoot struct { - Firewall *Firewall `json:"firewall"` -} - -type firewallsRoot struct { - Firewalls []Firewall `json:"firewalls"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -func (fw *FirewallsServiceOp) createAndDoReq(ctx context.Context, method, path string, v interface{}) (*Response, error) { - req, err := fw.client.NewRequest(ctx, method, path, v) - if err != nil { - return nil, err - } - - return fw.client.Do(ctx, req, nil) -} - -func (fw *FirewallsServiceOp) listHelper(ctx context.Context, path string) ([]Firewall, *Response, error) { - req, err := fw.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(firewallsRoot) - resp, err := fw.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Firewalls, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/floating_ips.go b/vendor/github.com/digitalocean/godo/floating_ips.go deleted file mode 100644 index 1720d767..00000000 --- a/vendor/github.com/digitalocean/godo/floating_ips.go +++ /dev/null @@ -1,143 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const floatingBasePath = "v2/floating_ips" - -// FloatingIPsService is an interface for interfacing with the floating IPs -// endpoints of the Digital Ocean API. -// See: https://developers.digitalocean.com/documentation/v2#floating-ips -type FloatingIPsService interface { - List(context.Context, *ListOptions) ([]FloatingIP, *Response, error) - Get(context.Context, string) (*FloatingIP, *Response, error) - Create(context.Context, *FloatingIPCreateRequest) (*FloatingIP, *Response, error) - Delete(context.Context, string) (*Response, error) -} - -// FloatingIPsServiceOp handles communication with the floating IPs related methods of the -// DigitalOcean API. -type FloatingIPsServiceOp struct { - client *Client -} - -var _ FloatingIPsService = &FloatingIPsServiceOp{} - -// FloatingIP represents a Digital Ocean floating IP. -type FloatingIP struct { - Region *Region `json:"region"` - Droplet *Droplet `json:"droplet"` - IP string `json:"ip"` -} - -func (f FloatingIP) String() string { - return Stringify(f) -} - -func (f FloatingIP) URN() string { - return ToURN("FloatingIP", f.IP) -} - -type floatingIPsRoot struct { - FloatingIPs []FloatingIP `json:"floating_ips"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type floatingIPRoot struct { - FloatingIP *FloatingIP `json:"floating_ip"` - Links *Links `json:"links,omitempty"` -} - -// FloatingIPCreateRequest represents a request to create a floating IP. -// If DropletID is not empty, the floating IP will be assigned to the -// droplet. -type FloatingIPCreateRequest struct { - Region string `json:"region"` - DropletID int `json:"droplet_id,omitempty"` -} - -// List all floating IPs. -func (f *FloatingIPsServiceOp) List(ctx context.Context, opt *ListOptions) ([]FloatingIP, *Response, error) { - path := floatingBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := f.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(floatingIPsRoot) - resp, err := f.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.FloatingIPs, resp, err -} - -// Get an individual floating IP. -func (f *FloatingIPsServiceOp) Get(ctx context.Context, ip string) (*FloatingIP, *Response, error) { - path := fmt.Sprintf("%s/%s", floatingBasePath, ip) - - req, err := f.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(floatingIPRoot) - resp, err := f.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.FloatingIP, resp, err -} - -// Create a floating IP. If the DropletID field of the request is not empty, -// the floating IP will also be assigned to the droplet. -func (f *FloatingIPsServiceOp) Create(ctx context.Context, createRequest *FloatingIPCreateRequest) (*FloatingIP, *Response, error) { - path := floatingBasePath - - req, err := f.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(floatingIPRoot) - resp, err := f.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.FloatingIP, resp, err -} - -// Delete a floating IP. -func (f *FloatingIPsServiceOp) Delete(ctx context.Context, ip string) (*Response, error) { - path := fmt.Sprintf("%s/%s", floatingBasePath, ip) - - req, err := f.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := f.client.Do(ctx, req, nil) - - return resp, err -} diff --git a/vendor/github.com/digitalocean/godo/floating_ips_actions.go b/vendor/github.com/digitalocean/godo/floating_ips_actions.go deleted file mode 100644 index 74ad279f..00000000 --- a/vendor/github.com/digitalocean/godo/floating_ips_actions.go +++ /dev/null @@ -1,109 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -// FloatingIPActionsService is an interface for interfacing with the -// floating IPs actions endpoints of the Digital Ocean API. -// See: https://developers.digitalocean.com/documentation/v2#floating-ips-action -type FloatingIPActionsService interface { - Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error) - Unassign(ctx context.Context, ip string) (*Action, *Response, error) - Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error) - List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error) -} - -// FloatingIPActionsServiceOp handles communication with the floating IPs -// action related methods of the DigitalOcean API. -type FloatingIPActionsServiceOp struct { - client *Client -} - -// Assign a floating IP to a droplet. -func (s *FloatingIPActionsServiceOp) Assign(ctx context.Context, ip string, dropletID int) (*Action, *Response, error) { - request := &ActionRequest{ - "type": "assign", - "droplet_id": dropletID, - } - return s.doAction(ctx, ip, request) -} - -// Unassign a floating IP from the droplet it is currently assigned to. -func (s *FloatingIPActionsServiceOp) Unassign(ctx context.Context, ip string) (*Action, *Response, error) { - request := &ActionRequest{"type": "unassign"} - return s.doAction(ctx, ip, request) -} - -// Get an action for a particular floating IP by id. -func (s *FloatingIPActionsServiceOp) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error) { - path := fmt.Sprintf("%s/%d", floatingIPActionPath(ip), actionID) - return s.get(ctx, path) -} - -// List the actions for a particular floating IP. -func (s *FloatingIPActionsServiceOp) List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error) { - path := floatingIPActionPath(ip) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - return s.list(ctx, path) -} - -func (s *FloatingIPActionsServiceOp) doAction(ctx context.Context, ip string, request *ActionRequest) (*Action, *Response, error) { - path := floatingIPActionPath(ip) - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, request) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (s *FloatingIPActionsServiceOp) get(ctx context.Context, path string) (*Action, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (s *FloatingIPActionsServiceOp) list(ctx context.Context, path string) ([]Action, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.Actions, resp, err -} - -func floatingIPActionPath(ip string) string { - return fmt.Sprintf("%s/%s/actions", floatingBasePath, ip) -} diff --git a/vendor/github.com/digitalocean/godo/go.mod b/vendor/github.com/digitalocean/godo/go.mod deleted file mode 100644 index a8af42bd..00000000 --- a/vendor/github.com/digitalocean/godo/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/digitalocean/godo - -go 1.13 - -require ( - github.com/google/go-querystring v1.0.0 - github.com/stretchr/testify v1.3.0 - golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a -) diff --git a/vendor/github.com/digitalocean/godo/go.sum b/vendor/github.com/digitalocean/godo/go.sum deleted file mode 100644 index ace703ed..00000000 --- a/vendor/github.com/digitalocean/godo/go.sum +++ /dev/null @@ -1,22 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go deleted file mode 100644 index 24c74cb5..00000000 --- a/vendor/github.com/digitalocean/godo/godo.go +++ /dev/null @@ -1,409 +0,0 @@ -package godo - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "strconv" - "time" - - "github.com/google/go-querystring/query" -) - -const ( - libraryVersion = "1.29.0" - defaultBaseURL = "https://api.digitalocean.com/" - userAgent = "godo/" + libraryVersion - mediaType = "application/json" - - headerRateLimit = "RateLimit-Limit" - headerRateRemaining = "RateLimit-Remaining" - headerRateReset = "RateLimit-Reset" -) - -// Client manages communication with DigitalOcean V2 API. -type Client struct { - // HTTP client used to communicate with the DO API. - client *http.Client - - // Base URL for API requests. - BaseURL *url.URL - - // User agent for client - UserAgent string - - // Rate contains the current rate limit for the client as determined by the most recent - // API call. - Rate Rate - - // Services used for communicating with the API - Account AccountService - Actions ActionsService - Balance BalanceService - CDNs CDNService - Domains DomainsService - Droplets DropletsService - DropletActions DropletActionsService - Images ImagesService - ImageActions ImageActionsService - Keys KeysService - Regions RegionsService - Sizes SizesService - FloatingIPs FloatingIPsService - FloatingIPActions FloatingIPActionsService - Snapshots SnapshotsService - Storage StorageService - StorageActions StorageActionsService - Tags TagsService - LoadBalancers LoadBalancersService - Certificates CertificatesService - Firewalls FirewallsService - Projects ProjectsService - Kubernetes KubernetesService - Registry RegistryService - Databases DatabasesService - VPCs VPCsService - - // Optional function called after every successful request made to the DO APIs - onRequestCompleted RequestCompletionCallback -} - -// RequestCompletionCallback defines the type of the request callback function -type RequestCompletionCallback func(*http.Request, *http.Response) - -// ListOptions specifies the optional parameters to various List methods that -// support pagination. -type ListOptions struct { - // For paginated result sets, page of results to retrieve. - Page int `url:"page,omitempty"` - - // For paginated result sets, the number of results to include per page. - PerPage int `url:"per_page,omitempty"` -} - -// Response is a DigitalOcean response. This wraps the standard http.Response returned from DigitalOcean. -type Response struct { - *http.Response - - // Links that were returned with the response. These are parsed from - // request body and not the header. - Links *Links - - // Meta describes generic information about the response. - Meta *Meta - - // Monitoring URI - Monitor string - - Rate -} - -// An ErrorResponse reports the error caused by an API request -type ErrorResponse struct { - // HTTP response that caused this error - Response *http.Response - - // Error message - Message string `json:"message"` - - // RequestID returned from the API, useful to contact support. - RequestID string `json:"request_id"` -} - -// Rate contains the rate limit for the current client. -type Rate struct { - // The number of request per hour the client is currently limited to. - Limit int `json:"limit"` - - // The number of remaining requests the client can make this hour. - Remaining int `json:"remaining"` - - // The time at which the current rate limit will reset. - Reset Timestamp `json:"reset"` -} - -func addOptions(s string, opt interface{}) (string, error) { - v := reflect.ValueOf(opt) - - if v.Kind() == reflect.Ptr && v.IsNil() { - return s, nil - } - - origURL, err := url.Parse(s) - if err != nil { - return s, err - } - - origValues := origURL.Query() - - newValues, err := query.Values(opt) - if err != nil { - return s, err - } - - for k, v := range newValues { - origValues[k] = v - } - - origURL.RawQuery = origValues.Encode() - return origURL.String(), nil -} - -// NewClient returns a new DigitalOcean API client. -func NewClient(httpClient *http.Client) *Client { - if httpClient == nil { - httpClient = http.DefaultClient - } - - baseURL, _ := url.Parse(defaultBaseURL) - - c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent} - c.Account = &AccountServiceOp{client: c} - c.Actions = &ActionsServiceOp{client: c} - c.Balance = &BalanceServiceOp{client: c} - c.CDNs = &CDNServiceOp{client: c} - c.Certificates = &CertificatesServiceOp{client: c} - c.Domains = &DomainsServiceOp{client: c} - c.Droplets = &DropletsServiceOp{client: c} - c.DropletActions = &DropletActionsServiceOp{client: c} - c.Firewalls = &FirewallsServiceOp{client: c} - c.FloatingIPs = &FloatingIPsServiceOp{client: c} - c.FloatingIPActions = &FloatingIPActionsServiceOp{client: c} - c.Images = &ImagesServiceOp{client: c} - c.ImageActions = &ImageActionsServiceOp{client: c} - c.Keys = &KeysServiceOp{client: c} - c.LoadBalancers = &LoadBalancersServiceOp{client: c} - c.Projects = &ProjectsServiceOp{client: c} - c.Regions = &RegionsServiceOp{client: c} - c.Sizes = &SizesServiceOp{client: c} - c.Snapshots = &SnapshotsServiceOp{client: c} - c.Storage = &StorageServiceOp{client: c} - c.StorageActions = &StorageActionsServiceOp{client: c} - c.Tags = &TagsServiceOp{client: c} - c.Kubernetes = &KubernetesServiceOp{client: c} - c.Registry = &RegistryServiceOp{client: c} - c.Databases = &DatabasesServiceOp{client: c} - c.VPCs = &VPCsServiceOp{client: c} - - return c -} - -// ClientOpt are options for New. -type ClientOpt func(*Client) error - -// New returns a new DIgitalOcean API client instance. -func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error) { - c := NewClient(httpClient) - for _, opt := range opts { - if err := opt(c); err != nil { - return nil, err - } - } - - return c, nil -} - -// SetBaseURL is a client option for setting the base URL. -func SetBaseURL(bu string) ClientOpt { - return func(c *Client) error { - u, err := url.Parse(bu) - if err != nil { - return err - } - - c.BaseURL = u - return nil - } -} - -// SetUserAgent is a client option for setting the user agent. -func SetUserAgent(ua string) ClientOpt { - return func(c *Client) error { - c.UserAgent = fmt.Sprintf("%s %s", ua, c.UserAgent) - return nil - } -} - -// NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the -// BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the -// value pointed to by body is JSON encoded and included in as the request body. -func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) { - u, err := c.BaseURL.Parse(urlStr) - if err != nil { - return nil, err - } - - buf := new(bytes.Buffer) - if body != nil { - err = json.NewEncoder(buf).Encode(body) - if err != nil { - return nil, err - } - } - - req, err := http.NewRequest(method, u.String(), buf) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", mediaType) - req.Header.Add("Accept", mediaType) - req.Header.Add("User-Agent", c.UserAgent) - return req, nil -} - -// OnRequestCompleted sets the DO API request completion callback -func (c *Client) OnRequestCompleted(rc RequestCompletionCallback) { - c.onRequestCompleted = rc -} - -// newResponse creates a new Response for the provided http.Response -func newResponse(r *http.Response) *Response { - response := Response{Response: r} - response.populateRate() - - return &response -} - -// populateRate parses the rate related headers and populates the response Rate. -func (r *Response) populateRate() { - if limit := r.Header.Get(headerRateLimit); limit != "" { - r.Rate.Limit, _ = strconv.Atoi(limit) - } - if remaining := r.Header.Get(headerRateRemaining); remaining != "" { - r.Rate.Remaining, _ = strconv.Atoi(remaining) - } - if reset := r.Header.Get(headerRateReset); reset != "" { - if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { - r.Rate.Reset = Timestamp{time.Unix(v, 0)} - } - } -} - -// Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value -// pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, -// the raw response will be written to v, without attempting to decode it. -func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) { - resp, err := DoRequestWithClient(ctx, c.client, req) - if err != nil { - return nil, err - } - if c.onRequestCompleted != nil { - c.onRequestCompleted(req, resp) - } - - defer func() { - if rerr := resp.Body.Close(); err == nil { - err = rerr - } - }() - - response := newResponse(resp) - c.Rate = response.Rate - - err = CheckResponse(resp) - if err != nil { - return response, err - } - - if v != nil { - if w, ok := v.(io.Writer); ok { - _, err = io.Copy(w, resp.Body) - if err != nil { - return nil, err - } - } else { - err = json.NewDecoder(resp.Body).Decode(v) - if err != nil { - return nil, err - } - } - } - - return response, err -} - -// DoRequest submits an HTTP request. -func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error) { - return DoRequestWithClient(ctx, http.DefaultClient, req) -} - -// DoRequestWithClient submits an HTTP request using the specified client. -func DoRequestWithClient( - ctx context.Context, - client *http.Client, - req *http.Request) (*http.Response, error) { - req = req.WithContext(ctx) - return client.Do(req) -} - -func (r *ErrorResponse) Error() string { - if r.RequestID != "" { - return fmt.Sprintf("%v %v: %d (request %q) %v", - r.Response.Request.Method, r.Response.Request.URL, r.Response.StatusCode, r.RequestID, r.Message) - } - return fmt.Sprintf("%v %v: %d %v", - r.Response.Request.Method, r.Response.Request.URL, r.Response.StatusCode, r.Message) -} - -// CheckResponse checks the API response for errors, and returns them if present. A response is considered an -// error if it has a status code outside the 200 range. API error responses are expected to have either no response -// body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored. -func CheckResponse(r *http.Response) error { - if c := r.StatusCode; c >= 200 && c <= 299 { - return nil - } - - errorResponse := &ErrorResponse{Response: r} - data, err := ioutil.ReadAll(r.Body) - if err == nil && len(data) > 0 { - err := json.Unmarshal(data, errorResponse) - if err != nil { - errorResponse.Message = string(data) - } - } - - return errorResponse -} - -func (r Rate) String() string { - return Stringify(r) -} - -// String is a helper routine that allocates a new string value -// to store v and returns a pointer to it. -func String(v string) *string { - p := new(string) - *p = v - return p -} - -// Int is a helper routine that allocates a new int32 value -// to store v and returns a pointer to it, but unlike Int32 -// its argument value is an int. -func Int(v int) *int { - p := new(int) - *p = v - return p -} - -// Bool is a helper routine that allocates a new bool value -// to store v and returns a pointer to it. -func Bool(v bool) *bool { - p := new(bool) - *p = v - return p -} - -// StreamToString converts a reader to a string -func StreamToString(stream io.Reader) string { - buf := new(bytes.Buffer) - _, _ = buf.ReadFrom(stream) - return buf.String() -} diff --git a/vendor/github.com/digitalocean/godo/image_actions.go b/vendor/github.com/digitalocean/godo/image_actions.go deleted file mode 100644 index 976f7c68..00000000 --- a/vendor/github.com/digitalocean/godo/image_actions.go +++ /dev/null @@ -1,102 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -// ImageActionsService is an interface for interfacing with the image actions -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#image-actions -type ImageActionsService interface { - Get(context.Context, int, int) (*Action, *Response, error) - Transfer(context.Context, int, *ActionRequest) (*Action, *Response, error) - Convert(context.Context, int) (*Action, *Response, error) -} - -// ImageActionsServiceOp handles communition with the image action related methods of the -// DigitalOcean API. -type ImageActionsServiceOp struct { - client *Client -} - -var _ ImageActionsService = &ImageActionsServiceOp{} - -// Transfer an image -func (i *ImageActionsServiceOp) Transfer(ctx context.Context, imageID int, transferRequest *ActionRequest) (*Action, *Response, error) { - if imageID < 1 { - return nil, nil, NewArgError("imageID", "cannot be less than 1") - } - - if transferRequest == nil { - return nil, nil, NewArgError("transferRequest", "cannot be nil") - } - - path := fmt.Sprintf("v2/images/%d/actions", imageID) - - req, err := i.client.NewRequest(ctx, http.MethodPost, path, transferRequest) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := i.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -// Convert an image to a snapshot -func (i *ImageActionsServiceOp) Convert(ctx context.Context, imageID int) (*Action, *Response, error) { - if imageID < 1 { - return nil, nil, NewArgError("imageID", "cannont be less than 1") - } - - path := fmt.Sprintf("v2/images/%d/actions", imageID) - - convertRequest := &ActionRequest{ - "type": "convert", - } - - req, err := i.client.NewRequest(ctx, http.MethodPost, path, convertRequest) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := i.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -// Get an action for a particular image by id. -func (i *ImageActionsServiceOp) Get(ctx context.Context, imageID, actionID int) (*Action, *Response, error) { - if imageID < 1 { - return nil, nil, NewArgError("imageID", "cannot be less than 1") - } - - if actionID < 1 { - return nil, nil, NewArgError("actionID", "cannot be less than 1") - } - - path := fmt.Sprintf("v2/images/%d/actions/%d", imageID, actionID) - - req, err := i.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := i.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/images.go b/vendor/github.com/digitalocean/godo/images.go deleted file mode 100644 index 64e72e75..00000000 --- a/vendor/github.com/digitalocean/godo/images.go +++ /dev/null @@ -1,245 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const imageBasePath = "v2/images" - -// ImagesService is an interface for interfacing with the images -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#images -type ImagesService interface { - List(context.Context, *ListOptions) ([]Image, *Response, error) - ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) - ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) - ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) - ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error) - GetByID(context.Context, int) (*Image, *Response, error) - GetBySlug(context.Context, string) (*Image, *Response, error) - Create(context.Context, *CustomImageCreateRequest) (*Image, *Response, error) - Update(context.Context, int, *ImageUpdateRequest) (*Image, *Response, error) - Delete(context.Context, int) (*Response, error) -} - -// ImagesServiceOp handles communication with the image related methods of the -// DigitalOcean API. -type ImagesServiceOp struct { - client *Client -} - -var _ ImagesService = &ImagesServiceOp{} - -// Image represents a DigitalOcean Image -type Image struct { - ID int `json:"id,float64,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Distribution string `json:"distribution,omitempty"` - Slug string `json:"slug,omitempty"` - Public bool `json:"public,omitempty"` - Regions []string `json:"regions,omitempty"` - MinDiskSize int `json:"min_disk_size,omitempty"` - SizeGigaBytes float64 `json:"size_gigabytes,omitempty"` - Created string `json:"created_at,omitempty"` - Description string `json:"description,omitempty"` - Tags []string `json:"tags,omitempty"` - Status string `json:"status,omitempty"` - ErrorMessage string `json:"error_message,omitempty"` -} - -// ImageUpdateRequest represents a request to update an image. -type ImageUpdateRequest struct { - Name string `json:"name"` -} - -// CustomImageCreateRequest represents a request to create a custom image. -type CustomImageCreateRequest struct { - Name string `json:"name"` - Url string `json:"url"` - Region string `json:"region"` - Distribution string `json:"distribution,omitempty"` - Description string `json:"description,omitempty"` - Tags []string `json:"tags,omitempty"` -} - -type imageRoot struct { - Image *Image -} - -type imagesRoot struct { - Images []Image - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type listImageOptions struct { - Private bool `url:"private,omitempty"` - Type string `url:"type,omitempty"` - Tag string `url:"tag_name,omitempty"` -} - -func (i Image) String() string { - return Stringify(i) -} - -// List lists all the images available. -func (s *ImagesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) { - return s.list(ctx, opt, nil) -} - -// ListDistribution lists all the distribution images. -func (s *ImagesServiceOp) ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) { - listOpt := listImageOptions{Type: "distribution"} - return s.list(ctx, opt, &listOpt) -} - -// ListApplication lists all the application images. -func (s *ImagesServiceOp) ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) { - listOpt := listImageOptions{Type: "application"} - return s.list(ctx, opt, &listOpt) -} - -// ListUser lists all the user images. -func (s *ImagesServiceOp) ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) { - listOpt := listImageOptions{Private: true} - return s.list(ctx, opt, &listOpt) -} - -// ListByTag lists all images with a specific tag applied. -func (s *ImagesServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error) { - listOpt := listImageOptions{Tag: tag} - return s.list(ctx, opt, &listOpt) -} - -// GetByID retrieves an image by id. -func (s *ImagesServiceOp) GetByID(ctx context.Context, imageID int) (*Image, *Response, error) { - if imageID < 1 { - return nil, nil, NewArgError("imageID", "cannot be less than 1") - } - - return s.get(ctx, interface{}(imageID)) -} - -// GetBySlug retrieves an image by slug. -func (s *ImagesServiceOp) GetBySlug(ctx context.Context, slug string) (*Image, *Response, error) { - if len(slug) < 1 { - return nil, nil, NewArgError("slug", "cannot be blank") - } - - return s.get(ctx, interface{}(slug)) -} - -func (s *ImagesServiceOp) Create(ctx context.Context, createRequest *CustomImageCreateRequest) (*Image, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - req, err := s.client.NewRequest(ctx, http.MethodPost, imageBasePath, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(imageRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Image, resp, err -} - -// Update an image name. -func (s *ImagesServiceOp) Update(ctx context.Context, imageID int, updateRequest *ImageUpdateRequest) (*Image, *Response, error) { - if imageID < 1 { - return nil, nil, NewArgError("imageID", "cannot be less than 1") - } - - if updateRequest == nil { - return nil, nil, NewArgError("updateRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%d", imageBasePath, imageID) - req, err := s.client.NewRequest(ctx, http.MethodPut, path, updateRequest) - if err != nil { - return nil, nil, err - } - - root := new(imageRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Image, resp, err -} - -// Delete an image. -func (s *ImagesServiceOp) Delete(ctx context.Context, imageID int) (*Response, error) { - if imageID < 1 { - return nil, NewArgError("imageID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", imageBasePath, imageID) - - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// Helper method for getting an individual image -func (s *ImagesServiceOp) get(ctx context.Context, ID interface{}) (*Image, *Response, error) { - path := fmt.Sprintf("%s/%v", imageBasePath, ID) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(imageRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Image, resp, err -} - -// Helper method for listing images -func (s *ImagesServiceOp) list(ctx context.Context, opt *ListOptions, listOpt *listImageOptions) ([]Image, *Response, error) { - path := imageBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - path, err = addOptions(path, listOpt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(imagesRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Images, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/keys.go b/vendor/github.com/digitalocean/godo/keys.go deleted file mode 100644 index b97554d1..00000000 --- a/vendor/github.com/digitalocean/godo/keys.go +++ /dev/null @@ -1,230 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const keysBasePath = "v2/account/keys" - -// KeysService is an interface for interfacing with the keys -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#keys -type KeysService interface { - List(context.Context, *ListOptions) ([]Key, *Response, error) - GetByID(context.Context, int) (*Key, *Response, error) - GetByFingerprint(context.Context, string) (*Key, *Response, error) - Create(context.Context, *KeyCreateRequest) (*Key, *Response, error) - UpdateByID(context.Context, int, *KeyUpdateRequest) (*Key, *Response, error) - UpdateByFingerprint(context.Context, string, *KeyUpdateRequest) (*Key, *Response, error) - DeleteByID(context.Context, int) (*Response, error) - DeleteByFingerprint(context.Context, string) (*Response, error) -} - -// KeysServiceOp handles communication with key related method of the -// DigitalOcean API. -type KeysServiceOp struct { - client *Client -} - -var _ KeysService = &KeysServiceOp{} - -// Key represents a DigitalOcean Key. -type Key struct { - ID int `json:"id,float64,omitempty"` - Name string `json:"name,omitempty"` - Fingerprint string `json:"fingerprint,omitempty"` - PublicKey string `json:"public_key,omitempty"` -} - -// KeyUpdateRequest represents a request to update a DigitalOcean key. -type KeyUpdateRequest struct { - Name string `json:"name"` -} - -type keysRoot struct { - SSHKeys []Key `json:"ssh_keys"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type keyRoot struct { - SSHKey *Key `json:"ssh_key"` -} - -func (s Key) String() string { - return Stringify(s) -} - -// KeyCreateRequest represents a request to create a new key. -type KeyCreateRequest struct { - Name string `json:"name"` - PublicKey string `json:"public_key"` -} - -// List all keys -func (s *KeysServiceOp) List(ctx context.Context, opt *ListOptions) ([]Key, *Response, error) { - path := keysBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(keysRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.SSHKeys, resp, err -} - -// Performs a get given a path -func (s *KeysServiceOp) get(ctx context.Context, path string) (*Key, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(keyRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.SSHKey, resp, err -} - -// GetByID gets a Key by id -func (s *KeysServiceOp) GetByID(ctx context.Context, keyID int) (*Key, *Response, error) { - if keyID < 1 { - return nil, nil, NewArgError("keyID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", keysBasePath, keyID) - return s.get(ctx, path) -} - -// GetByFingerprint gets a Key by by fingerprint -func (s *KeysServiceOp) GetByFingerprint(ctx context.Context, fingerprint string) (*Key, *Response, error) { - if len(fingerprint) < 1 { - return nil, nil, NewArgError("fingerprint", "cannot not be empty") - } - - path := fmt.Sprintf("%s/%s", keysBasePath, fingerprint) - return s.get(ctx, path) -} - -// Create a key using a KeyCreateRequest -func (s *KeysServiceOp) Create(ctx context.Context, createRequest *KeyCreateRequest) (*Key, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - req, err := s.client.NewRequest(ctx, http.MethodPost, keysBasePath, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(keyRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.SSHKey, resp, err -} - -// UpdateByID updates a key name by ID. -func (s *KeysServiceOp) UpdateByID(ctx context.Context, keyID int, updateRequest *KeyUpdateRequest) (*Key, *Response, error) { - if keyID < 1 { - return nil, nil, NewArgError("keyID", "cannot be less than 1") - } - - if updateRequest == nil { - return nil, nil, NewArgError("updateRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%d", keysBasePath, keyID) - req, err := s.client.NewRequest(ctx, "PUT", path, updateRequest) - if err != nil { - return nil, nil, err - } - - root := new(keyRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.SSHKey, resp, err -} - -// UpdateByFingerprint updates a key name by fingerprint. -func (s *KeysServiceOp) UpdateByFingerprint(ctx context.Context, fingerprint string, updateRequest *KeyUpdateRequest) (*Key, *Response, error) { - if len(fingerprint) < 1 { - return nil, nil, NewArgError("fingerprint", "cannot be empty") - } - - if updateRequest == nil { - return nil, nil, NewArgError("updateRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%s", keysBasePath, fingerprint) - req, err := s.client.NewRequest(ctx, "PUT", path, updateRequest) - if err != nil { - return nil, nil, err - } - - root := new(keyRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.SSHKey, resp, err -} - -// Delete key using a path -func (s *KeysServiceOp) delete(ctx context.Context, path string) (*Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// DeleteByID deletes a key by its id -func (s *KeysServiceOp) DeleteByID(ctx context.Context, keyID int) (*Response, error) { - if keyID < 1 { - return nil, NewArgError("keyID", "cannot be less than 1") - } - - path := fmt.Sprintf("%s/%d", keysBasePath, keyID) - return s.delete(ctx, path) -} - -// DeleteByFingerprint deletes a key by its fingerprint -func (s *KeysServiceOp) DeleteByFingerprint(ctx context.Context, fingerprint string) (*Response, error) { - if len(fingerprint) < 1 { - return nil, NewArgError("fingerprint", "cannot be empty") - } - - path := fmt.Sprintf("%s/%s", keysBasePath, fingerprint) - return s.delete(ctx, path) -} diff --git a/vendor/github.com/digitalocean/godo/kubernetes.go b/vendor/github.com/digitalocean/godo/kubernetes.go deleted file mode 100644 index a43a8dd0..00000000 --- a/vendor/github.com/digitalocean/godo/kubernetes.go +++ /dev/null @@ -1,693 +0,0 @@ -package godo - -import ( - "bytes" - "context" - "encoding" - "encoding/json" - "fmt" - "net/http" - "net/url" - "strconv" - "strings" - "time" -) - -const ( - kubernetesBasePath = "/v2/kubernetes" - kubernetesClustersPath = kubernetesBasePath + "/clusters" - kubernetesOptionsPath = kubernetesBasePath + "/options" -) - -// KubernetesService is an interface for interfacing with the Kubernetes endpoints -// of the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2#kubernetes -type KubernetesService interface { - Create(context.Context, *KubernetesClusterCreateRequest) (*KubernetesCluster, *Response, error) - Get(context.Context, string) (*KubernetesCluster, *Response, error) - GetUser(context.Context, string) (*KubernetesClusterUser, *Response, error) - GetUpgrades(context.Context, string) ([]*KubernetesVersion, *Response, error) - GetKubeConfig(context.Context, string) (*KubernetesClusterConfig, *Response, error) - GetCredentials(context.Context, string, *KubernetesClusterCredentialsGetRequest) (*KubernetesClusterCredentials, *Response, error) - List(context.Context, *ListOptions) ([]*KubernetesCluster, *Response, error) - Update(context.Context, string, *KubernetesClusterUpdateRequest) (*KubernetesCluster, *Response, error) - Upgrade(context.Context, string, *KubernetesClusterUpgradeRequest) (*Response, error) - Delete(context.Context, string) (*Response, error) - - CreateNodePool(ctx context.Context, clusterID string, req *KubernetesNodePoolCreateRequest) (*KubernetesNodePool, *Response, error) - GetNodePool(ctx context.Context, clusterID, poolID string) (*KubernetesNodePool, *Response, error) - ListNodePools(ctx context.Context, clusterID string, opts *ListOptions) ([]*KubernetesNodePool, *Response, error) - UpdateNodePool(ctx context.Context, clusterID, poolID string, req *KubernetesNodePoolUpdateRequest) (*KubernetesNodePool, *Response, error) - // RecycleNodePoolNodes is DEPRECATED please use DeleteNode - // The method will be removed in godo 2.0. - RecycleNodePoolNodes(ctx context.Context, clusterID, poolID string, req *KubernetesNodePoolRecycleNodesRequest) (*Response, error) - DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error) - DeleteNode(ctx context.Context, clusterID, poolID, nodeID string, req *KubernetesNodeDeleteRequest) (*Response, error) - - GetOptions(context.Context) (*KubernetesOptions, *Response, error) -} - -var _ KubernetesService = &KubernetesServiceOp{} - -// KubernetesServiceOp handles communication with Kubernetes methods of the DigitalOcean API. -type KubernetesServiceOp struct { - client *Client -} - -// KubernetesClusterCreateRequest represents a request to create a Kubernetes cluster. -type KubernetesClusterCreateRequest struct { - Name string `json:"name,omitempty"` - RegionSlug string `json:"region,omitempty"` - VersionSlug string `json:"version,omitempty"` - Tags []string `json:"tags,omitempty"` - VPCUUID string `json:"vpc_uuid,omitempty"` - - NodePools []*KubernetesNodePoolCreateRequest `json:"node_pools,omitempty"` - - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy"` - AutoUpgrade bool `json:"auto_upgrade"` -} - -// KubernetesClusterUpdateRequest represents a request to update a Kubernetes cluster. -type KubernetesClusterUpdateRequest struct { - Name string `json:"name,omitempty"` - Tags []string `json:"tags,omitempty"` - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` - AutoUpgrade *bool `json:"auto_upgrade,omitempty"` -} - -// KubernetesClusterUpgradeRequest represents a request to upgrade a Kubernetes cluster. -type KubernetesClusterUpgradeRequest struct { - VersionSlug string `json:"version,omitempty"` -} - -// KubernetesNodePoolCreateRequest represents a request to create a node pool for a -// Kubernetes cluster. -type KubernetesNodePoolCreateRequest struct { - Name string `json:"name,omitempty"` - Size string `json:"size,omitempty"` - Count int `json:"count,omitempty"` - Tags []string `json:"tags,omitempty"` - AutoScale bool `json:"auto_scale,omitempty"` - MinNodes int `json:"min_nodes,omitempty"` - MaxNodes int `json:"max_nodes,omitempty"` -} - -// KubernetesNodePoolUpdateRequest represents a request to update a node pool in a -// Kubernetes cluster. -type KubernetesNodePoolUpdateRequest struct { - Name string `json:"name,omitempty"` - Count *int `json:"count,omitempty"` - Tags []string `json:"tags,omitempty"` - AutoScale *bool `json:"auto_scale,omitempty"` - MinNodes *int `json:"min_nodes,omitempty"` - MaxNodes *int `json:"max_nodes,omitempty"` -} - -// KubernetesNodePoolRecycleNodesRequest is DEPRECATED please use DeleteNode -// The type will be removed in godo 2.0. -type KubernetesNodePoolRecycleNodesRequest struct { - Nodes []string `json:"nodes,omitempty"` -} - -// KubernetesNodeDeleteRequest is a request to delete a specific node in a node pool. -type KubernetesNodeDeleteRequest struct { - // Replace will cause a new node to be created to replace the deleted node. - Replace bool `json:"replace,omitempty"` - - // SkipDrain skips draining the node before deleting it. - SkipDrain bool `json:"skip_drain,omitempty"` -} - -// KubernetesClusterCredentialsGetRequest is a request to get cluster credentials. -type KubernetesClusterCredentialsGetRequest struct { - ExpirySeconds *int `json:"expiry_seconds,omitempty"` -} - -// KubernetesCluster represents a Kubernetes cluster. -type KubernetesCluster struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - RegionSlug string `json:"region,omitempty"` - VersionSlug string `json:"version,omitempty"` - ClusterSubnet string `json:"cluster_subnet,omitempty"` - ServiceSubnet string `json:"service_subnet,omitempty"` - IPv4 string `json:"ipv4,omitempty"` - Endpoint string `json:"endpoint,omitempty"` - Tags []string `json:"tags,omitempty"` - VPCUUID string `json:"vpc_uuid,omitempty"` - - NodePools []*KubernetesNodePool `json:"node_pools,omitempty"` - - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` - AutoUpgrade bool `json:"auto_upgrade,omitempty"` - - Status *KubernetesClusterStatus `json:"status,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - UpdatedAt time.Time `json:"updated_at,omitempty"` -} - -// KubernetesClusterUser represents a Kubernetes cluster user. -type KubernetesClusterUser struct { - Username string `json:"username,omitempty"` - Groups []string `json:"groups,omitempty"` -} - -// KubernetesClusterCredentials represents Kubernetes cluster credentials. -type KubernetesClusterCredentials struct { - Server string `json:"server"` - CertificateAuthorityData []byte `json:"certificate_authority_data"` - ClientCertificateData []byte `json:"client_certificate_data"` - ClientKeyData []byte `json:"client_key_data"` - Token string `json:"token"` - ExpiresAt time.Time `json:"expires_at"` -} - -// KubernetesMaintenancePolicy is a configuration to set the maintenance window -// of a cluster -type KubernetesMaintenancePolicy struct { - StartTime string `json:"start_time"` - Duration string `json:"duration"` - Day KubernetesMaintenancePolicyDay `json:"day"` -} - -// KubernetesMaintenancePolicyDay represents the possible days of a maintenance -// window -type KubernetesMaintenancePolicyDay int - -const ( - KubernetesMaintenanceDayAny KubernetesMaintenancePolicyDay = iota - KubernetesMaintenanceDayMonday - KubernetesMaintenanceDayTuesday - KubernetesMaintenanceDayWednesday - KubernetesMaintenanceDayThursday - KubernetesMaintenanceDayFriday - KubernetesMaintenanceDaySaturday - KubernetesMaintenanceDaySunday -) - -var ( - days = [...]string{ - "any", - "monday", - "tuesday", - "wednesday", - "thursday", - "friday", - "saturday", - "sunday", - } - - toDay = map[string]KubernetesMaintenancePolicyDay{ - "any": KubernetesMaintenanceDayAny, - "monday": KubernetesMaintenanceDayMonday, - "tuesday": KubernetesMaintenanceDayTuesday, - "wednesday": KubernetesMaintenanceDayWednesday, - "thursday": KubernetesMaintenanceDayThursday, - "friday": KubernetesMaintenanceDayFriday, - "saturday": KubernetesMaintenanceDaySaturday, - "sunday": KubernetesMaintenanceDaySunday, - } -) - -// KubernetesMaintenanceToDay returns the appropriate KubernetesMaintenancePolicyDay for the given string. -func KubernetesMaintenanceToDay(day string) (KubernetesMaintenancePolicyDay, error) { - d, ok := toDay[day] - if !ok { - return 0, fmt.Errorf("unknown day: %q", day) - } - - return d, nil -} - -func (k KubernetesMaintenancePolicyDay) String() string { - if KubernetesMaintenanceDayAny <= k && k <= KubernetesMaintenanceDaySunday { - return days[k] - } - return fmt.Sprintf("%d !Weekday", k) - -} - -func (k *KubernetesMaintenancePolicyDay) UnmarshalJSON(data []byte) error { - var val string - if err := json.Unmarshal(data, &val); err != nil { - return err - } - - parsed, err := KubernetesMaintenanceToDay(val) - if err != nil { - return err - } - *k = parsed - return nil -} - -func (k KubernetesMaintenancePolicyDay) MarshalJSON() ([]byte, error) { - if KubernetesMaintenanceDayAny <= k && k <= KubernetesMaintenanceDaySunday { - return json.Marshal(days[k]) - } - - return nil, fmt.Errorf("invalid day: %d", k) -} - -// Possible states for a cluster. -const ( - KubernetesClusterStatusProvisioning = KubernetesClusterStatusState("provisioning") - KubernetesClusterStatusRunning = KubernetesClusterStatusState("running") - KubernetesClusterStatusDegraded = KubernetesClusterStatusState("degraded") - KubernetesClusterStatusError = KubernetesClusterStatusState("error") - KubernetesClusterStatusDeleted = KubernetesClusterStatusState("deleted") - KubernetesClusterStatusUpgrading = KubernetesClusterStatusState("upgrading") - KubernetesClusterStatusInvalid = KubernetesClusterStatusState("invalid") -) - -// KubernetesClusterStatusState represents states for a cluster. -type KubernetesClusterStatusState string - -var _ encoding.TextUnmarshaler = (*KubernetesClusterStatusState)(nil) - -// UnmarshalText unmarshals the state. -func (s *KubernetesClusterStatusState) UnmarshalText(text []byte) error { - switch KubernetesClusterStatusState(strings.ToLower(string(text))) { - case KubernetesClusterStatusProvisioning: - *s = KubernetesClusterStatusProvisioning - case KubernetesClusterStatusRunning: - *s = KubernetesClusterStatusRunning - case KubernetesClusterStatusDegraded: - *s = KubernetesClusterStatusDegraded - case KubernetesClusterStatusError: - *s = KubernetesClusterStatusError - case KubernetesClusterStatusDeleted: - *s = KubernetesClusterStatusDeleted - case KubernetesClusterStatusUpgrading: - *s = KubernetesClusterStatusUpgrading - case "", KubernetesClusterStatusInvalid: - *s = KubernetesClusterStatusInvalid - default: - return fmt.Errorf("unknown cluster state %q", string(text)) - } - return nil -} - -// KubernetesClusterStatus describes the status of a cluster. -type KubernetesClusterStatus struct { - State KubernetesClusterStatusState `json:"state,omitempty"` - Message string `json:"message,omitempty"` -} - -// KubernetesNodePool represents a node pool in a Kubernetes cluster. -type KubernetesNodePool struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Size string `json:"size,omitempty"` - Count int `json:"count,omitempty"` - Tags []string `json:"tags,omitempty"` - AutoScale bool `json:"auto_scale,omitempty"` - MinNodes int `json:"min_nodes,omitempty"` - MaxNodes int `json:"max_nodes,omitempty"` - - Nodes []*KubernetesNode `json:"nodes,omitempty"` -} - -// KubernetesNode represents a Node in a node pool in a Kubernetes cluster. -type KubernetesNode struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Status *KubernetesNodeStatus `json:"status,omitempty"` - DropletID string `json:"droplet_id,omitempty"` - - CreatedAt time.Time `json:"created_at,omitempty"` - UpdatedAt time.Time `json:"updated_at,omitempty"` -} - -// KubernetesNodeStatus represents the status of a particular Node in a Kubernetes cluster. -type KubernetesNodeStatus struct { - State string `json:"state,omitempty"` - Message string `json:"message,omitempty"` -} - -// KubernetesOptions represents options available for creating Kubernetes clusters. -type KubernetesOptions struct { - Versions []*KubernetesVersion `json:"versions,omitempty"` - Regions []*KubernetesRegion `json:"regions,omitempty"` - Sizes []*KubernetesNodeSize `json:"sizes,omitempty"` -} - -// KubernetesVersion is a DigitalOcean Kubernetes release. -type KubernetesVersion struct { - Slug string `json:"slug,omitempty"` - KubernetesVersion string `json:"kubernetes_version,omitempty"` -} - -// KubernetesNodeSize is a node sizes supported for Kubernetes clusters. -type KubernetesNodeSize struct { - Name string `json:"name"` - Slug string `json:"slug"` -} - -// KubernetesRegion is a region usable by Kubernetes clusters. -type KubernetesRegion struct { - Name string `json:"name"` - Slug string `json:"slug"` -} - -type kubernetesClustersRoot struct { - Clusters []*KubernetesCluster `json:"kubernetes_clusters,omitempty"` - Links *Links `json:"links,omitempty"` - Meta *Meta `json:"meta"` -} - -type kubernetesClusterRoot struct { - Cluster *KubernetesCluster `json:"kubernetes_cluster,omitempty"` -} - -type kubernetesClusterUserRoot struct { - User *KubernetesClusterUser `json:"kubernetes_cluster_user,omitempty"` -} - -type kubernetesNodePoolRoot struct { - NodePool *KubernetesNodePool `json:"node_pool,omitempty"` -} - -type kubernetesNodePoolsRoot struct { - NodePools []*KubernetesNodePool `json:"node_pools,omitempty"` - Links *Links `json:"links,omitempty"` -} - -type kubernetesUpgradesRoot struct { - AvailableUpgradeVersions []*KubernetesVersion `json:"available_upgrade_versions,omitempty"` -} - -// Get retrieves the details of a Kubernetes cluster. -func (svc *KubernetesServiceOp) Get(ctx context.Context, clusterID string) (*KubernetesCluster, *Response, error) { - path := fmt.Sprintf("%s/%s", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesClusterRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Cluster, resp, nil -} - -// GetUser retrieves the details of a Kubernetes cluster user. -func (svc *KubernetesServiceOp) GetUser(ctx context.Context, clusterID string) (*KubernetesClusterUser, *Response, error) { - path := fmt.Sprintf("%s/%s/user", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesClusterUserRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.User, resp, nil -} - -// GetUpgrades retrieves versions a Kubernetes cluster can be upgraded to. An -// upgrade can be requested using `Upgrade`. -func (svc *KubernetesServiceOp) GetUpgrades(ctx context.Context, clusterID string) ([]*KubernetesVersion, *Response, error) { - path := fmt.Sprintf("%s/%s/upgrades", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesUpgradesRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, nil, err - } - return root.AvailableUpgradeVersions, resp, nil -} - -// Create creates a Kubernetes cluster. -func (svc *KubernetesServiceOp) Create(ctx context.Context, create *KubernetesClusterCreateRequest) (*KubernetesCluster, *Response, error) { - path := kubernetesClustersPath - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, create) - if err != nil { - return nil, nil, err - } - root := new(kubernetesClusterRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Cluster, resp, nil -} - -// Delete deletes a Kubernetes cluster. There is no way to recover a cluster -// once it has been destroyed. -func (svc *KubernetesServiceOp) Delete(ctx context.Context, clusterID string) (*Response, error) { - path := fmt.Sprintf("%s/%s", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// List returns a list of the Kubernetes clusters visible with the caller's API token. -func (svc *KubernetesServiceOp) List(ctx context.Context, opts *ListOptions) ([]*KubernetesCluster, *Response, error) { - path := kubernetesClustersPath - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesClustersRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Clusters, resp, nil -} - -// KubernetesClusterConfig is the content of a Kubernetes config file, which can be -// used to interact with your Kubernetes cluster using `kubectl`. -// See: https://kubernetes.io/docs/tasks/tools/install-kubectl/ -type KubernetesClusterConfig struct { - KubeconfigYAML []byte -} - -// GetKubeConfig returns a Kubernetes config file for the specified cluster. -func (svc *KubernetesServiceOp) GetKubeConfig(ctx context.Context, clusterID string) (*KubernetesClusterConfig, *Response, error) { - path := fmt.Sprintf("%s/%s/kubeconfig", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - configBytes := bytes.NewBuffer(nil) - resp, err := svc.client.Do(ctx, req, configBytes) - if err != nil { - return nil, resp, err - } - res := &KubernetesClusterConfig{ - KubeconfigYAML: configBytes.Bytes(), - } - return res, resp, nil -} - -// GetCredentials returns a Kubernetes API server credentials for the specified cluster. -func (svc *KubernetesServiceOp) GetCredentials(ctx context.Context, clusterID string, get *KubernetesClusterCredentialsGetRequest) (*KubernetesClusterCredentials, *Response, error) { - path := fmt.Sprintf("%s/%s/credentials", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - q := req.URL.Query() - if get.ExpirySeconds != nil { - q.Add("expiry_seconds", strconv.Itoa(*get.ExpirySeconds)) - } - credentials := new(KubernetesClusterCredentials) - resp, err := svc.client.Do(ctx, req, credentials) - if err != nil { - return nil, nil, err - } - return credentials, resp, nil -} - -// Update updates a Kubernetes cluster's properties. -func (svc *KubernetesServiceOp) Update(ctx context.Context, clusterID string, update *KubernetesClusterUpdateRequest) (*KubernetesCluster, *Response, error) { - path := fmt.Sprintf("%s/%s", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, update) - if err != nil { - return nil, nil, err - } - root := new(kubernetesClusterRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Cluster, resp, nil -} - -// Upgrade upgrades a Kubernetes cluster to a new version. Valid upgrade -// versions for a given cluster can be retrieved with `GetUpgrades`. -func (svc *KubernetesServiceOp) Upgrade(ctx context.Context, clusterID string, upgrade *KubernetesClusterUpgradeRequest) (*Response, error) { - path := fmt.Sprintf("%s/%s/upgrade", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, upgrade) - if err != nil { - return nil, err - } - return svc.client.Do(ctx, req, nil) -} - -// CreateNodePool creates a new node pool in an existing Kubernetes cluster. -func (svc *KubernetesServiceOp) CreateNodePool(ctx context.Context, clusterID string, create *KubernetesNodePoolCreateRequest) (*KubernetesNodePool, *Response, error) { - path := fmt.Sprintf("%s/%s/node_pools", kubernetesClustersPath, clusterID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, create) - if err != nil { - return nil, nil, err - } - root := new(kubernetesNodePoolRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.NodePool, resp, nil -} - -// GetNodePool retrieves an existing node pool in a Kubernetes cluster. -func (svc *KubernetesServiceOp) GetNodePool(ctx context.Context, clusterID, poolID string) (*KubernetesNodePool, *Response, error) { - path := fmt.Sprintf("%s/%s/node_pools/%s", kubernetesClustersPath, clusterID, poolID) - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesNodePoolRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.NodePool, resp, nil -} - -// ListNodePools lists all the node pools found in a Kubernetes cluster. -func (svc *KubernetesServiceOp) ListNodePools(ctx context.Context, clusterID string, opts *ListOptions) ([]*KubernetesNodePool, *Response, error) { - path := fmt.Sprintf("%s/%s/node_pools", kubernetesClustersPath, clusterID) - path, err := addOptions(path, opts) - if err != nil { - return nil, nil, err - } - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesNodePoolsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.NodePools, resp, nil -} - -// UpdateNodePool updates the details of an existing node pool. -func (svc *KubernetesServiceOp) UpdateNodePool(ctx context.Context, clusterID, poolID string, update *KubernetesNodePoolUpdateRequest) (*KubernetesNodePool, *Response, error) { - path := fmt.Sprintf("%s/%s/node_pools/%s", kubernetesClustersPath, clusterID, poolID) - req, err := svc.client.NewRequest(ctx, http.MethodPut, path, update) - if err != nil { - return nil, nil, err - } - root := new(kubernetesNodePoolRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.NodePool, resp, nil -} - -// RecycleNodePoolNodes is DEPRECATED please use DeleteNode -// The method will be removed in godo 2.0. -func (svc *KubernetesServiceOp) RecycleNodePoolNodes(ctx context.Context, clusterID, poolID string, recycle *KubernetesNodePoolRecycleNodesRequest) (*Response, error) { - path := fmt.Sprintf("%s/%s/node_pools/%s/recycle", kubernetesClustersPath, clusterID, poolID) - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, recycle) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// DeleteNodePool deletes a node pool, and subsequently all the nodes in that pool. -func (svc *KubernetesServiceOp) DeleteNodePool(ctx context.Context, clusterID, poolID string) (*Response, error) { - path := fmt.Sprintf("%s/%s/node_pools/%s", kubernetesClustersPath, clusterID, poolID) - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// DeleteNode deletes a specific node in a node pool. -func (svc *KubernetesServiceOp) DeleteNode(ctx context.Context, clusterID, poolID, nodeID string, deleteReq *KubernetesNodeDeleteRequest) (*Response, error) { - path := fmt.Sprintf("%s/%s/node_pools/%s/nodes/%s", kubernetesClustersPath, clusterID, poolID, nodeID) - if deleteReq != nil { - v := make(url.Values) - if deleteReq.SkipDrain { - v.Set("skip_drain", "1") - } - if deleteReq.Replace { - v.Set("replace", "1") - } - if query := v.Encode(); query != "" { - path = path + "?" + query - } - } - - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -type kubernetesOptionsRoot struct { - Options *KubernetesOptions `json:"options,omitempty"` - Links *Links `json:"links,omitempty"` -} - -// GetOptions returns options about the Kubernetes service, such as the versions available for -// cluster creation. -func (svc *KubernetesServiceOp) GetOptions(ctx context.Context) (*KubernetesOptions, *Response, error) { - path := kubernetesOptionsPath - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - root := new(kubernetesOptionsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Options, resp, nil -} diff --git a/vendor/github.com/digitalocean/godo/links.go b/vendor/github.com/digitalocean/godo/links.go deleted file mode 100644 index 6f350bf9..00000000 --- a/vendor/github.com/digitalocean/godo/links.go +++ /dev/null @@ -1,83 +0,0 @@ -package godo - -import ( - "context" - "net/url" - "strconv" -) - -// Links manages links that are returned along with a List -type Links struct { - Pages *Pages `json:"pages,omitempty"` - Actions []LinkAction `json:"actions,omitempty"` -} - -// Pages are pages specified in Links -type Pages struct { - First string `json:"first,omitempty"` - Prev string `json:"prev,omitempty"` - Last string `json:"last,omitempty"` - Next string `json:"next,omitempty"` -} - -// LinkAction is a pointer to an action -type LinkAction struct { - ID int `json:"id,omitempty"` - Rel string `json:"rel,omitempty"` - HREF string `json:"href,omitempty"` -} - -// CurrentPage is current page of the list -func (l *Links) CurrentPage() (int, error) { - return l.Pages.current() -} - -func (p *Pages) current() (int, error) { - switch { - case p == nil: - return 1, nil - case p.Prev == "" && p.Next != "": - return 1, nil - case p.Prev != "": - prevPage, err := pageForURL(p.Prev) - if err != nil { - return 0, err - } - - return prevPage + 1, nil - } - - return 0, nil -} - -// IsLastPage returns true if the current page is the last -func (l *Links) IsLastPage() bool { - if l.Pages == nil { - return true - } - return l.Pages.isLast() -} - -func (p *Pages) isLast() bool { - return p.Next == "" -} - -func pageForURL(urlText string) (int, error) { - u, err := url.ParseRequestURI(urlText) - if err != nil { - return 0, err - } - - pageStr := u.Query().Get("page") - page, err := strconv.Atoi(pageStr) - if err != nil { - return 0, err - } - - return page, nil -} - -// Get a link action by id. -func (la *LinkAction) Get(ctx context.Context, client *Client) (*Action, *Response, error) { - return client.Actions.Get(ctx, la.ID) -} diff --git a/vendor/github.com/digitalocean/godo/load_balancers.go b/vendor/github.com/digitalocean/godo/load_balancers.go deleted file mode 100644 index b5c1731b..00000000 --- a/vendor/github.com/digitalocean/godo/load_balancers.go +++ /dev/null @@ -1,321 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const loadBalancersBasePath = "/v2/load_balancers" -const forwardingRulesPath = "forwarding_rules" - -const dropletsPath = "droplets" - -// LoadBalancersService is an interface for managing load balancers with the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2#load-balancers -type LoadBalancersService interface { - Get(context.Context, string) (*LoadBalancer, *Response, error) - List(context.Context, *ListOptions) ([]LoadBalancer, *Response, error) - Create(context.Context, *LoadBalancerRequest) (*LoadBalancer, *Response, error) - Update(ctx context.Context, lbID string, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error) - Delete(ctx context.Context, lbID string) (*Response, error) - AddDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error) - RemoveDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error) - AddForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error) - RemoveForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error) -} - -// LoadBalancer represents a DigitalOcean load balancer configuration. -// Tags can only be provided upon the creation of a Load Balancer. -type LoadBalancer struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - IP string `json:"ip,omitempty"` - Algorithm string `json:"algorithm,omitempty"` - Status string `json:"status,omitempty"` - Created string `json:"created_at,omitempty"` - ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` - HealthCheck *HealthCheck `json:"health_check,omitempty"` - StickySessions *StickySessions `json:"sticky_sessions,omitempty"` - Region *Region `json:"region,omitempty"` - DropletIDs []int `json:"droplet_ids,omitempty"` - Tag string `json:"tag,omitempty"` - Tags []string `json:"tags,omitempty"` - RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"` - EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` - VPCUUID string `json:"vpc_uuid,omitempty"` -} - -// String creates a human-readable description of a LoadBalancer. -func (l LoadBalancer) String() string { - return Stringify(l) -} - -func (l LoadBalancer) URN() string { - return ToURN("LoadBalancer", l.ID) -} - -// AsRequest creates a LoadBalancerRequest that can be submitted to Update with the current values of the LoadBalancer. -// Modifying the returned LoadBalancerRequest will not modify the original LoadBalancer. -func (l LoadBalancer) AsRequest() *LoadBalancerRequest { - r := LoadBalancerRequest{ - Name: l.Name, - Algorithm: l.Algorithm, - ForwardingRules: append([]ForwardingRule(nil), l.ForwardingRules...), - DropletIDs: append([]int(nil), l.DropletIDs...), - Tag: l.Tag, - RedirectHttpToHttps: l.RedirectHttpToHttps, - EnableProxyProtocol: l.EnableProxyProtocol, - HealthCheck: l.HealthCheck, - VPCUUID: l.VPCUUID, - } - - if l.HealthCheck != nil { - r.HealthCheck = &HealthCheck{} - *r.HealthCheck = *l.HealthCheck - } - if l.StickySessions != nil { - r.StickySessions = &StickySessions{} - *r.StickySessions = *l.StickySessions - } - if l.Region != nil { - r.Region = l.Region.Slug - } - return &r -} - -// ForwardingRule represents load balancer forwarding rules. -type ForwardingRule struct { - EntryProtocol string `json:"entry_protocol,omitempty"` - EntryPort int `json:"entry_port,omitempty"` - TargetProtocol string `json:"target_protocol,omitempty"` - TargetPort int `json:"target_port,omitempty"` - CertificateID string `json:"certificate_id,omitempty"` - TlsPassthrough bool `json:"tls_passthrough,omitempty"` -} - -// String creates a human-readable description of a ForwardingRule. -func (f ForwardingRule) String() string { - return Stringify(f) -} - -// HealthCheck represents optional load balancer health check rules. -type HealthCheck struct { - Protocol string `json:"protocol,omitempty"` - Port int `json:"port,omitempty"` - Path string `json:"path,omitempty"` - CheckIntervalSeconds int `json:"check_interval_seconds,omitempty"` - ResponseTimeoutSeconds int `json:"response_timeout_seconds,omitempty"` - HealthyThreshold int `json:"healthy_threshold,omitempty"` - UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"` -} - -// String creates a human-readable description of a HealthCheck. -func (h HealthCheck) String() string { - return Stringify(h) -} - -// StickySessions represents optional load balancer session affinity rules. -type StickySessions struct { - Type string `json:"type,omitempty"` - CookieName string `json:"cookie_name,omitempty"` - CookieTtlSeconds int `json:"cookie_ttl_seconds,omitempty"` -} - -// String creates a human-readable description of a StickySessions instance. -func (s StickySessions) String() string { - return Stringify(s) -} - -// LoadBalancerRequest represents the configuration to be applied to an existing or a new load balancer. -type LoadBalancerRequest struct { - Name string `json:"name,omitempty"` - Algorithm string `json:"algorithm,omitempty"` - Region string `json:"region,omitempty"` - ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` - HealthCheck *HealthCheck `json:"health_check,omitempty"` - StickySessions *StickySessions `json:"sticky_sessions,omitempty"` - DropletIDs []int `json:"droplet_ids,omitempty"` - Tag string `json:"tag,omitempty"` - Tags []string `json:"tags,omitempty"` - RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"` - EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` - VPCUUID string `json:"vpc_uuid,omitempty"` -} - -// String creates a human-readable description of a LoadBalancerRequest. -func (l LoadBalancerRequest) String() string { - return Stringify(l) -} - -type forwardingRulesRequest struct { - Rules []ForwardingRule `json:"forwarding_rules,omitempty"` -} - -func (l forwardingRulesRequest) String() string { - return Stringify(l) -} - -type dropletIDsRequest struct { - IDs []int `json:"droplet_ids,omitempty"` -} - -func (l dropletIDsRequest) String() string { - return Stringify(l) -} - -type loadBalancersRoot struct { - LoadBalancers []LoadBalancer `json:"load_balancers"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type loadBalancerRoot struct { - LoadBalancer *LoadBalancer `json:"load_balancer"` -} - -// LoadBalancersServiceOp handles communication with load balancer-related methods of the DigitalOcean API. -type LoadBalancersServiceOp struct { - client *Client -} - -var _ LoadBalancersService = &LoadBalancersServiceOp{} - -// Get an existing load balancer by its identifier. -func (l *LoadBalancersServiceOp) Get(ctx context.Context, lbID string) (*LoadBalancer, *Response, error) { - path := fmt.Sprintf("%s/%s", loadBalancersBasePath, lbID) - - req, err := l.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(loadBalancerRoot) - resp, err := l.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.LoadBalancer, resp, err -} - -// List load balancers, with optional pagination. -func (l *LoadBalancersServiceOp) List(ctx context.Context, opt *ListOptions) ([]LoadBalancer, *Response, error) { - path, err := addOptions(loadBalancersBasePath, opt) - if err != nil { - return nil, nil, err - } - - req, err := l.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(loadBalancersRoot) - resp, err := l.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.LoadBalancers, resp, err -} - -// Create a new load balancer with a given configuration. -func (l *LoadBalancersServiceOp) Create(ctx context.Context, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error) { - req, err := l.client.NewRequest(ctx, http.MethodPost, loadBalancersBasePath, lbr) - if err != nil { - return nil, nil, err - } - - root := new(loadBalancerRoot) - resp, err := l.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.LoadBalancer, resp, err -} - -// Update an existing load balancer with new configuration. -func (l *LoadBalancersServiceOp) Update(ctx context.Context, lbID string, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error) { - path := fmt.Sprintf("%s/%s", loadBalancersBasePath, lbID) - - req, err := l.client.NewRequest(ctx, "PUT", path, lbr) - if err != nil { - return nil, nil, err - } - - root := new(loadBalancerRoot) - resp, err := l.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.LoadBalancer, resp, err -} - -// Delete a load balancer by its identifier. -func (l *LoadBalancersServiceOp) Delete(ctx context.Context, ldID string) (*Response, error) { - path := fmt.Sprintf("%s/%s", loadBalancersBasePath, ldID) - - req, err := l.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - return l.client.Do(ctx, req, nil) -} - -// AddDroplets adds droplets to a load balancer. -func (l *LoadBalancersServiceOp) AddDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error) { - path := fmt.Sprintf("%s/%s/%s", loadBalancersBasePath, lbID, dropletsPath) - - req, err := l.client.NewRequest(ctx, http.MethodPost, path, &dropletIDsRequest{IDs: dropletIDs}) - if err != nil { - return nil, err - } - - return l.client.Do(ctx, req, nil) -} - -// RemoveDroplets removes droplets from a load balancer. -func (l *LoadBalancersServiceOp) RemoveDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error) { - path := fmt.Sprintf("%s/%s/%s", loadBalancersBasePath, lbID, dropletsPath) - - req, err := l.client.NewRequest(ctx, http.MethodDelete, path, &dropletIDsRequest{IDs: dropletIDs}) - if err != nil { - return nil, err - } - - return l.client.Do(ctx, req, nil) -} - -// AddForwardingRules adds forwarding rules to a load balancer. -func (l *LoadBalancersServiceOp) AddForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error) { - path := fmt.Sprintf("%s/%s/%s", loadBalancersBasePath, lbID, forwardingRulesPath) - - req, err := l.client.NewRequest(ctx, http.MethodPost, path, &forwardingRulesRequest{Rules: rules}) - if err != nil { - return nil, err - } - - return l.client.Do(ctx, req, nil) -} - -// RemoveForwardingRules removes forwarding rules from a load balancer. -func (l *LoadBalancersServiceOp) RemoveForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error) { - path := fmt.Sprintf("%s/%s/%s", loadBalancersBasePath, lbID, forwardingRulesPath) - - req, err := l.client.NewRequest(ctx, http.MethodDelete, path, &forwardingRulesRequest{Rules: rules}) - if err != nil { - return nil, err - } - - return l.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/digitalocean/godo/meta.go b/vendor/github.com/digitalocean/godo/meta.go deleted file mode 100644 index d0b70178..00000000 --- a/vendor/github.com/digitalocean/godo/meta.go +++ /dev/null @@ -1,6 +0,0 @@ -package godo - -// Meta describes generic information about a response. -type Meta struct { - Total int `json:"total"` -} diff --git a/vendor/github.com/digitalocean/godo/projects.go b/vendor/github.com/digitalocean/godo/projects.go deleted file mode 100644 index 172c2c9e..00000000 --- a/vendor/github.com/digitalocean/godo/projects.go +++ /dev/null @@ -1,310 +0,0 @@ -package godo - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "path" -) - -const ( - // DefaultProject is the ID you should use if you are working with your - // default project. - DefaultProject = "default" - - projectsBasePath = "/v2/projects" -) - -// ProjectsService is an interface for creating and managing Projects with the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2/#projects -type ProjectsService interface { - List(context.Context, *ListOptions) ([]Project, *Response, error) - GetDefault(context.Context) (*Project, *Response, error) - Get(context.Context, string) (*Project, *Response, error) - Create(context.Context, *CreateProjectRequest) (*Project, *Response, error) - Update(context.Context, string, *UpdateProjectRequest) (*Project, *Response, error) - Delete(context.Context, string) (*Response, error) - - ListResources(context.Context, string, *ListOptions) ([]ProjectResource, *Response, error) - AssignResources(context.Context, string, ...interface{}) ([]ProjectResource, *Response, error) -} - -// ProjectsServiceOp handles communication with Projects methods of the DigitalOcean API. -type ProjectsServiceOp struct { - client *Client -} - -// Project represents a DigitalOcean Project configuration. -type Project struct { - ID string `json:"id"` - OwnerUUID string `json:"owner_uuid"` - OwnerID uint64 `json:"owner_id"` - Name string `json:"name"` - Description string `json:"description"` - Purpose string `json:"purpose"` - Environment string `json:"environment"` - IsDefault bool `json:"is_default"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` -} - -// String creates a human-readable description of a Project. -func (p Project) String() string { - return Stringify(p) -} - -// CreateProjectRequest represents the request to create a new project. -type CreateProjectRequest struct { - Name string `json:"name"` - Description string `json:"description"` - Purpose string `json:"purpose"` - Environment string `json:"environment"` -} - -// UpdateProjectRequest represents the request to update project information. -// This type expects certain attribute types, but is built this way to allow -// nil values as well. See `updateProjectRequest` for the "real" types. -type UpdateProjectRequest struct { - Name interface{} - Description interface{} - Purpose interface{} - Environment interface{} - IsDefault interface{} -} - -type updateProjectRequest struct { - Name *string `json:"name"` - Description *string `json:"description"` - Purpose *string `json:"purpose"` - Environment *string `json:"environment"` - IsDefault *bool `json:"is_default"` -} - -// MarshalJSON takes an UpdateRequest and converts it to the "typed" request -// which is sent to the projects API. This is a PATCH request, which allows -// partial attributes, so `null` values are OK. -func (upr *UpdateProjectRequest) MarshalJSON() ([]byte, error) { - d := &updateProjectRequest{} - if str, ok := upr.Name.(string); ok { - d.Name = &str - } - if str, ok := upr.Description.(string); ok { - d.Description = &str - } - if str, ok := upr.Purpose.(string); ok { - d.Purpose = &str - } - if str, ok := upr.Environment.(string); ok { - d.Environment = &str - } - if val, ok := upr.IsDefault.(bool); ok { - d.IsDefault = &val - } - - return json.Marshal(d) -} - -type assignResourcesRequest struct { - Resources []string `json:"resources"` -} - -// ProjectResource is the projects API's representation of a resource. -type ProjectResource struct { - URN string `json:"urn"` - AssignedAt string `json:"assigned_at"` - Links *ProjectResourceLinks `json:"links"` - Status string `json:"status,omitempty"` -} - -// ProjetResourceLinks specify the link for more information about the resource. -type ProjectResourceLinks struct { - Self string `json:"self"` -} - -type projectsRoot struct { - Projects []Project `json:"projects"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type projectRoot struct { - Project *Project `json:"project"` -} - -type projectResourcesRoot struct { - Resources []ProjectResource `json:"resources"` - Links *Links `json:"links,omitempty"` - Meta *Meta `json:"meta"` -} - -var _ ProjectsService = &ProjectsServiceOp{} - -// List Projects. -func (p *ProjectsServiceOp) List(ctx context.Context, opts *ListOptions) ([]Project, *Response, error) { - path, err := addOptions(projectsBasePath, opts) - if err != nil { - return nil, nil, err - } - - req, err := p.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(projectsRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Projects, resp, err -} - -// GetDefault project. -func (p *ProjectsServiceOp) GetDefault(ctx context.Context) (*Project, *Response, error) { - return p.getHelper(ctx, "default") -} - -// Get retrieves a single project by its ID. -func (p *ProjectsServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error) { - return p.getHelper(ctx, projectID) -} - -// Create a new project. -func (p *ProjectsServiceOp) Create(ctx context.Context, cr *CreateProjectRequest) (*Project, *Response, error) { - req, err := p.client.NewRequest(ctx, http.MethodPost, projectsBasePath, cr) - if err != nil { - return nil, nil, err - } - - root := new(projectRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Project, resp, err -} - -// Update an existing project. -func (p *ProjectsServiceOp) Update(ctx context.Context, projectID string, ur *UpdateProjectRequest) (*Project, *Response, error) { - path := path.Join(projectsBasePath, projectID) - req, err := p.client.NewRequest(ctx, http.MethodPatch, path, ur) - if err != nil { - return nil, nil, err - } - - root := new(projectRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Project, resp, err -} - -// Delete an existing project. You cannot have any resources in a project -// before deleting it. See the API documentation for more details. -func (p *ProjectsServiceOp) Delete(ctx context.Context, projectID string) (*Response, error) { - path := path.Join(projectsBasePath, projectID) - req, err := p.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - return p.client.Do(ctx, req, nil) -} - -// ListResources lists all resources in a project. -func (p *ProjectsServiceOp) ListResources(ctx context.Context, projectID string, opts *ListOptions) ([]ProjectResource, *Response, error) { - basePath := path.Join(projectsBasePath, projectID, "resources") - path, err := addOptions(basePath, opts) - if err != nil { - return nil, nil, err - } - - req, err := p.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(projectResourcesRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Resources, resp, err -} - -// AssignResources assigns one or more resources to a project. AssignResources -// accepts resources in two possible formats: - -// 1. The resource type, like `&Droplet{ID: 1}` or `&FloatingIP{IP: "1.2.3.4"}` -// 2. A valid DO URN as a string, like "do:droplet:1234" -// -// There is no unassign. To move a resource to another project, just assign -// it to that other project. -func (p *ProjectsServiceOp) AssignResources(ctx context.Context, projectID string, resources ...interface{}) ([]ProjectResource, *Response, error) { - path := path.Join(projectsBasePath, projectID, "resources") - - ar := &assignResourcesRequest{ - Resources: make([]string, len(resources)), - } - - for i, resource := range resources { - switch resource := resource.(type) { - case ResourceWithURN: - ar.Resources[i] = resource.URN() - case string: - ar.Resources[i] = resource - default: - return nil, nil, fmt.Errorf("%T must either be a string or have a valid URN method", resource) - } - } - req, err := p.client.NewRequest(ctx, http.MethodPost, path, ar) - if err != nil { - return nil, nil, err - } - - root := new(projectResourcesRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.Resources, resp, err -} - -func (p *ProjectsServiceOp) getHelper(ctx context.Context, projectID string) (*Project, *Response, error) { - path := path.Join(projectsBasePath, projectID) - - req, err := p.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(projectRoot) - resp, err := p.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Project, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/regions.go b/vendor/github.com/digitalocean/godo/regions.go deleted file mode 100644 index b07175e8..00000000 --- a/vendor/github.com/digitalocean/godo/regions.go +++ /dev/null @@ -1,68 +0,0 @@ -package godo - -import ( - "context" - "net/http" -) - -// RegionsService is an interface for interfacing with the regions -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#regions -type RegionsService interface { - List(context.Context, *ListOptions) ([]Region, *Response, error) -} - -// RegionsServiceOp handles communication with the region related methods of the -// DigitalOcean API. -type RegionsServiceOp struct { - client *Client -} - -var _ RegionsService = &RegionsServiceOp{} - -// Region represents a DigitalOcean Region -type Region struct { - Slug string `json:"slug,omitempty"` - Name string `json:"name,omitempty"` - Sizes []string `json:"sizes,omitempty"` - Available bool `json:"available,omitempty"` - Features []string `json:"features,omitempty"` -} - -type regionsRoot struct { - Regions []Region - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -func (r Region) String() string { - return Stringify(r) -} - -// List all regions -func (s *RegionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Region, *Response, error) { - path := "v2/regions" - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(regionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Regions, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/registry.go b/vendor/github.com/digitalocean/godo/registry.go deleted file mode 100644 index 73719f16..00000000 --- a/vendor/github.com/digitalocean/godo/registry.go +++ /dev/null @@ -1,119 +0,0 @@ -package godo - -import ( - "bytes" - "context" - "fmt" - "net/http" -) - -const ( - registryPath = "/v2/registry" -) - -// RegistryService is an interface for interfacing with the Registry endpoints -// of the DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2#registry -type RegistryService interface { - Create(context.Context, *RegistryCreateRequest) (*Registry, *Response, error) - Get(context.Context) (*Registry, *Response, error) - Delete(context.Context) (*Response, error) - DockerCredentials(context.Context, *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error) -} - -var _ RegistryService = &RegistryServiceOp{} - -// RegistryServiceOp handles communication with Registry methods of the DigitalOcean API. -type RegistryServiceOp struct { - client *Client -} - -// RegistryCreateRequest represents a request to create a registry. -type RegistryCreateRequest struct { - Name string `json:"name,omitempty"` -} - -// RegistryDockerCredentialsRequest represents a request to retrieve docker -// credentials for a registry. -type RegistryDockerCredentialsRequest struct { - ReadWrite bool `json:"read_write"` -} - -// Registry represents a registry. -type Registry struct { - Name string `json:"name,omitempty"` -} - -type registryRoot struct { - Registry *Registry `json:"registry,omitempty"` -} - -// Get retrieves the details of a Registry. -func (svc *RegistryServiceOp) Get(ctx context.Context) (*Registry, *Response, error) { - req, err := svc.client.NewRequest(ctx, http.MethodGet, registryPath, nil) - if err != nil { - return nil, nil, err - } - root := new(registryRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Registry, resp, nil -} - -// Create creates a registry. -func (svc *RegistryServiceOp) Create(ctx context.Context, create *RegistryCreateRequest) (*Registry, *Response, error) { - req, err := svc.client.NewRequest(ctx, http.MethodPost, registryPath, create) - if err != nil { - return nil, nil, err - } - root := new(registryRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Registry, resp, nil -} - -// Delete deletes a registry. There is no way to recover a registry once it has -// been destroyed. -func (svc *RegistryServiceOp) Delete(ctx context.Context) (*Response, error) { - req, err := svc.client.NewRequest(ctx, http.MethodDelete, registryPath, nil) - if err != nil { - return nil, err - } - resp, err := svc.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - return resp, nil -} - -// DockerCredentials is the content of a Docker config file -// that is used by the docker CLI -// See: https://docs.docker.com/engine/reference/commandline/cli/#configjson-properties -type DockerCredentials struct { - DockerConfigJSON []byte -} - -// DockerCredentials retrieves a Docker config file containing the registry's credentials. -func (svc *RegistryServiceOp) DockerCredentials(ctx context.Context, request *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error) { - path := fmt.Sprintf("%s/%s?read_write=%t", registryPath, "docker-credentials", request.ReadWrite) - - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - var buf bytes.Buffer - resp, err := svc.client.Do(ctx, req, &buf) - if err != nil { - return nil, resp, err - } - - dc := &DockerCredentials{ - DockerConfigJSON: buf.Bytes(), - } - return dc, resp, nil -} diff --git a/vendor/github.com/digitalocean/godo/sizes.go b/vendor/github.com/digitalocean/godo/sizes.go deleted file mode 100644 index d2b93ea7..00000000 --- a/vendor/github.com/digitalocean/godo/sizes.go +++ /dev/null @@ -1,72 +0,0 @@ -package godo - -import ( - "context" - "net/http" -) - -// SizesService is an interface for interfacing with the size -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#sizes -type SizesService interface { - List(context.Context, *ListOptions) ([]Size, *Response, error) -} - -// SizesServiceOp handles communication with the size related methods of the -// DigitalOcean API. -type SizesServiceOp struct { - client *Client -} - -var _ SizesService = &SizesServiceOp{} - -// Size represents a DigitalOcean Size -type Size struct { - Slug string `json:"slug,omitempty"` - Memory int `json:"memory,omitempty"` - Vcpus int `json:"vcpus,omitempty"` - Disk int `json:"disk,omitempty"` - PriceMonthly float64 `json:"price_monthly,omitempty"` - PriceHourly float64 `json:"price_hourly,omitempty"` - Regions []string `json:"regions,omitempty"` - Available bool `json:"available,omitempty"` - Transfer float64 `json:"transfer,omitempty"` -} - -func (s Size) String() string { - return Stringify(s) -} - -type sizesRoot struct { - Sizes []Size - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// List all images -func (s *SizesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Size, *Response, error) { - path := "v2/sizes" - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(sizesRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Sizes, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/snapshots.go b/vendor/github.com/digitalocean/godo/snapshots.go deleted file mode 100644 index cf95ccc0..00000000 --- a/vendor/github.com/digitalocean/godo/snapshots.go +++ /dev/null @@ -1,142 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const snapshotBasePath = "v2/snapshots" - -// SnapshotsService is an interface for interfacing with the snapshots -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#snapshots -type SnapshotsService interface { - List(context.Context, *ListOptions) ([]Snapshot, *Response, error) - ListVolume(context.Context, *ListOptions) ([]Snapshot, *Response, error) - ListDroplet(context.Context, *ListOptions) ([]Snapshot, *Response, error) - Get(context.Context, string) (*Snapshot, *Response, error) - Delete(context.Context, string) (*Response, error) -} - -// SnapshotsServiceOp handles communication with the snapshot related methods of the -// DigitalOcean API. -type SnapshotsServiceOp struct { - client *Client -} - -var _ SnapshotsService = &SnapshotsServiceOp{} - -// Snapshot represents a DigitalOcean Snapshot -type Snapshot struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - ResourceID string `json:"resource_id,omitempty"` - ResourceType string `json:"resource_type,omitempty"` - Regions []string `json:"regions,omitempty"` - MinDiskSize int `json:"min_disk_size,omitempty"` - SizeGigaBytes float64 `json:"size_gigabytes,omitempty"` - Created string `json:"created_at,omitempty"` - Tags []string `json:"tags,omitempty"` -} - -type snapshotRoot struct { - Snapshot *Snapshot `json:"snapshot"` -} - -type snapshotsRoot struct { - Snapshots []Snapshot `json:"snapshots"` - Links *Links `json:"links,omitempty"` - Meta *Meta `json:"meta,omitempty"` -} - -type listSnapshotOptions struct { - ResourceType string `url:"resource_type,omitempty"` -} - -func (s Snapshot) String() string { - return Stringify(s) -} - -// List lists all the snapshots available. -func (s *SnapshotsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error) { - return s.list(ctx, opt, nil) -} - -// ListDroplet lists all the Droplet snapshots. -func (s *SnapshotsServiceOp) ListDroplet(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error) { - listOpt := listSnapshotOptions{ResourceType: "droplet"} - return s.list(ctx, opt, &listOpt) -} - -// ListVolume lists all the volume snapshots. -func (s *SnapshotsServiceOp) ListVolume(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error) { - listOpt := listSnapshotOptions{ResourceType: "volume"} - return s.list(ctx, opt, &listOpt) -} - -// Get retrieves an snapshot by id. -func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error) { - return s.get(ctx, snapshotID) -} - -// Delete an snapshot. -func (s *SnapshotsServiceOp) Delete(ctx context.Context, snapshotID string) (*Response, error) { - path := fmt.Sprintf("%s/%s", snapshotBasePath, snapshotID) - - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// Helper method for getting an individual snapshot -func (s *SnapshotsServiceOp) get(ctx context.Context, ID string) (*Snapshot, *Response, error) { - path := fmt.Sprintf("%s/%s", snapshotBasePath, ID) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(snapshotRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Snapshot, resp, err -} - -// Helper method for listing snapshots -func (s *SnapshotsServiceOp) list(ctx context.Context, opt *ListOptions, listOpt *listSnapshotOptions) ([]Snapshot, *Response, error) { - path := snapshotBasePath - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - path, err = addOptions(path, listOpt) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(snapshotsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - - return root.Snapshots, resp, err -} diff --git a/vendor/github.com/digitalocean/godo/storage.go b/vendor/github.com/digitalocean/godo/storage.go deleted file mode 100644 index e1dda598..00000000 --- a/vendor/github.com/digitalocean/godo/storage.go +++ /dev/null @@ -1,261 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" - "time" -) - -const ( - storageBasePath = "v2" - storageAllocPath = storageBasePath + "/volumes" - storageSnapPath = storageBasePath + "/snapshots" -) - -// StorageService is an interface for interfacing with the storage -// endpoints of the Digital Ocean API. -// See: https://developers.digitalocean.com/documentation/v2/#block-storage -type StorageService interface { - ListVolumes(context.Context, *ListVolumeParams) ([]Volume, *Response, error) - GetVolume(context.Context, string) (*Volume, *Response, error) - CreateVolume(context.Context, *VolumeCreateRequest) (*Volume, *Response, error) - DeleteVolume(context.Context, string) (*Response, error) - ListSnapshots(ctx context.Context, volumeID string, opts *ListOptions) ([]Snapshot, *Response, error) - GetSnapshot(context.Context, string) (*Snapshot, *Response, error) - CreateSnapshot(context.Context, *SnapshotCreateRequest) (*Snapshot, *Response, error) - DeleteSnapshot(context.Context, string) (*Response, error) -} - -// StorageServiceOp handles communication with the storage volumes related methods of the -// DigitalOcean API. -type StorageServiceOp struct { - client *Client -} - -// ListVolumeParams stores the options you can set for a ListVolumeCall -type ListVolumeParams struct { - Region string `json:"region"` - Name string `json:"name"` - ListOptions *ListOptions `json:"list_options,omitempty"` -} - -var _ StorageService = &StorageServiceOp{} - -// Volume represents a Digital Ocean block store volume. -type Volume struct { - ID string `json:"id"` - Region *Region `json:"region"` - Name string `json:"name"` - SizeGigaBytes int64 `json:"size_gigabytes"` - Description string `json:"description"` - DropletIDs []int `json:"droplet_ids"` - CreatedAt time.Time `json:"created_at"` - FilesystemType string `json:"filesystem_type"` - FilesystemLabel string `json:"filesystem_label"` - Tags []string `json:"tags"` -} - -func (f Volume) String() string { - return Stringify(f) -} - -func (f Volume) URN() string { - return ToURN("Volume", f.ID) -} - -type storageVolumesRoot struct { - Volumes []Volume `json:"volumes"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type storageVolumeRoot struct { - Volume *Volume `json:"volume"` - Links *Links `json:"links,omitempty"` -} - -// VolumeCreateRequest represents a request to create a block store -// volume. -type VolumeCreateRequest struct { - Region string `json:"region"` - Name string `json:"name"` - Description string `json:"description"` - SizeGigaBytes int64 `json:"size_gigabytes"` - SnapshotID string `json:"snapshot_id"` - FilesystemType string `json:"filesystem_type"` - FilesystemLabel string `json:"filesystem_label"` - Tags []string `json:"tags"` -} - -// ListVolumes lists all storage volumes. -func (svc *StorageServiceOp) ListVolumes(ctx context.Context, params *ListVolumeParams) ([]Volume, *Response, error) { - path := storageAllocPath - if params != nil { - if params.Region != "" && params.Name != "" { - path = fmt.Sprintf("%s?name=%s®ion=%s", path, params.Name, params.Region) - } else if params.Region != "" { - path = fmt.Sprintf("%s?region=%s", path, params.Region) - } else if params.Name != "" { - path = fmt.Sprintf("%s?name=%s", path, params.Name) - } - - if params.ListOptions != nil { - var err error - path, err = addOptions(path, params.ListOptions) - if err != nil { - return nil, nil, err - } - } - } - - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(storageVolumesRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Volumes, resp, nil -} - -// CreateVolume creates a storage volume. The name must be unique. -func (svc *StorageServiceOp) CreateVolume(ctx context.Context, createRequest *VolumeCreateRequest) (*Volume, *Response, error) { - path := storageAllocPath - - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(storageVolumeRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Volume, resp, nil -} - -// GetVolume retrieves an individual storage volume. -func (svc *StorageServiceOp) GetVolume(ctx context.Context, id string) (*Volume, *Response, error) { - path := fmt.Sprintf("%s/%s", storageAllocPath, id) - - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(storageVolumeRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Volume, resp, nil -} - -// DeleteVolume deletes a storage volume. -func (svc *StorageServiceOp) DeleteVolume(ctx context.Context, id string) (*Response, error) { - path := fmt.Sprintf("%s/%s", storageAllocPath, id) - - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - return svc.client.Do(ctx, req, nil) -} - -// SnapshotCreateRequest represents a request to create a block store -// volume. -type SnapshotCreateRequest struct { - VolumeID string `json:"volume_id"` - Name string `json:"name"` - Description string `json:"description"` - Tags []string `json:"tags"` -} - -// ListSnapshots lists all snapshots related to a storage volume. -func (svc *StorageServiceOp) ListSnapshots(ctx context.Context, volumeID string, opt *ListOptions) ([]Snapshot, *Response, error) { - path := fmt.Sprintf("%s/%s/snapshots", storageAllocPath, volumeID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(snapshotsRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Snapshots, resp, nil -} - -// CreateSnapshot creates a snapshot of a storage volume. -func (svc *StorageServiceOp) CreateSnapshot(ctx context.Context, createRequest *SnapshotCreateRequest) (*Snapshot, *Response, error) { - path := fmt.Sprintf("%s/%s/snapshots", storageAllocPath, createRequest.VolumeID) - - req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(snapshotRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - return root.Snapshot, resp, nil -} - -// GetSnapshot retrieves an individual snapshot. -func (svc *StorageServiceOp) GetSnapshot(ctx context.Context, id string) (*Snapshot, *Response, error) { - path := fmt.Sprintf("%s/%s", storageSnapPath, id) - - req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(snapshotRoot) - resp, err := svc.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Snapshot, resp, nil -} - -// DeleteSnapshot deletes a snapshot. -func (svc *StorageServiceOp) DeleteSnapshot(ctx context.Context, id string) (*Response, error) { - path := fmt.Sprintf("%s/%s", storageSnapPath, id) - - req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - return svc.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/digitalocean/godo/storage_actions.go b/vendor/github.com/digitalocean/godo/storage_actions.go deleted file mode 100644 index 234aba90..00000000 --- a/vendor/github.com/digitalocean/godo/storage_actions.go +++ /dev/null @@ -1,132 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -// StorageActionsService is an interface for interfacing with the -// storage actions endpoints of the Digital Ocean API. -// See: https://developers.digitalocean.com/documentation/v2#storage-actions -type StorageActionsService interface { - Attach(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error) - DetachByDropletID(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error) - Get(ctx context.Context, volumeID string, actionID int) (*Action, *Response, error) - List(ctx context.Context, volumeID string, opt *ListOptions) ([]Action, *Response, error) - Resize(ctx context.Context, volumeID string, sizeGigabytes int, regionSlug string) (*Action, *Response, error) -} - -// StorageActionsServiceOp handles communication with the storage volumes -// action related methods of the DigitalOcean API. -type StorageActionsServiceOp struct { - client *Client -} - -// StorageAttachment represents the attachement of a block storage -// volume to a specific Droplet under the device name. -type StorageAttachment struct { - DropletID int `json:"droplet_id"` -} - -// Attach a storage volume to a Droplet. -func (s *StorageActionsServiceOp) Attach(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error) { - request := &ActionRequest{ - "type": "attach", - "droplet_id": dropletID, - } - return s.doAction(ctx, volumeID, request) -} - -// DetachByDropletID a storage volume from a Droplet by Droplet ID. -func (s *StorageActionsServiceOp) DetachByDropletID(ctx context.Context, volumeID string, dropletID int) (*Action, *Response, error) { - request := &ActionRequest{ - "type": "detach", - "droplet_id": dropletID, - } - return s.doAction(ctx, volumeID, request) -} - -// Get an action for a particular storage volume by id. -func (s *StorageActionsServiceOp) Get(ctx context.Context, volumeID string, actionID int) (*Action, *Response, error) { - path := fmt.Sprintf("%s/%d", storageAllocationActionPath(volumeID), actionID) - return s.get(ctx, path) -} - -// List the actions for a particular storage volume. -func (s *StorageActionsServiceOp) List(ctx context.Context, volumeID string, opt *ListOptions) ([]Action, *Response, error) { - path := storageAllocationActionPath(volumeID) - path, err := addOptions(path, opt) - if err != nil { - return nil, nil, err - } - - return s.list(ctx, path) -} - -// Resize a storage volume. -func (s *StorageActionsServiceOp) Resize(ctx context.Context, volumeID string, sizeGigabytes int, regionSlug string) (*Action, *Response, error) { - request := &ActionRequest{ - "type": "resize", - "size_gigabytes": sizeGigabytes, - "region": regionSlug, - } - return s.doAction(ctx, volumeID, request) -} - -func (s *StorageActionsServiceOp) doAction(ctx context.Context, volumeID string, request *ActionRequest) (*Action, *Response, error) { - path := storageAllocationActionPath(volumeID) - - req, err := s.client.NewRequest(ctx, http.MethodPost, path, request) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (s *StorageActionsServiceOp) get(ctx context.Context, path string) (*Action, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Event, resp, err -} - -func (s *StorageActionsServiceOp) list(ctx context.Context, path string) ([]Action, *Response, error) { - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(actionsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Actions, resp, err -} - -func storageAllocationActionPath(volumeID string) string { - return fmt.Sprintf("%s/%s/actions", storageAllocPath, volumeID) -} diff --git a/vendor/github.com/digitalocean/godo/strings.go b/vendor/github.com/digitalocean/godo/strings.go deleted file mode 100644 index 4d5c0ad2..00000000 --- a/vendor/github.com/digitalocean/godo/strings.go +++ /dev/null @@ -1,102 +0,0 @@ -package godo - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strings" -) - -var timestampType = reflect.TypeOf(Timestamp{}) - -type ResourceWithURN interface { - URN() string -} - -// ToURN converts the resource type and ID to a valid DO API URN. -func ToURN(resourceType string, id interface{}) string { - return fmt.Sprintf("%s:%s:%v", "do", strings.ToLower(resourceType), id) -} - -// Stringify attempts to create a string representation of DigitalOcean types -func Stringify(message interface{}) string { - var buf bytes.Buffer - v := reflect.ValueOf(message) - stringifyValue(&buf, v) - return buf.String() -} - -// stringifyValue was graciously cargoculted from the goprotubuf library -func stringifyValue(w io.Writer, val reflect.Value) { - if val.Kind() == reflect.Ptr && val.IsNil() { - _, _ = w.Write([]byte("")) - return - } - - v := reflect.Indirect(val) - - switch v.Kind() { - case reflect.String: - fmt.Fprintf(w, `"%s"`, v) - case reflect.Slice: - stringifySlice(w, v) - return - case reflect.Struct: - stringifyStruct(w, v) - default: - if v.CanInterface() { - fmt.Fprint(w, v.Interface()) - } - } -} - -func stringifySlice(w io.Writer, v reflect.Value) { - _, _ = w.Write([]byte{'['}) - for i := 0; i < v.Len(); i++ { - if i > 0 { - _, _ = w.Write([]byte{' '}) - } - - stringifyValue(w, v.Index(i)) - } - - _, _ = w.Write([]byte{']'}) -} - -func stringifyStruct(w io.Writer, v reflect.Value) { - if v.Type().Name() != "" { - _, _ = w.Write([]byte(v.Type().String())) - } - - // special handling of Timestamp values - if v.Type() == timestampType { - fmt.Fprintf(w, "{%s}", v.Interface()) - return - } - - _, _ = w.Write([]byte{'{'}) - - var sep bool - for i := 0; i < v.NumField(); i++ { - fv := v.Field(i) - if fv.Kind() == reflect.Ptr && fv.IsNil() { - continue - } - if fv.Kind() == reflect.Slice && fv.IsNil() { - continue - } - - if sep { - _, _ = w.Write([]byte(", ")) - } else { - sep = true - } - - _, _ = w.Write([]byte(v.Type().Field(i).Name)) - _, _ = w.Write([]byte{':'}) - stringifyValue(w, fv) - } - - _, _ = w.Write([]byte{'}'}) -} diff --git a/vendor/github.com/digitalocean/godo/tags.go b/vendor/github.com/digitalocean/godo/tags.go deleted file mode 100644 index 6301e15f..00000000 --- a/vendor/github.com/digitalocean/godo/tags.go +++ /dev/null @@ -1,247 +0,0 @@ -package godo - -import ( - "context" - "fmt" - "net/http" -) - -const tagsBasePath = "v2/tags" - -// TagsService is an interface for interfacing with the tags -// endpoints of the DigitalOcean API -// See: https://developers.digitalocean.com/documentation/v2#tags -type TagsService interface { - List(context.Context, *ListOptions) ([]Tag, *Response, error) - Get(context.Context, string) (*Tag, *Response, error) - Create(context.Context, *TagCreateRequest) (*Tag, *Response, error) - Delete(context.Context, string) (*Response, error) - - TagResources(context.Context, string, *TagResourcesRequest) (*Response, error) - UntagResources(context.Context, string, *UntagResourcesRequest) (*Response, error) -} - -// TagsServiceOp handles communication with tag related method of the -// DigitalOcean API. -type TagsServiceOp struct { - client *Client -} - -var _ TagsService = &TagsServiceOp{} - -// ResourceType represents a class of resource, currently only droplet are supported -type ResourceType string - -const ( - // DropletResourceType holds the string representing our ResourceType of Droplet. - DropletResourceType ResourceType = "droplet" - // ImageResourceType holds the string representing our ResourceType of Image. - ImageResourceType ResourceType = "image" - // VolumeResourceType holds the string representing our ResourceType of Volume. - VolumeResourceType ResourceType = "volume" - // LoadBalancerResourceType holds the string representing our ResourceType of LoadBalancer. - LoadBalancerResourceType ResourceType = "load_balancer" - // VolumeSnapshotResourceType holds the string representing our ResourceType for storage Snapshots. - VolumeSnapshotResourceType ResourceType = "volume_snapshot" - // DatabaseResourceType holds the string representing our ResourceType of Database. - DatabaseResourceType ResourceType = "database" -) - -// Resource represent a single resource for associating/disassociating with tags -type Resource struct { - ID string `json:"resource_id,omitempty"` - Type ResourceType `json:"resource_type,omitempty"` -} - -// TaggedResources represent the set of resources a tag is attached to -type TaggedResources struct { - Count int `json:"count"` - LastTaggedURI string `json:"last_tagged_uri,omitempty"` - Droplets *TaggedDropletsResources `json:"droplets,omitempty"` - Images *TaggedImagesResources `json:"images"` - Volumes *TaggedVolumesResources `json:"volumes"` - VolumeSnapshots *TaggedVolumeSnapshotsResources `json:"volume_snapshots"` - Databases *TaggedDatabasesResources `json:"databases"` -} - -// TaggedDropletsResources represent the droplet resources a tag is attached to -type TaggedDropletsResources struct { - Count int `json:"count,float64,omitempty"` - LastTagged *Droplet `json:"last_tagged,omitempty"` - LastTaggedURI string `json:"last_tagged_uri,omitempty"` -} - -// TaggedResourcesData represent the generic resources a tag is attached to -type TaggedResourcesData struct { - Count int `json:"count,float64,omitempty"` - LastTaggedURI string `json:"last_tagged_uri,omitempty"` -} - -// TaggedImagesResources represent the image resources a tag is attached to -type TaggedImagesResources TaggedResourcesData - -// TaggedVolumesResources represent the volume resources a tag is attached to -type TaggedVolumesResources TaggedResourcesData - -// TaggedVolumeSnapshotsResources represent the volume snapshot resources a tag is attached to -type TaggedVolumeSnapshotsResources TaggedResourcesData - -// TaggedDatabasesResources represent the database resources a tag is attached to -type TaggedDatabasesResources TaggedResourcesData - -// Tag represent DigitalOcean tag -type Tag struct { - Name string `json:"name,omitempty"` - Resources *TaggedResources `json:"resources,omitempty"` -} - -//TagCreateRequest represents the JSON structure of a request of that type. -type TagCreateRequest struct { - Name string `json:"name"` -} - -// TagResourcesRequest represents the JSON structure of a request of that type. -type TagResourcesRequest struct { - Resources []Resource `json:"resources"` -} - -// UntagResourcesRequest represents the JSON structure of a request of that type. -type UntagResourcesRequest struct { - Resources []Resource `json:"resources"` -} - -type tagsRoot struct { - Tags []Tag `json:"tags"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -type tagRoot struct { - Tag *Tag `json:"tag"` -} - -// List all tags -func (s *TagsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Tag, *Response, error) { - path := tagsBasePath - path, err := addOptions(path, opt) - - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(tagsRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.Tags, resp, err -} - -// Get a single tag -func (s *TagsServiceOp) Get(ctx context.Context, name string) (*Tag, *Response, error) { - path := fmt.Sprintf("%s/%s", tagsBasePath, name) - - req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(tagRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Tag, resp, err -} - -// Create a new tag -func (s *TagsServiceOp) Create(ctx context.Context, createRequest *TagCreateRequest) (*Tag, *Response, error) { - if createRequest == nil { - return nil, nil, NewArgError("createRequest", "cannot be nil") - } - - req, err := s.client.NewRequest(ctx, http.MethodPost, tagsBasePath, createRequest) - if err != nil { - return nil, nil, err - } - - root := new(tagRoot) - resp, err := s.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.Tag, resp, err -} - -// Delete an existing tag -func (s *TagsServiceOp) Delete(ctx context.Context, name string) (*Response, error) { - if name == "" { - return nil, NewArgError("name", "cannot be empty") - } - - path := fmt.Sprintf("%s/%s", tagsBasePath, name) - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// TagResources associates resources with a given Tag. -func (s *TagsServiceOp) TagResources(ctx context.Context, name string, tagRequest *TagResourcesRequest) (*Response, error) { - if name == "" { - return nil, NewArgError("name", "cannot be empty") - } - - if tagRequest == nil { - return nil, NewArgError("tagRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%s/resources", tagsBasePath, name) - req, err := s.client.NewRequest(ctx, http.MethodPost, path, tagRequest) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} - -// UntagResources dissociates resources with a given Tag. -func (s *TagsServiceOp) UntagResources(ctx context.Context, name string, untagRequest *UntagResourcesRequest) (*Response, error) { - if name == "" { - return nil, NewArgError("name", "cannot be empty") - } - - if untagRequest == nil { - return nil, NewArgError("tagRequest", "cannot be nil") - } - - path := fmt.Sprintf("%s/%s/resources", tagsBasePath, name) - req, err := s.client.NewRequest(ctx, http.MethodDelete, path, untagRequest) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(ctx, req, nil) - - return resp, err -} diff --git a/vendor/github.com/digitalocean/godo/timestamp.go b/vendor/github.com/digitalocean/godo/timestamp.go deleted file mode 100644 index 37a28e5f..00000000 --- a/vendor/github.com/digitalocean/godo/timestamp.go +++ /dev/null @@ -1,35 +0,0 @@ -package godo - -import ( - "strconv" - "time" -) - -// Timestamp represents a time that can be unmarshalled from a JSON string -// formatted as either an RFC3339 or Unix timestamp. All -// exported methods of time.Time can be called on Timestamp. -type Timestamp struct { - time.Time -} - -func (t Timestamp) String() string { - return t.Time.String() -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -// Time is expected in RFC3339 or Unix format. -func (t *Timestamp) UnmarshalJSON(data []byte) error { - str := string(data) - i, err := strconv.ParseInt(str, 10, 64) - if err == nil { - t.Time = time.Unix(i, 0) - } else { - t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) - } - return err -} - -// Equal reports whether t and u are equal based on time.Equal -func (t Timestamp) Equal(u Timestamp) bool { - return t.Time.Equal(u.Time) -} diff --git a/vendor/github.com/digitalocean/godo/vpcs.go b/vendor/github.com/digitalocean/godo/vpcs.go deleted file mode 100644 index f2aba8e6..00000000 --- a/vendor/github.com/digitalocean/godo/vpcs.go +++ /dev/null @@ -1,187 +0,0 @@ -package godo - -import ( - "context" - "net/http" - "time" -) - -const vpcsBasePath = "/v2/vpcs" - -// VPCsService is an interface for managing Virtual Private Cloud configurations with the -// DigitalOcean API. -// See: https://developers.digitalocean.com/documentation/v2#vpcs -type VPCsService interface { - Create(context.Context, *VPCCreateRequest) (*VPC, *Response, error) - Get(context.Context, string) (*VPC, *Response, error) - List(context.Context, *ListOptions) ([]*VPC, *Response, error) - Update(context.Context, string, *VPCUpdateRequest) (*VPC, *Response, error) - Set(context.Context, string, ...VPCSetField) (*VPC, *Response, error) - Delete(context.Context, string) (*Response, error) -} - -var _ VPCsService = &VPCsServiceOp{} - -// VPCsServiceOp interfaces with VPC endpoints in the DigitalOcean API. -type VPCsServiceOp struct { - client *Client -} - -// VPCCreateRequest represents a request to create a Virtual Private Cloud. -type VPCCreateRequest struct { - Name string `json:"name,omitempty"` - RegionSlug string `json:"region,omitempty"` -} - -// VPCUpdateRequest represents a request to update a Virtual Private Cloud. -type VPCUpdateRequest struct { - Name string `json:"name,omitempty"` -} - -// VPCSetField allows one to set individual fields within a VPC configuration. -type VPCSetField interface { - vpcSetField(map[string]interface{}) -} - -// VPCSetName is used when one want to set the `name` field of a VPC. -// Ex.: VPCs.Set(..., VPCSetName("new-name")) -type VPCSetName string - -// VPC represents a DigitalOcean Virtual Private Cloud configuration. -type VPC struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - RegionSlug string `json:"region,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - Default bool `json:"default,omitempty"` -} - -type vpcRoot struct { - VPC *VPC `json:"vpc"` -} - -type vpcsRoot struct { - VPCs []*VPC `json:"vpcs"` - Links *Links `json:"links"` - Meta *Meta `json:"meta"` -} - -// Get returns the details of a Virtual Private Cloud. -func (v *VPCsServiceOp) Get(ctx context.Context, id string) (*VPC, *Response, error) { - path := vpcsBasePath + "/" + id - req, err := v.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(vpcRoot) - resp, err := v.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.VPC, resp, nil -} - -// Create creates a new Virtual Private Cloud. -func (v *VPCsServiceOp) Create(ctx context.Context, create *VPCCreateRequest) (*VPC, *Response, error) { - path := vpcsBasePath - req, err := v.client.NewRequest(ctx, http.MethodPost, path, create) - if err != nil { - return nil, nil, err - } - - root := new(vpcRoot) - resp, err := v.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.VPC, resp, nil -} - -// List returns a list of the caller's VPCs, with optional pagination. -func (v *VPCsServiceOp) List(ctx context.Context, opt *ListOptions) ([]*VPC, *Response, error) { - path, err := addOptions(vpcsBasePath, opt) - if err != nil { - return nil, nil, err - } - req, err := v.client.NewRequest(ctx, http.MethodGet, path, nil) - if err != nil { - return nil, nil, err - } - - root := new(vpcsRoot) - resp, err := v.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - if l := root.Links; l != nil { - resp.Links = l - } - if m := root.Meta; m != nil { - resp.Meta = m - } - - return root.VPCs, resp, nil -} - -// Update updates a Virtual Private Cloud's properties. -func (v *VPCsServiceOp) Update(ctx context.Context, id string, update *VPCUpdateRequest) (*VPC, *Response, error) { - path := vpcsBasePath + "/" + id - req, err := v.client.NewRequest(ctx, http.MethodPut, path, update) - if err != nil { - return nil, nil, err - } - - root := new(vpcRoot) - resp, err := v.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.VPC, resp, nil -} - -func (n VPCSetName) vpcSetField(in map[string]interface{}) { - in["name"] = n -} - -// Set updates specific properties of a Virtual Private Cloud. -func (v *VPCsServiceOp) Set(ctx context.Context, id string, fields ...VPCSetField) (*VPC, *Response, error) { - path := vpcsBasePath + "/" + id - update := make(map[string]interface{}, len(fields)) - for _, field := range fields { - field.vpcSetField(update) - } - - req, err := v.client.NewRequest(ctx, http.MethodPatch, path, update) - if err != nil { - return nil, nil, err - } - - root := new(vpcRoot) - resp, err := v.client.Do(ctx, req, root) - if err != nil { - return nil, resp, err - } - - return root.VPC, resp, nil -} - -// Delete deletes a Virtual Private Cloud. There is no way to recover a VPC once it has been -// destroyed. -func (v *VPCsServiceOp) Delete(ctx context.Context, id string) (*Response, error) { - path := vpcsBasePath + "/" + id - req, err := v.client.NewRequest(ctx, http.MethodDelete, path, nil) - if err != nil { - return nil, err - } - - resp, err := v.client.Do(ctx, req, nil) - if err != nil { - return resp, err - } - - return resp, nil -} diff --git a/vendor/github.com/dlclark/regexp2/.gitignore b/vendor/github.com/dlclark/regexp2/.gitignore deleted file mode 100644 index 38a7addc..00000000 --- a/vendor/github.com/dlclark/regexp2/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof -*.out \ No newline at end of file diff --git a/vendor/github.com/dlclark/regexp2/.travis.yml b/vendor/github.com/dlclark/regexp2/.travis.yml deleted file mode 100644 index a24aeded..00000000 --- a/vendor/github.com/dlclark/regexp2/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: go - -go: - - 1.5 - - tip \ No newline at end of file diff --git a/vendor/github.com/dlclark/regexp2/ATTRIB b/vendor/github.com/dlclark/regexp2/ATTRIB deleted file mode 100644 index cdf4560b..00000000 --- a/vendor/github.com/dlclark/regexp2/ATTRIB +++ /dev/null @@ -1,133 +0,0 @@ -============ -These pieces of code were ported from dotnet/corefx: - -syntax/charclass.go (from RegexCharClass.cs): ported to use the built-in Go unicode classes. Canonicalize is - a direct port, but most of the other code required large changes because the C# implementation - used a string to represent the CharSet data structure and I cleaned that up in my implementation. - -syntax/code.go (from RegexCode.cs): ported literally with various cleanups and layout to make it more Go-ish. - -syntax/escape.go (from RegexParser.cs): ported Escape method and added some optimizations. Unescape is inspired by - the C# implementation but couldn't be directly ported because of the lack of do-while syntax in Go. - -syntax/parser.go (from RegexpParser.cs and RegexOptions.cs): ported parser struct and associated methods as - literally as possible. Several language differences required changes. E.g. lack pre/post-fix increments as - expressions, lack of do-while loops, lack of overloads, etc. - -syntax/prefix.go (from RegexFCD.cs and RegexBoyerMoore.cs): ported as literally as possible and added support - for unicode chars that are longer than the 16-bit char in C# for the 32-bit rune in Go. - -syntax/replacerdata.go (from RegexReplacement.cs): conceptually ported and re-organized to handle differences - in charclass implementation, and fix odd code layout between RegexParser.cs, Regex.cs, and RegexReplacement.cs. - -syntax/tree.go (from RegexTree.cs and RegexNode.cs): ported literally as possible. - -syntax/writer.go (from RegexWriter.cs): ported literally with minor changes to make it more Go-ish. - -match.go (from RegexMatch.cs): ported, simplified, and changed to handle Go's lack of inheritence. - -regexp.go (from Regex.cs and RegexOptions.cs): conceptually serves the same "starting point", but is simplified - and changed to handle differences in C# strings and Go strings/runes. - -replace.go (from RegexReplacement.cs): ported closely and then cleaned up to combine the MatchEvaluator and - simple string replace implementations. - -runner.go (from RegexRunner.cs): ported literally as possible. - -regexp_test.go (from CaptureTests.cs and GroupNamesAndNumbers.cs): conceptually ported, but the code was - manually structured like Go tests. - -replace_test.go (from RegexReplaceStringTest0.cs): conceptually ported - -rtl_test.go (from RightToLeft.cs): conceptually ported ---- -dotnet/corefx was released under this license: - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -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. - -============ -These pieces of code are copied from the Go framework: - -- The overall directory structure of regexp2 was inspired by the Go runtime regexp package. -- The optimization in the escape method of syntax/escape.go is from the Go runtime QuoteMeta() func in regexp/regexp.go -- The method signatures in regexp.go are designed to match the Go framework regexp methods closely -- func regexp2.MustCompile and func quote are almost identifical to the regexp package versions -- BenchmarkMatch* and TestProgramTooLong* funcs in regexp_performance_test.go were copied from the framework - regexp/exec_test.go ---- -The Go framework was released under this license: - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -============ -Some test data were gathered from the Mono project. - -regexp_mono_test.go: ported from https://github.com/mono/mono/blob/master/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs ---- -Mono tests released under this license: - -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. - diff --git a/vendor/github.com/dlclark/regexp2/LICENSE b/vendor/github.com/dlclark/regexp2/LICENSE deleted file mode 100644 index fe83dfdc..00000000 --- a/vendor/github.com/dlclark/regexp2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Doug Clark - -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. diff --git a/vendor/github.com/dlclark/regexp2/README.md b/vendor/github.com/dlclark/regexp2/README.md deleted file mode 100644 index f4dc33da..00000000 --- a/vendor/github.com/dlclark/regexp2/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# regexp2 - full featured regular expressions for Go -Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the built-in `regexp` package, but it allows backtracking and is compatible with Perl5 and .NET. You'll likely be better off with the RE2 engine from the `regexp` package and should only use this if you need to write very complex patterns or require compatibility with .NET. - -## Basis of the engine -The engine is ported from the .NET framework's System.Text.RegularExpressions.Regex engine. That engine was open sourced in 2015 under the MIT license. There are some fundamental differences between .NET strings and Go strings that required a bit of borrowing from the Go framework regex engine as well. I cleaned up a couple of the dirtier bits during the port (regexcharclass.cs was terrible), but the parse tree, code emmitted, and therefore patterns matched should be identical. - -## Installing -This is a go-gettable library, so install is easy: - - go get github.com/dlclark/regexp2/... - -## Usage -Usage is similar to the Go `regexp` package. Just like in `regexp`, you start by converting a regex into a state machine via the `Compile` or `MustCompile` methods. They ultimately do the same thing, but `MustCompile` will panic if the regex is invalid. You can then use the provided `Regexp` struct to find matches repeatedly. A `Regexp` struct is safe to use across goroutines. - -```go -re := regexp2.MustCompile(`Your pattern`, 0) -if isMatch, _ := re.MatchString(`Something to match`); isMatch { - //do something -} -``` - -The only error that the `*Match*` methods *should* return is a Timeout if you set the `re.MatchTimeout` field. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: - -```go -if m, _ := re.FindStringMatch(`Something to match`); m != nil { - // the whole match is always group 0 - fmt.Printf("Group 0: %v\n", m.String()) - - // you can get all the groups too - gps := m.Groups() - - // a group can be captured multiple times, so each cap is separately addressable - fmt.Printf("Group 1, first capture", gps[1].Captures[0].String()) - fmt.Printf("Group 1, second capture", gps[1].Captures[1].String()) -} -``` - -Group 0 is embedded in the Match. Group 0 is an automatically-assigned group that encompasses the whole pattern. This means that `m.String()` is the same as `m.Group.String()` and `m.Groups()[0].String()` - -The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`. - -## Compare `regexp` and `regexp2` -| Category | regexp | regexp2 | -| --- | --- | --- | -| Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field | -| Python-style capture groups `(Pre)` | yes | no | -| .NET-style capture groups `(re)` or `('name're)` | no | yes | -| comments `(?#comment)` | no | yes | -| branch numbering reset `(?\|a\|b)` | no | no | -| possessive match `(?>re)` | no | yes | -| positive lookahead `(?=re)` | no | yes | -| negative lookahead `(?!re)` | no | yes | -| positive lookbehind `(?<=re)` | no | yes | -| negative lookbehind `(? 0 && m.matches[cap][m.matchcount[cap]*2-1] != (-3+1) -} - -// matchIndex returns the index of the last specified matched group by capnum -func (m *Match) matchIndex(cap int) int { - i := m.matches[cap][m.matchcount[cap]*2-2] - if i >= 0 { - return i - } - - return m.matches[cap][-3-i] -} - -// matchLength returns the length of the last specified matched group by capnum -func (m *Match) matchLength(cap int) int { - i := m.matches[cap][m.matchcount[cap]*2-1] - if i >= 0 { - return i - } - - return m.matches[cap][-3-i] -} - -// Nonpublic builder: add a capture to the group specified by "c" -func (m *Match) addMatch(c, start, l int) { - - if m.matches[c] == nil { - m.matches[c] = make([]int, 2) - } - - capcount := m.matchcount[c] - - if capcount*2+2 > len(m.matches[c]) { - oldmatches := m.matches[c] - newmatches := make([]int, capcount*8) - copy(newmatches, oldmatches[:capcount*2]) - m.matches[c] = newmatches - } - - m.matches[c][capcount*2] = start - m.matches[c][capcount*2+1] = l - m.matchcount[c] = capcount + 1 - //log.Printf("addMatch: c=%v, i=%v, l=%v ... matches: %v", c, start, l, m.matches) -} - -// Nonpublic builder: Add a capture to balance the specified group. This is used by the -// balanced match construct. (?...) -// -// If there were no such thing as backtracking, this would be as simple as calling RemoveMatch(c). -// However, since we have backtracking, we need to keep track of everything. -func (m *Match) balanceMatch(c int) { - m.balancing = true - - // we'll look at the last capture first - capcount := m.matchcount[c] - target := capcount*2 - 2 - - // first see if it is negative, and therefore is a reference to the next available - // capture group for balancing. If it is, we'll reset target to point to that capture. - if m.matches[c][target] < 0 { - target = -3 - m.matches[c][target] - } - - // move back to the previous capture - target -= 2 - - // if the previous capture is a reference, just copy that reference to the end. Otherwise, point to it. - if target >= 0 && m.matches[c][target] < 0 { - m.addMatch(c, m.matches[c][target], m.matches[c][target+1]) - } else { - m.addMatch(c, -3-target, -4-target /* == -3 - (target + 1) */) - } -} - -// Nonpublic builder: removes a group match by capnum -func (m *Match) removeMatch(c int) { - m.matchcount[c]-- -} - -// GroupCount returns the number of groups this match has matched -func (m *Match) GroupCount() int { - return len(m.matchcount) -} - -// GroupByName returns a group based on the name of the group, or nil if the group name does not exist -func (m *Match) GroupByName(name string) *Group { - num := m.regex.GroupNumberFromName(name) - if num < 0 { - return nil - } - return m.GroupByNumber(num) -} - -// GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist -func (m *Match) GroupByNumber(num int) *Group { - // check our sparse map - if m.sparseCaps != nil { - if newNum, ok := m.sparseCaps[num]; ok { - num = newNum - } - } - if num >= len(m.matchcount) || num < 0 { - return nil - } - - if num == 0 { - return &m.Group - } - - m.populateOtherGroups() - - return &m.otherGroups[num-1] -} - -// Groups returns all the capture groups, starting with group 0 (the full match) -func (m *Match) Groups() []Group { - m.populateOtherGroups() - g := make([]Group, len(m.otherGroups)+1) - g[0] = m.Group - copy(g[1:], m.otherGroups) - return g -} - -func (m *Match) populateOtherGroups() { - // Construct all the Group objects first time called - if m.otherGroups == nil { - m.otherGroups = make([]Group, len(m.matchcount)-1) - for i := 0; i < len(m.otherGroups); i++ { - m.otherGroups[i] = newGroup(m.regex.GroupNameFromNumber(i+1), m.text, m.matches[i+1], m.matchcount[i+1]) - } - } -} - -func (m *Match) groupValueAppendToBuf(groupnum int, buf *bytes.Buffer) { - c := m.matchcount[groupnum] - if c == 0 { - return - } - - matches := m.matches[groupnum] - - index := matches[(c-1)*2] - last := index + matches[(c*2)-1] - - for ; index < last; index++ { - buf.WriteRune(m.text[index]) - } -} - -func newGroup(name string, text []rune, caps []int, capcount int) Group { - g := Group{} - g.text = text - if capcount > 0 { - g.Index = caps[(capcount-1)*2] - g.Length = caps[(capcount*2)-1] - } - g.Name = name - g.Captures = make([]Capture, capcount) - for i := 0; i < capcount; i++ { - g.Captures[i] = Capture{ - text: text, - Index: caps[i*2], - Length: caps[i*2+1], - } - } - //log.Printf("newGroup! capcount %v, %+v", capcount, g) - - return g -} - -func (m *Match) dump() string { - buf := &bytes.Buffer{} - buf.WriteRune('\n') - if len(m.sparseCaps) > 0 { - for k, v := range m.sparseCaps { - fmt.Fprintf(buf, "Slot %v -> %v\n", k, v) - } - } - - for i, g := range m.Groups() { - fmt.Fprintf(buf, "Group %v (%v), %v caps:\n", i, g.Name, len(g.Captures)) - - for _, c := range g.Captures { - fmt.Fprintf(buf, " (%v, %v) %v\n", c.Index, c.Length, c.String()) - } - } - /* - for i := 0; i < len(m.matchcount); i++ { - fmt.Fprintf(buf, "\nGroup %v (%v):\n", i, m.regex.GroupNameFromNumber(i)) - - for j := 0; j < m.matchcount[i]; j++ { - text := "" - - if m.matches[i][j*2] >= 0 { - start := m.matches[i][j*2] - text = m.text[start : start+m.matches[i][j*2+1]] - } - - fmt.Fprintf(buf, " (%v, %v) %v\n", m.matches[i][j*2], m.matches[i][j*2+1], text) - } - } - */ - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/regexp.go b/vendor/github.com/dlclark/regexp2/regexp.go deleted file mode 100644 index b25fe690..00000000 --- a/vendor/github.com/dlclark/regexp2/regexp.go +++ /dev/null @@ -1,357 +0,0 @@ -/* -Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a -more feature full regex engine behind the scenes. - -It doesn't have constant time guarantees, but it allows backtracking and is compatible with Perl5 and .NET. -You'll likely be better off with the RE2 engine from the regexp package and should only use this if you -need to write very complex patterns or require compatibility with .NET. -*/ -package regexp2 - -import ( - "errors" - "math" - "strconv" - "sync" - "time" - - "github.com/dlclark/regexp2/syntax" -) - -// Default timeout used when running regexp matches -- "forever" -var DefaultMatchTimeout = time.Duration(math.MaxInt64) - -// Regexp is the representation of a compiled regular expression. -// A Regexp is safe for concurrent use by multiple goroutines. -type Regexp struct { - //timeout when trying to find matches - MatchTimeout time.Duration - - // read-only after Compile - pattern string // as passed to Compile - options RegexOptions // options - - caps map[int]int // capnum->index - capnames map[string]int //capture group name -> index - capslist []string //sorted list of capture group names - capsize int // size of the capture array - - code *syntax.Code // compiled program - - // cache of machines for running regexp - muRun sync.Mutex - runner []*runner -} - -// Compile parses a regular expression and returns, if successful, -// a Regexp object that can be used to match against text. -func Compile(expr string, opt RegexOptions) (*Regexp, error) { - // parse it - tree, err := syntax.Parse(expr, syntax.RegexOptions(opt)) - if err != nil { - return nil, err - } - - // translate it to code - code, err := syntax.Write(tree) - if err != nil { - return nil, err - } - - // return it - return &Regexp{ - pattern: expr, - options: opt, - caps: code.Caps, - capnames: tree.Capnames, - capslist: tree.Caplist, - capsize: code.Capsize, - code: code, - MatchTimeout: DefaultMatchTimeout, - }, nil -} - -// MustCompile is like Compile but panics if the expression cannot be parsed. -// It simplifies safe initialization of global variables holding compiled regular -// expressions. -func MustCompile(str string, opt RegexOptions) *Regexp { - regexp, error := Compile(str, opt) - if error != nil { - panic(`regexp2: Compile(` + quote(str) + `): ` + error.Error()) - } - return regexp -} - -// Escape adds backslashes to any special characters in the input string -func Escape(input string) string { - return syntax.Escape(input) -} - -// Unescape removes any backslashes from previously-escaped special characters in the input string -func Unescape(input string) (string, error) { - return syntax.Unescape(input) -} - -// String returns the source text used to compile the regular expression. -func (re *Regexp) String() string { - return re.pattern -} - -func quote(s string) string { - if strconv.CanBackquote(s) { - return "`" + s + "`" - } - return strconv.Quote(s) -} - -// RegexOptions impact the runtime and parsing behavior -// for each specific regex. They are setable in code as well -// as in the regex pattern itself. -type RegexOptions int32 - -const ( - None RegexOptions = 0x0 - IgnoreCase = 0x0001 // "i" - Multiline = 0x0002 // "m" - ExplicitCapture = 0x0004 // "n" - Compiled = 0x0008 // "c" - Singleline = 0x0010 // "s" - IgnorePatternWhitespace = 0x0020 // "x" - RightToLeft = 0x0040 // "r" - Debug = 0x0080 // "d" - ECMAScript = 0x0100 // "e" -) - -func (re *Regexp) RightToLeft() bool { - return re.options&RightToLeft != 0 -} - -func (re *Regexp) Debug() bool { - return re.options&Debug != 0 -} - -// Replace searches the input string and replaces each match found with the replacement text. -// Count will limit the number of matches attempted and startAt will allow -// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). -// Set startAt and count to -1 to go through the whole string -func (re *Regexp) Replace(input, replacement string, startAt, count int) (string, error) { - data, err := syntax.NewReplacerData(replacement, re.caps, re.capsize, re.capnames, syntax.RegexOptions(re.options)) - if err != nil { - return "", err - } - //TODO: cache ReplacerData - - return replace(re, data, nil, input, startAt, count) -} - -// ReplaceFunc searches the input string and replaces each match found using the string from the evaluator -// Count will limit the number of matches attempted and startAt will allow -// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). -// Set startAt and count to -1 to go through the whole string. -func (re *Regexp) ReplaceFunc(input string, evaluator MatchEvaluator, startAt, count int) (string, error) { - return replace(re, nil, evaluator, input, startAt, count) -} - -// FindStringMatch searches the input string for a Regexp match -func (re *Regexp) FindStringMatch(s string) (*Match, error) { - // convert string to runes - return re.run(false, -1, getRunes(s)) -} - -// FindRunesMatch searches the input rune slice for a Regexp match -func (re *Regexp) FindRunesMatch(r []rune) (*Match, error) { - return re.run(false, -1, r) -} - -// FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index -func (re *Regexp) FindStringMatchStartingAt(s string, startAt int) (*Match, error) { - if startAt > len(s) { - return nil, errors.New("startAt must be less than the length of the input string") - } - r, startAt := re.getRunesAndStart(s, startAt) - if startAt == -1 { - // we didn't find our start index in the string -- that's a problem - return nil, errors.New("startAt must align to the start of a valid rune in the input string") - } - - return re.run(false, startAt, r) -} - -// FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index -func (re *Regexp) FindRunesMatchStartingAt(r []rune, startAt int) (*Match, error) { - return re.run(false, startAt, r) -} - -// FindNextMatch returns the next match in the same input string as the match parameter. -// Will return nil if there is no next match or if given a nil match. -func (re *Regexp) FindNextMatch(m *Match) (*Match, error) { - if m == nil { - return nil, nil - } - - // If previous match was empty, advance by one before matching to prevent - // infinite loop - startAt := m.textpos - if m.Length == 0 { - if m.textpos == len(m.text) { - return nil, nil - } - - if re.RightToLeft() { - startAt-- - } else { - startAt++ - } - } - return re.run(false, startAt, m.text) -} - -// MatchString return true if the string matches the regex -// error will be set if a timeout occurs -func (re *Regexp) MatchString(s string) (bool, error) { - m, err := re.run(true, -1, getRunes(s)) - if err != nil { - return false, err - } - return m != nil, nil -} - -func (re *Regexp) getRunesAndStart(s string, startAt int) ([]rune, int) { - if startAt < 0 { - if re.RightToLeft() { - r := getRunes(s) - return r, len(r) - } - return getRunes(s), 0 - } - ret := make([]rune, len(s)) - i := 0 - runeIdx := -1 - for strIdx, r := range s { - if strIdx == startAt { - runeIdx = i - } - ret[i] = r - i++ - } - return ret[:i], runeIdx -} - -func getRunes(s string) []rune { - ret := make([]rune, len(s)) - i := 0 - for _, r := range s { - ret[i] = r - i++ - } - return ret[:i] -} - -// MatchRunes return true if the runes matches the regex -// error will be set if a timeout occurs -func (re *Regexp) MatchRunes(r []rune) (bool, error) { - m, err := re.run(true, -1, r) - if err != nil { - return false, err - } - return m != nil, nil -} - -// GetGroupNames Returns the set of strings used to name capturing groups in the expression. -func (re *Regexp) GetGroupNames() []string { - var result []string - - if re.capslist == nil { - result = make([]string, re.capsize) - - for i := 0; i < len(result); i++ { - result[i] = strconv.Itoa(i) - } - } else { - result = make([]string, len(re.capslist)) - copy(result, re.capslist) - } - - return result -} - -// GetGroupNumbers returns the integer group numbers corresponding to a group name. -func (re *Regexp) GetGroupNumbers() []int { - var result []int - - if re.caps == nil { - result = make([]int, re.capsize) - - for i := 0; i < len(result); i++ { - result[i] = i - } - } else { - result = make([]int, len(re.caps)) - - for k, v := range re.caps { - result[v] = k - } - } - - return result -} - -// GroupNameFromNumber retrieves a group name that corresponds to a group number. -// It will return "" for and unknown group number. Unnamed groups automatically -// receive a name that is the decimal string equivalent of its number. -func (re *Regexp) GroupNameFromNumber(i int) string { - if re.capslist == nil { - if i >= 0 && i < re.capsize { - return strconv.Itoa(i) - } - - return "" - } - - if re.caps != nil { - var ok bool - if i, ok = re.caps[i]; !ok { - return "" - } - } - - if i >= 0 && i < len(re.capslist) { - return re.capslist[i] - } - - return "" -} - -// GroupNumberFromName returns a group number that corresponds to a group name. -// Returns -1 if the name is not a recognized group name. Numbered groups -// automatically get a group name that is the decimal string equivalent of its number. -func (re *Regexp) GroupNumberFromName(name string) int { - // look up name if we have a hashtable of names - if re.capnames != nil { - if k, ok := re.capnames[name]; ok { - return k - } - - return -1 - } - - // convert to an int if it looks like a number - result := 0 - for i := 0; i < len(name); i++ { - ch := name[i] - - if ch > '9' || ch < '0' { - return -1 - } - - result *= 10 - result += int(ch - '0') - } - - // return int if it's in range - if result >= 0 && result < re.capsize { - return result - } - - return -1 -} diff --git a/vendor/github.com/dlclark/regexp2/replace.go b/vendor/github.com/dlclark/regexp2/replace.go deleted file mode 100644 index 0376bd9d..00000000 --- a/vendor/github.com/dlclark/regexp2/replace.go +++ /dev/null @@ -1,177 +0,0 @@ -package regexp2 - -import ( - "bytes" - "errors" - - "github.com/dlclark/regexp2/syntax" -) - -const ( - replaceSpecials = 4 - replaceLeftPortion = -1 - replaceRightPortion = -2 - replaceLastGroup = -3 - replaceWholeString = -4 -) - -// MatchEvaluator is a function that takes a match and returns a replacement string to be used -type MatchEvaluator func(Match) string - -// Three very similar algorithms appear below: replace (pattern), -// replace (evaluator), and split. - -// Replace Replaces all occurrences of the regex in the string with the -// replacement pattern. -// -// Note that the special case of no matches is handled on its own: -// with no matches, the input string is returned unchanged. -// The right-to-left case is split out because StringBuilder -// doesn't handle right-to-left string building directly very well. -func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, input string, startAt, count int) (string, error) { - if count < -1 { - return "", errors.New("Count too small") - } - if count == 0 { - return "", nil - } - - m, err := regex.FindStringMatchStartingAt(input, startAt) - - if err != nil { - return "", err - } - if m == nil { - return input, nil - } - - buf := &bytes.Buffer{} - text := m.text - - if !regex.RightToLeft() { - prevat := 0 - for m != nil { - if m.Index != prevat { - buf.WriteString(string(text[prevat:m.Index])) - } - prevat = m.Index + m.Length - if evaluator == nil { - replacementImpl(data, buf, m) - } else { - buf.WriteString(evaluator(*m)) - } - - count-- - if count == 0 { - break - } - m, err = regex.FindNextMatch(m) - if err != nil { - return "", nil - } - } - - if prevat < len(text) { - buf.WriteString(string(text[prevat:])) - } - } else { - prevat := len(text) - var al []string - - for m != nil { - if m.Index+m.Length != prevat { - al = append(al, string(text[m.Index+m.Length:prevat])) - } - prevat = m.Index - if evaluator == nil { - replacementImplRTL(data, &al, m) - } else { - al = append(al, evaluator(*m)) - } - - count-- - if count == 0 { - break - } - m, err = regex.FindNextMatch(m) - if err != nil { - return "", nil - } - } - - if prevat > 0 { - buf.WriteString(string(text[:prevat])) - } - - for i := len(al) - 1; i >= 0; i-- { - buf.WriteString(al[i]) - } - } - - return buf.String(), nil -} - -// Given a Match, emits into the StringBuilder the evaluated -// substitution pattern. -func replacementImpl(data *syntax.ReplacerData, buf *bytes.Buffer, m *Match) { - for _, r := range data.Rules { - - if r >= 0 { // string lookup - buf.WriteString(data.Strings[r]) - } else if r < -replaceSpecials { // group lookup - m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) - } else { - switch -replaceSpecials - 1 - r { // special insertion patterns - case replaceLeftPortion: - for i := 0; i < m.Index; i++ { - buf.WriteRune(m.text[i]) - } - case replaceRightPortion: - for i := m.Index + m.Length; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - case replaceLastGroup: - m.groupValueAppendToBuf(m.GroupCount()-1, buf) - case replaceWholeString: - for i := 0; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - } - } - } -} - -func replacementImplRTL(data *syntax.ReplacerData, al *[]string, m *Match) { - l := *al - buf := &bytes.Buffer{} - - for _, r := range data.Rules { - buf.Reset() - if r >= 0 { // string lookup - l = append(l, data.Strings[r]) - } else if r < -replaceSpecials { // group lookup - m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) - l = append(l, buf.String()) - } else { - switch -replaceSpecials - 1 - r { // special insertion patterns - case replaceLeftPortion: - for i := 0; i < m.Index; i++ { - buf.WriteRune(m.text[i]) - } - case replaceRightPortion: - for i := m.Index + m.Length; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - case replaceLastGroup: - m.groupValueAppendToBuf(m.GroupCount()-1, buf) - case replaceWholeString: - for i := 0; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - } - l = append(l, buf.String()) - } - } - - *al = l -} diff --git a/vendor/github.com/dlclark/regexp2/runner.go b/vendor/github.com/dlclark/regexp2/runner.go deleted file mode 100644 index 2d84a934..00000000 --- a/vendor/github.com/dlclark/regexp2/runner.go +++ /dev/null @@ -1,1621 +0,0 @@ -package regexp2 - -import ( - "bytes" - "errors" - "fmt" - "math" - "strconv" - "strings" - "time" - "unicode" - - "github.com/dlclark/regexp2/syntax" -) - -type runner struct { - re *Regexp - code *syntax.Code - - runtextstart int // starting point for search - - runtext []rune // text to search - runtextpos int // current position in text - runtextend int - - // The backtracking stack. Opcodes use this to store data regarding - // what they have matched and where to backtrack to. Each "frame" on - // the stack takes the form of [CodePosition Data1 Data2...], where - // CodePosition is the position of the current opcode and - // the data values are all optional. The CodePosition can be negative, and - // these values (also called "back2") are used by the BranchMark family of opcodes - // to indicate whether they are backtracking after a successful or failed - // match. - // When we backtrack, we pop the CodePosition off the stack, set the current - // instruction pointer to that code position, and mark the opcode - // with a backtracking flag ("Back"). Each opcode then knows how to - // handle its own data. - runtrack []int - runtrackpos int - - // This stack is used to track text positions across different opcodes. - // For example, in /(a*b)+/, the parentheses result in a SetMark/CaptureMark - // pair. SetMark records the text position before we match a*b. Then - // CaptureMark uses that position to figure out where the capture starts. - // Opcodes which push onto this stack are always paired with other opcodes - // which will pop the value from it later. A successful match should mean - // that this stack is empty. - runstack []int - runstackpos int - - // The crawl stack is used to keep track of captures. Every time a group - // has a capture, we push its group number onto the runcrawl stack. In - // the case of a balanced match, we push BOTH groups onto the stack. - runcrawl []int - runcrawlpos int - - runtrackcount int // count of states that may do backtracking - - runmatch *Match // result object - - ignoreTimeout bool - timeout time.Duration // timeout in milliseconds (needed for actual) - timeoutChecksToSkip int - timeoutAt time.Time - - operator syntax.InstOp - codepos int - rightToLeft bool - caseInsensitive bool -} - -// run searches for matches and can continue from the previous match -// -// quick is usually false, but can be true to not return matches, just put it in caches -// textstart is -1 to start at the "beginning" (depending on Right-To-Left), otherwise an index in input -// input is the string to search for our regex pattern -func (re *Regexp) run(quick bool, textstart int, input []rune) (*Match, error) { - - // get a cached runner - runner := re.getRunner() - defer re.putRunner(runner) - - if textstart < 0 { - if re.RightToLeft() { - textstart = len(input) - } else { - textstart = 0 - } - } - - return runner.scan(input, textstart, quick, re.MatchTimeout) -} - -// Scans the string to find the first match. Uses the Match object -// both to feed text in and as a place to store matches that come out. -// -// All the action is in the Go() method. Our -// responsibility is to load up the class members before -// calling Go. -// -// The optimizer can compute a set of candidate starting characters, -// and we could use a separate method Skip() that will quickly scan past -// any characters that we know can't match. -func (r *runner) scan(rt []rune, textstart int, quick bool, timeout time.Duration) (*Match, error) { - r.timeout = timeout - r.ignoreTimeout = (time.Duration(math.MaxInt64) == timeout) - r.runtextstart = textstart - r.runtext = rt - r.runtextend = len(rt) - - stoppos := r.runtextend - bump := 1 - - if r.re.RightToLeft() { - bump = -1 - stoppos = 0 - } - - r.runtextpos = textstart - initted := false - - r.startTimeoutWatch() - for { - if r.re.Debug() { - //fmt.Printf("\nSearch content: %v\n", string(r.runtext)) - fmt.Printf("\nSearch range: from 0 to %v\n", r.runtextend) - fmt.Printf("Firstchar search starting at %v stopping at %v\n", r.runtextpos, stoppos) - } - - if r.findFirstChar() { - if err := r.checkTimeout(); err != nil { - return nil, err - } - - if !initted { - r.initMatch() - initted = true - } - - if r.re.Debug() { - fmt.Printf("Executing engine starting at %v\n\n", r.runtextpos) - } - - if err := r.execute(); err != nil { - return nil, err - } - - if r.runmatch.matchcount[0] > 0 { - // We'll return a match even if it touches a previous empty match - return r.tidyMatch(quick), nil - } - - // reset state for another go - r.runtrackpos = len(r.runtrack) - r.runstackpos = len(r.runstack) - r.runcrawlpos = len(r.runcrawl) - } - - // failure! - - if r.runtextpos == stoppos { - r.tidyMatch(true) - return nil, nil - } - - // Recognize leading []* and various anchors, and bump on failure accordingly - - // r.bump by one and start again - - r.runtextpos += bump - } - // We never get here -} - -func (r *runner) execute() error { - - r.goTo(0) - - for { - - if r.re.Debug() { - r.dumpState() - } - - if err := r.checkTimeout(); err != nil { - return err - } - - switch r.operator { - case syntax.Stop: - return nil - - case syntax.Nothing: - break - - case syntax.Goto: - r.goTo(r.operand(0)) - continue - - case syntax.Testref: - if !r.runmatch.isMatched(r.operand(0)) { - break - } - r.advance(1) - continue - - case syntax.Lazybranch: - r.trackPush1(r.textPos()) - r.advance(1) - continue - - case syntax.Lazybranch | syntax.Back: - r.trackPop() - r.textto(r.trackPeek()) - r.goTo(r.operand(0)) - continue - - case syntax.Setmark: - r.stackPush(r.textPos()) - r.trackPush() - r.advance(0) - continue - - case syntax.Nullmark: - r.stackPush(-1) - r.trackPush() - r.advance(0) - continue - - case syntax.Setmark | syntax.Back, syntax.Nullmark | syntax.Back: - r.stackPop() - break - - case syntax.Getmark: - r.stackPop() - r.trackPush1(r.stackPeek()) - r.textto(r.stackPeek()) - r.advance(0) - continue - - case syntax.Getmark | syntax.Back: - r.trackPop() - r.stackPush(r.trackPeek()) - break - - case syntax.Capturemark: - if r.operand(1) != -1 && !r.runmatch.isMatched(r.operand(1)) { - break - } - r.stackPop() - if r.operand(1) != -1 { - r.transferCapture(r.operand(0), r.operand(1), r.stackPeek(), r.textPos()) - } else { - r.capture(r.operand(0), r.stackPeek(), r.textPos()) - } - r.trackPush1(r.stackPeek()) - - r.advance(2) - - continue - - case syntax.Capturemark | syntax.Back: - r.trackPop() - r.stackPush(r.trackPeek()) - r.uncapture() - if r.operand(0) != -1 && r.operand(1) != -1 { - r.uncapture() - } - - break - - case syntax.Branchmark: - r.stackPop() - - matched := r.textPos() - r.stackPeek() - - if matched != 0 { // Nonempty match -> loop now - r.trackPush2(r.stackPeek(), r.textPos()) // Save old mark, textpos - r.stackPush(r.textPos()) // Make new mark - r.goTo(r.operand(0)) // Loop - } else { // Empty match -> straight now - r.trackPushNeg1(r.stackPeek()) // Save old mark - r.advance(1) // Straight - } - continue - - case syntax.Branchmark | syntax.Back: - r.trackPopN(2) - r.stackPop() - r.textto(r.trackPeekN(1)) // Recall position - r.trackPushNeg1(r.trackPeek()) // Save old mark - r.advance(1) // Straight - continue - - case syntax.Branchmark | syntax.Back2: - r.trackPop() - r.stackPush(r.trackPeek()) // Recall old mark - break // Backtrack - - case syntax.Lazybranchmark: - { - // We hit this the first time through a lazy loop and after each - // successful match of the inner expression. It simply continues - // on and doesn't loop. - r.stackPop() - - oldMarkPos := r.stackPeek() - - if r.textPos() != oldMarkPos { // Nonempty match -> try to loop again by going to 'back' state - if oldMarkPos != -1 { - r.trackPush2(oldMarkPos, r.textPos()) // Save old mark, textpos - } else { - r.trackPush2(r.textPos(), r.textPos()) - } - } else { - // The inner expression found an empty match, so we'll go directly to 'back2' if we - // backtrack. In this case, we need to push something on the stack, since back2 pops. - // However, in the case of ()+? or similar, this empty match may be legitimate, so push the text - // position associated with that empty match. - r.stackPush(oldMarkPos) - - r.trackPushNeg1(r.stackPeek()) // Save old mark - } - r.advance(1) - continue - } - - case syntax.Lazybranchmark | syntax.Back: - - // After the first time, Lazybranchmark | syntax.Back occurs - // with each iteration of the loop, and therefore with every attempted - // match of the inner expression. We'll try to match the inner expression, - // then go back to Lazybranchmark if successful. If the inner expression - // fails, we go to Lazybranchmark | syntax.Back2 - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.trackPushNeg1(r.trackPeek()) // Save old mark - r.stackPush(pos) // Make new mark - r.textto(pos) // Recall position - r.goTo(r.operand(0)) // Loop - continue - - case syntax.Lazybranchmark | syntax.Back2: - // The lazy loop has failed. We'll do a true backtrack and - // start over before the lazy loop. - r.stackPop() - r.trackPop() - r.stackPush(r.trackPeek()) // Recall old mark - break - - case syntax.Setcount: - r.stackPush2(r.textPos(), r.operand(0)) - r.trackPush() - r.advance(1) - continue - - case syntax.Nullcount: - r.stackPush2(-1, r.operand(0)) - r.trackPush() - r.advance(1) - continue - - case syntax.Setcount | syntax.Back: - r.stackPopN(2) - break - - case syntax.Nullcount | syntax.Back: - r.stackPopN(2) - break - - case syntax.Branchcount: - // r.stackPush: - // 0: Mark - // 1: Count - - r.stackPopN(2) - mark := r.stackPeek() - count := r.stackPeekN(1) - matched := r.textPos() - mark - - if count >= r.operand(1) || (matched == 0 && count >= 0) { // Max loops or empty match -> straight now - r.trackPushNeg2(mark, count) // Save old mark, count - r.advance(2) // Straight - } else { // Nonempty match -> count+loop now - r.trackPush1(mark) // remember mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop - } - continue - - case syntax.Branchcount | syntax.Back: - // r.trackPush: - // 0: Previous mark - // r.stackPush: - // 0: Mark (= current pos, discarded) - // 1: Count - r.trackPop() - r.stackPopN(2) - if r.stackPeekN(1) > 0 { // Positive -> can go straight - r.textto(r.stackPeek()) // Zap to mark - r.trackPushNeg2(r.trackPeek(), r.stackPeekN(1)-1) // Save old mark, old count - r.advance(2) // Straight - continue - } - r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // recall old mark, old count - break - - case syntax.Branchcount | syntax.Back2: - // r.trackPush: - // 0: Previous mark - // 1: Previous count - r.trackPopN(2) - r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, old count - break // Backtrack - - case syntax.Lazybranchcount: - // r.stackPush: - // 0: Mark - // 1: Count - - r.stackPopN(2) - mark := r.stackPeek() - count := r.stackPeekN(1) - - if count < 0 { // Negative count -> loop now - r.trackPushNeg1(mark) // Save old mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop - } else { // Nonneg count -> straight now - r.trackPush3(mark, count, r.textPos()) // Save mark, count, position - r.advance(2) // Straight - } - continue - - case syntax.Lazybranchcount | syntax.Back: - // r.trackPush: - // 0: Mark - // 1: Count - // 2: r.textPos - - r.trackPopN(3) - mark := r.trackPeek() - textpos := r.trackPeekN(2) - - if r.trackPeekN(1) < r.operand(1) && textpos != mark { // Under limit and not empty match -> loop - r.textto(textpos) // Recall position - r.stackPush2(textpos, r.trackPeekN(1)+1) // Make new mark, incr count - r.trackPushNeg1(mark) // Save old mark - r.goTo(r.operand(0)) // Loop - continue - } else { // Max loops or empty match -> backtrack - r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, count - break // backtrack - } - - case syntax.Lazybranchcount | syntax.Back2: - // r.trackPush: - // 0: Previous mark - // r.stackPush: - // 0: Mark (== current pos, discarded) - // 1: Count - r.trackPop() - r.stackPopN(2) - r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // Recall old mark, count - break // Backtrack - - case syntax.Setjump: - r.stackPush2(r.trackpos(), r.crawlpos()) - r.trackPush() - r.advance(0) - continue - - case syntax.Setjump | syntax.Back: - r.stackPopN(2) - break - - case syntax.Backjump: - // r.stackPush: - // 0: Saved trackpos - // 1: r.crawlpos - r.stackPopN(2) - r.trackto(r.stackPeek()) - - for r.crawlpos() != r.stackPeekN(1) { - r.uncapture() - } - - break - - case syntax.Forejump: - // r.stackPush: - // 0: Saved trackpos - // 1: r.crawlpos - r.stackPopN(2) - r.trackto(r.stackPeek()) - r.trackPush1(r.stackPeekN(1)) - r.advance(0) - continue - - case syntax.Forejump | syntax.Back: - // r.trackPush: - // 0: r.crawlpos - r.trackPop() - - for r.crawlpos() != r.trackPeek() { - r.uncapture() - } - - break - - case syntax.Bol: - if r.leftchars() > 0 && r.charAt(r.textPos()-1) != '\n' { - break - } - r.advance(0) - continue - - case syntax.Eol: - if r.rightchars() > 0 && r.charAt(r.textPos()) != '\n' { - break - } - r.advance(0) - continue - - case syntax.Boundary: - if !r.isBoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.Nonboundary: - if r.isBoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.ECMABoundary: - if !r.isECMABoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.NonECMABoundary: - if r.isECMABoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.Beginning: - if r.leftchars() > 0 { - break - } - r.advance(0) - continue - - case syntax.Start: - if r.textPos() != r.textstart() { - break - } - r.advance(0) - continue - - case syntax.EndZ: - if r.rightchars() > 1 || r.rightchars() == 1 && r.charAt(r.textPos()) != '\n' { - break - } - r.advance(0) - continue - - case syntax.End: - if r.rightchars() > 0 { - break - } - r.advance(0) - continue - - case syntax.One: - if r.forwardchars() < 1 || r.forwardcharnext() != rune(r.operand(0)) { - break - } - - r.advance(1) - continue - - case syntax.Notone: - if r.forwardchars() < 1 || r.forwardcharnext() == rune(r.operand(0)) { - break - } - - r.advance(1) - continue - - case syntax.Set: - - if r.forwardchars() < 1 || !r.code.Sets[r.operand(0)].CharIn(r.forwardcharnext()) { - break - } - - r.advance(1) - continue - - case syntax.Multi: - if !r.runematch(r.code.Strings[r.operand(0)]) { - break - } - - r.advance(1) - continue - - case syntax.Ref: - - capnum := r.operand(0) - - if r.runmatch.isMatched(capnum) { - if !r.refmatch(r.runmatch.matchIndex(capnum), r.runmatch.matchLength(capnum)) { - break - } - } else { - if (r.re.options & ECMAScript) == 0 { - break - } - } - - r.advance(1) - continue - - case syntax.Onerep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - - ch := rune(r.operand(0)) - - for c > 0 { - if r.forwardcharnext() != ch { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Notonerep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - ch := rune(r.operand(0)) - - for c > 0 { - if r.forwardcharnext() == ch { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Setrep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - - set := r.code.Sets[r.operand(0)] - - for c > 0 { - if !set.CharIn(r.forwardcharnext()) { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Oneloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - ch := rune(r.operand(0)) - i := c - - for ; i > 0; i-- { - if r.forwardcharnext() != ch { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Notoneloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - ch := rune(r.operand(0)) - i := c - - for ; i > 0; i-- { - if r.forwardcharnext() == ch { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Setloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - set := r.code.Sets[r.operand(0)] - i := c - - for ; i > 0; i-- { - if !set.CharIn(r.forwardcharnext()) { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Oneloop | syntax.Back, syntax.Notoneloop | syntax.Back: - - r.trackPopN(2) - i := r.trackPeek() - pos := r.trackPeekN(1) - - r.textto(pos) - - if i > 0 { - r.trackPush2(i-1, pos-r.bump()) - } - - r.advance(2) - continue - - case syntax.Setloop | syntax.Back: - - r.trackPopN(2) - i := r.trackPeek() - pos := r.trackPeekN(1) - - r.textto(pos) - - if i > 0 { - r.trackPush2(i-1, pos-r.bump()) - } - - r.advance(2) - continue - - case syntax.Onelazy, syntax.Notonelazy: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - if c > 0 { - r.trackPush2(c-1, r.textPos()) - } - - r.advance(2) - continue - - case syntax.Setlazy: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - if c > 0 { - r.trackPush2(c-1, r.textPos()) - } - - r.advance(2) - continue - - case syntax.Onelazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if r.forwardcharnext() != rune(r.operand(0)) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - case syntax.Notonelazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if r.forwardcharnext() == rune(r.operand(0)) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - case syntax.Setlazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if !r.code.Sets[r.operand(0)].CharIn(r.forwardcharnext()) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - default: - return errors.New("unknown state in regex runner") - } - - BreakBackward: - ; - - // "break Backward" comes here: - r.backtrack() - } -} - -// increase the size of stack and track storage -func (r *runner) ensureStorage() { - if r.runstackpos < r.runtrackcount*4 { - doubleIntSlice(&r.runstack, &r.runstackpos) - } - if r.runtrackpos < r.runtrackcount*4 { - doubleIntSlice(&r.runtrack, &r.runtrackpos) - } -} - -func doubleIntSlice(s *[]int, pos *int) { - oldLen := len(*s) - newS := make([]int, oldLen*2) - - copy(newS[oldLen:], *s) - *pos += oldLen - *s = newS -} - -// Save a number on the longjump unrolling stack -func (r *runner) crawl(i int) { - if r.runcrawlpos == 0 { - doubleIntSlice(&r.runcrawl, &r.runcrawlpos) - } - r.runcrawlpos-- - r.runcrawl[r.runcrawlpos] = i -} - -// Remove a number from the longjump unrolling stack -func (r *runner) popcrawl() int { - val := r.runcrawl[r.runcrawlpos] - r.runcrawlpos++ - return val -} - -// Get the height of the stack -func (r *runner) crawlpos() int { - return len(r.runcrawl) - r.runcrawlpos -} - -func (r *runner) advance(i int) { - r.codepos += (i + 1) - r.setOperator(r.code.Codes[r.codepos]) -} - -func (r *runner) goTo(newpos int) { - // when branching backward, ensure storage - if newpos < r.codepos { - r.ensureStorage() - } - - r.setOperator(r.code.Codes[newpos]) - r.codepos = newpos -} - -func (r *runner) textto(newpos int) { - r.runtextpos = newpos -} - -func (r *runner) trackto(newpos int) { - r.runtrackpos = len(r.runtrack) - newpos -} - -func (r *runner) textstart() int { - return r.runtextstart -} - -func (r *runner) textPos() int { - return r.runtextpos -} - -// push onto the backtracking stack -func (r *runner) trackpos() int { - return len(r.runtrack) - r.runtrackpos -} - -func (r *runner) trackPush() { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush1(I1 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush2(I1, I2 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush3(I1, I2, I3 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I3 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPushNeg1(I1 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = -r.codepos -} - -func (r *runner) trackPushNeg2(I1, I2 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = -r.codepos -} - -func (r *runner) backtrack() { - newpos := r.runtrack[r.runtrackpos] - r.runtrackpos++ - - if r.re.Debug() { - if newpos < 0 { - fmt.Printf(" Backtracking (back2) to code position %v\n", -newpos) - } else { - fmt.Printf(" Backtracking to code position %v\n", newpos) - } - } - - if newpos < 0 { - newpos = -newpos - r.setOperator(r.code.Codes[newpos] | syntax.Back2) - } else { - r.setOperator(r.code.Codes[newpos] | syntax.Back) - } - - // When branching backward, ensure storage - if newpos < r.codepos { - r.ensureStorage() - } - - r.codepos = newpos -} - -func (r *runner) setOperator(op int) { - r.caseInsensitive = (0 != (op & syntax.Ci)) - r.rightToLeft = (0 != (op & syntax.Rtl)) - r.operator = syntax.InstOp(op & ^(syntax.Rtl | syntax.Ci)) -} - -func (r *runner) trackPop() { - r.runtrackpos++ -} - -// pop framesize items from the backtracking stack -func (r *runner) trackPopN(framesize int) { - r.runtrackpos += framesize -} - -// Technically we are actually peeking at items already popped. So if you want to -// get and pop the top item from the stack, you do -// r.trackPop(); -// r.trackPeek(); -func (r *runner) trackPeek() int { - return r.runtrack[r.runtrackpos-1] -} - -// get the ith element down on the backtracking stack -func (r *runner) trackPeekN(i int) int { - return r.runtrack[r.runtrackpos-i-1] -} - -// Push onto the grouping stack -func (r *runner) stackPush(I1 int) { - r.runstackpos-- - r.runstack[r.runstackpos] = I1 -} - -func (r *runner) stackPush2(I1, I2 int) { - r.runstackpos-- - r.runstack[r.runstackpos] = I1 - r.runstackpos-- - r.runstack[r.runstackpos] = I2 -} - -func (r *runner) stackPop() { - r.runstackpos++ -} - -// pop framesize items from the grouping stack -func (r *runner) stackPopN(framesize int) { - r.runstackpos += framesize -} - -// Technically we are actually peeking at items already popped. So if you want to -// get and pop the top item from the stack, you do -// r.stackPop(); -// r.stackPeek(); -func (r *runner) stackPeek() int { - return r.runstack[r.runstackpos-1] -} - -// get the ith element down on the grouping stack -func (r *runner) stackPeekN(i int) int { - return r.runstack[r.runstackpos-i-1] -} - -func (r *runner) operand(i int) int { - return r.code.Codes[r.codepos+i+1] -} - -func (r *runner) leftchars() int { - return r.runtextpos -} - -func (r *runner) rightchars() int { - return r.runtextend - r.runtextpos -} - -func (r *runner) bump() int { - if r.rightToLeft { - return -1 - } - return 1 -} - -func (r *runner) forwardchars() int { - if r.rightToLeft { - return r.runtextpos - } - return r.runtextend - r.runtextpos -} - -func (r *runner) forwardcharnext() rune { - var ch rune - if r.rightToLeft { - r.runtextpos-- - ch = r.runtext[r.runtextpos] - } else { - ch = r.runtext[r.runtextpos] - r.runtextpos++ - } - - if r.caseInsensitive { - return unicode.ToLower(ch) - } - return ch -} - -func (r *runner) runematch(str []rune) bool { - var pos int - - c := len(str) - if !r.rightToLeft { - if r.runtextend-r.runtextpos < c { - return false - } - - pos = r.runtextpos + c - } else { - if r.runtextpos-0 < c { - return false - } - - pos = r.runtextpos - } - - if !r.caseInsensitive { - for c != 0 { - c-- - pos-- - if str[c] != r.runtext[pos] { - return false - } - } - } else { - for c != 0 { - c-- - pos-- - if str[c] != unicode.ToLower(r.runtext[pos]) { - return false - } - } - } - - if !r.rightToLeft { - pos += len(str) - } - - r.runtextpos = pos - - return true -} - -func (r *runner) refmatch(index, len int) bool { - var c, pos, cmpos int - - if !r.rightToLeft { - if r.runtextend-r.runtextpos < len { - return false - } - - pos = r.runtextpos + len - } else { - if r.runtextpos-0 < len { - return false - } - - pos = r.runtextpos - } - cmpos = index + len - - c = len - - if !r.caseInsensitive { - for c != 0 { - c-- - cmpos-- - pos-- - if r.runtext[cmpos] != r.runtext[pos] { - return false - } - - } - } else { - for c != 0 { - c-- - cmpos-- - pos-- - - if unicode.ToLower(r.runtext[cmpos]) != unicode.ToLower(r.runtext[pos]) { - return false - } - } - } - - if !r.rightToLeft { - pos += len - } - - r.runtextpos = pos - - return true -} - -func (r *runner) backwardnext() { - if r.rightToLeft { - r.runtextpos++ - } else { - r.runtextpos-- - } -} - -func (r *runner) charAt(j int) rune { - return r.runtext[j] -} - -func (r *runner) findFirstChar() bool { - - if 0 != (r.code.Anchors & (syntax.AnchorBeginning | syntax.AnchorStart | syntax.AnchorEndZ | syntax.AnchorEnd)) { - if !r.code.RightToLeft { - if (0 != (r.code.Anchors&syntax.AnchorBeginning) && r.runtextpos > 0) || - (0 != (r.code.Anchors&syntax.AnchorStart) && r.runtextpos > r.runtextstart) { - r.runtextpos = r.runtextend - return false - } - if 0 != (r.code.Anchors&syntax.AnchorEndZ) && r.runtextpos < r.runtextend-1 { - r.runtextpos = r.runtextend - 1 - } else if 0 != (r.code.Anchors&syntax.AnchorEnd) && r.runtextpos < r.runtextend { - r.runtextpos = r.runtextend - } - } else { - if (0 != (r.code.Anchors&syntax.AnchorEnd) && r.runtextpos < r.runtextend) || - (0 != (r.code.Anchors&syntax.AnchorEndZ) && (r.runtextpos < r.runtextend-1 || - (r.runtextpos == r.runtextend-1 && r.charAt(r.runtextpos) != '\n'))) || - (0 != (r.code.Anchors&syntax.AnchorStart) && r.runtextpos < r.runtextstart) { - r.runtextpos = 0 - return false - } - if 0 != (r.code.Anchors&syntax.AnchorBeginning) && r.runtextpos > 0 { - r.runtextpos = 0 - } - } - - if r.code.BmPrefix != nil { - return r.code.BmPrefix.IsMatch(r.runtext, r.runtextpos, 0, r.runtextend) - } - - return true // found a valid start or end anchor - } else if r.code.BmPrefix != nil { - r.runtextpos = r.code.BmPrefix.Scan(r.runtext, r.runtextpos, 0, r.runtextend) - - if r.runtextpos == -1 { - if r.code.RightToLeft { - r.runtextpos = 0 - } else { - r.runtextpos = r.runtextend - } - return false - } - - return true - } else if r.code.FcPrefix == nil { - return true - } - - r.rightToLeft = r.code.RightToLeft - r.caseInsensitive = r.code.FcPrefix.CaseInsensitive - - set := r.code.FcPrefix.PrefixSet - if set.IsSingleton() { - ch := set.SingletonChar() - for i := r.forwardchars(); i > 0; i-- { - if ch == r.forwardcharnext() { - r.backwardnext() - return true - } - } - } else { - for i := r.forwardchars(); i > 0; i-- { - n := r.forwardcharnext() - //fmt.Printf("%v in %v: %v\n", string(n), set.String(), set.CharIn(n)) - if set.CharIn(n) { - r.backwardnext() - return true - } - } - } - - return false -} - -func (r *runner) initMatch() { - // Use a hashtable'ed Match object if the capture numbers are sparse - - if r.runmatch == nil { - if r.re.caps != nil { - r.runmatch = newMatchSparse(r.re, r.re.caps, r.re.capsize, r.runtext, r.runtextstart) - } else { - r.runmatch = newMatch(r.re, r.re.capsize, r.runtext, r.runtextstart) - } - } else { - r.runmatch.reset(r.runtext, r.runtextstart) - } - - // note we test runcrawl, because it is the last one to be allocated - // If there is an alloc failure in the middle of the three allocations, - // we may still return to reuse this instance, and we want to behave - // as if the allocations didn't occur. (we used to test _trackcount != 0) - - if r.runcrawl != nil { - r.runtrackpos = len(r.runtrack) - r.runstackpos = len(r.runstack) - r.runcrawlpos = len(r.runcrawl) - return - } - - r.initTrackCount() - - tracksize := r.runtrackcount * 8 - stacksize := r.runtrackcount * 8 - - if tracksize < 32 { - tracksize = 32 - } - if stacksize < 16 { - stacksize = 16 - } - - r.runtrack = make([]int, tracksize) - r.runtrackpos = tracksize - - r.runstack = make([]int, stacksize) - r.runstackpos = stacksize - - r.runcrawl = make([]int, 32) - r.runcrawlpos = 32 -} - -func (r *runner) tidyMatch(quick bool) *Match { - if !quick { - match := r.runmatch - - r.runmatch = nil - - match.tidy(r.runtextpos) - return match - } else { - // send back our match -- it's not leaving the package, so it's safe to not clean it up - // this reduces allocs for frequent calls to the "IsMatch" bool-only functions - return r.runmatch - } -} - -// capture captures a subexpression. Note that the -// capnum used here has already been mapped to a non-sparse -// index (by the code generator RegexWriter). -func (r *runner) capture(capnum, start, end int) { - if end < start { - T := end - end = start - start = T - } - - r.crawl(capnum) - r.runmatch.addMatch(capnum, start, end-start) -} - -// transferCapture captures a subexpression. Note that the -// capnum used here has already been mapped to a non-sparse -// index (by the code generator RegexWriter). -func (r *runner) transferCapture(capnum, uncapnum, start, end int) { - var start2, end2 int - - // these are the two intervals that are cancelling each other - - if end < start { - T := end - end = start - start = T - } - - start2 = r.runmatch.matchIndex(uncapnum) - end2 = start2 + r.runmatch.matchLength(uncapnum) - - // The new capture gets the innermost defined interval - - if start >= end2 { - end = start - start = end2 - } else if end <= start2 { - start = start2 - } else { - if end > end2 { - end = end2 - } - if start2 > start { - start = start2 - } - } - - r.crawl(uncapnum) - r.runmatch.balanceMatch(uncapnum) - - if capnum != -1 { - r.crawl(capnum) - r.runmatch.addMatch(capnum, start, end-start) - } -} - -// revert the last capture -func (r *runner) uncapture() { - capnum := r.popcrawl() - r.runmatch.removeMatch(capnum) -} - -//debug - -func (r *runner) dumpState() { - back := "" - if r.operator&syntax.Back != 0 { - back = " Back" - } - if r.operator&syntax.Back2 != 0 { - back += " Back2" - } - fmt.Printf("Text: %v\nTrack: %v\nStack: %v\n %s%s\n\n", - r.textposDescription(), - r.stackDescription(r.runtrack, r.runtrackpos), - r.stackDescription(r.runstack, r.runstackpos), - r.code.OpcodeDescription(r.codepos), - back) -} - -func (r *runner) stackDescription(a []int, index int) string { - buf := &bytes.Buffer{} - - fmt.Fprintf(buf, "%v/%v", len(a)-index, len(a)) - if buf.Len() < 8 { - buf.WriteString(strings.Repeat(" ", 8-buf.Len())) - } - - buf.WriteRune('(') - for i := index; i < len(a); i++ { - if i > index { - buf.WriteRune(' ') - } - - buf.WriteString(strconv.Itoa(a[i])) - } - - buf.WriteRune(')') - - return buf.String() -} - -func (r *runner) textposDescription() string { - buf := &bytes.Buffer{} - - buf.WriteString(strconv.Itoa(r.runtextpos)) - - if buf.Len() < 8 { - buf.WriteString(strings.Repeat(" ", 8-buf.Len())) - } - - if r.runtextpos > 0 { - buf.WriteString(syntax.CharDescription(r.runtext[r.runtextpos-1])) - } else { - buf.WriteRune('^') - } - - buf.WriteRune('>') - - for i := r.runtextpos; i < r.runtextend; i++ { - buf.WriteString(syntax.CharDescription(r.runtext[i])) - } - if buf.Len() >= 64 { - buf.Truncate(61) - buf.WriteString("...") - } else { - buf.WriteRune('$') - } - - return buf.String() -} - -// decide whether the pos -// at the specified index is a boundary or not. It's just not worth -// emitting inline code for this logic. -func (r *runner) isBoundary(index, startpos, endpos int) bool { - return (index > startpos && syntax.IsWordChar(r.runtext[index-1])) != - (index < endpos && syntax.IsWordChar(r.runtext[index])) -} - -func (r *runner) isECMABoundary(index, startpos, endpos int) bool { - return (index > startpos && syntax.IsECMAWordChar(r.runtext[index-1])) != - (index < endpos && syntax.IsECMAWordChar(r.runtext[index])) -} - -// this seems like a comment to justify randomly picking 1000 :-P -// We have determined this value in a series of experiments where x86 retail -// builds (ono-lab-optimized) were run on different pattern/input pairs. Larger values -// of TimeoutCheckFrequency did not tend to increase performance; smaller values -// of TimeoutCheckFrequency tended to slow down the execution. -const timeoutCheckFrequency int = 1000 - -func (r *runner) startTimeoutWatch() { - if r.ignoreTimeout { - return - } - - r.timeoutChecksToSkip = timeoutCheckFrequency - r.timeoutAt = time.Now().Add(r.timeout) -} - -func (r *runner) checkTimeout() error { - if r.ignoreTimeout { - return nil - } - r.timeoutChecksToSkip-- - if r.timeoutChecksToSkip != 0 { - return nil - } - - r.timeoutChecksToSkip = timeoutCheckFrequency - return r.doCheckTimeout() -} - -func (r *runner) doCheckTimeout() error { - current := time.Now() - - if current.Before(r.timeoutAt) { - return nil - } - - if r.re.Debug() { - //Debug.WriteLine("") - //Debug.WriteLine("RegEx match timeout occurred!") - //Debug.WriteLine("Specified timeout: " + TimeSpan.FromMilliseconds(_timeout).ToString()) - //Debug.WriteLine("Timeout check frequency: " + TimeoutCheckFrequency) - //Debug.WriteLine("Search pattern: " + _runregex._pattern) - //Debug.WriteLine("Input: " + r.runtext) - //Debug.WriteLine("About to throw RegexMatchTimeoutException.") - } - - return fmt.Errorf("match timeout after %v on input `%v`", r.timeout, string(r.runtext)) -} - -func (r *runner) initTrackCount() { - r.runtrackcount = r.code.TrackCount -} - -// getRunner returns a run to use for matching re. -// It uses the re's runner cache if possible, to avoid -// unnecessary allocation. -func (re *Regexp) getRunner() *runner { - re.muRun.Lock() - if n := len(re.runner); n > 0 { - z := re.runner[n-1] - re.runner = re.runner[:n-1] - re.muRun.Unlock() - return z - } - re.muRun.Unlock() - z := &runner{ - re: re, - code: re.code, - } - return z -} - -// putRunner returns a runner to the re's cache. -// There is no attempt to limit the size of the cache, so it will -// grow to the maximum number of simultaneous matches -// run using re. (The cache empties when re gets garbage collected.) -func (re *Regexp) putRunner(r *runner) { - re.muRun.Lock() - re.runner = append(re.runner, r) - re.muRun.Unlock() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/charclass.go b/vendor/github.com/dlclark/regexp2/syntax/charclass.go deleted file mode 100644 index f312ea7a..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/charclass.go +++ /dev/null @@ -1,784 +0,0 @@ -package syntax - -import ( - "bytes" - "encoding/binary" - "fmt" - "sort" - "unicode" - "unicode/utf8" -) - -// CharSet combines start-end rune ranges and unicode categories representing a set of characters -type CharSet struct { - ranges []singleRange - categories []category - sub *CharSet //optional subtractor - negate bool - anything bool -} - -type category struct { - negate bool - cat string -} - -type singleRange struct { - first rune - last rune -} - -const ( - spaceCategoryText = " " - wordCategoryText = "W" -) - -var ( - ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00} - ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b} - ecmaDigit = []rune{0x0030, 0x003a} -) - -var ( - AnyClass = getCharSetFromOldString([]rune{0}, false) - ECMAAnyClass = getCharSetFromOldString([]rune{0, 0x000a, 0x000b, 0x000d, 0x000e}, false) - NoneClass = getCharSetFromOldString(nil, false) - ECMAWordClass = getCharSetFromOldString(ecmaWord, false) - NotECMAWordClass = getCharSetFromOldString(ecmaWord, true) - ECMASpaceClass = getCharSetFromOldString(ecmaSpace, false) - NotECMASpaceClass = getCharSetFromOldString(ecmaSpace, true) - ECMADigitClass = getCharSetFromOldString(ecmaDigit, false) - NotECMADigitClass = getCharSetFromOldString(ecmaDigit, true) - - WordClass = getCharSetFromCategoryString(false, false, wordCategoryText) - NotWordClass = getCharSetFromCategoryString(true, false, wordCategoryText) - SpaceClass = getCharSetFromCategoryString(false, false, spaceCategoryText) - NotSpaceClass = getCharSetFromCategoryString(true, false, spaceCategoryText) - DigitClass = getCharSetFromCategoryString(false, false, "Nd") - NotDigitClass = getCharSetFromCategoryString(false, true, "Nd") -) - -var unicodeCategories = func() map[string]*unicode.RangeTable { - retVal := make(map[string]*unicode.RangeTable) - for k, v := range unicode.Scripts { - retVal[k] = v - } - for k, v := range unicode.Categories { - retVal[k] = v - } - for k, v := range unicode.Properties { - retVal[k] = v - } - return retVal -}() - -func getCharSetFromCategoryString(negateSet bool, negateCat bool, cats ...string) func() *CharSet { - if negateCat && negateSet { - panic("BUG! You should only negate the set OR the category in a constant setup, but not both") - } - - c := CharSet{negate: negateSet} - - c.categories = make([]category, len(cats)) - for i, cat := range cats { - c.categories[i] = category{cat: cat, negate: negateCat} - } - return func() *CharSet { - //make a copy each time - local := c - //return that address - return &local - } -} - -func getCharSetFromOldString(setText []rune, negate bool) func() *CharSet { - c := CharSet{} - if len(setText) > 0 { - fillFirst := false - l := len(setText) - if negate { - if setText[0] == 0 { - setText = setText[1:] - } else { - l++ - fillFirst = true - } - } - - if l%2 == 0 { - c.ranges = make([]singleRange, l/2) - } else { - c.ranges = make([]singleRange, l/2+1) - } - - first := true - if fillFirst { - c.ranges[0] = singleRange{first: 0} - first = false - } - - i := 0 - for _, r := range setText { - if first { - // lower bound in a new range - c.ranges[i] = singleRange{first: r} - first = false - } else { - c.ranges[i].last = r - 1 - i++ - first = true - } - } - if !first { - c.ranges[i].last = utf8.MaxRune - } - } - - return func() *CharSet { - local := c - return &local - } -} - -// Copy makes a deep copy to prevent accidental mutation of a set -func (c CharSet) Copy() CharSet { - ret := CharSet{ - anything: c.anything, - negate: c.negate, - } - - ret.ranges = append(ret.ranges, c.ranges...) - ret.categories = append(ret.categories, c.categories...) - - if c.sub != nil { - sub := c.sub.Copy() - ret.sub = &sub - } - - return ret -} - -// gets a human-readable description for a set string -func (c CharSet) String() string { - buf := &bytes.Buffer{} - buf.WriteRune('[') - - if c.IsNegated() { - buf.WriteRune('^') - } - - for _, r := range c.ranges { - - buf.WriteString(CharDescription(r.first)) - if r.first != r.last { - if r.last-r.first != 1 { - //groups that are 1 char apart skip the dash - buf.WriteRune('-') - } - buf.WriteString(CharDescription(r.last)) - } - } - - for _, c := range c.categories { - buf.WriteString(c.String()) - } - - if c.sub != nil { - buf.WriteRune('-') - buf.WriteString(c.sub.String()) - } - - buf.WriteRune(']') - - return buf.String() -} - -// mapHashFill converts a charset into a buffer for use in maps -func (c CharSet) mapHashFill(buf *bytes.Buffer) { - if c.negate { - buf.WriteByte(0) - } else { - buf.WriteByte(1) - } - - binary.Write(buf, binary.LittleEndian, len(c.ranges)) - binary.Write(buf, binary.LittleEndian, len(c.categories)) - for _, r := range c.ranges { - buf.WriteRune(r.first) - buf.WriteRune(r.last) - } - for _, ct := range c.categories { - buf.WriteString(ct.cat) - if ct.negate { - buf.WriteByte(1) - } else { - buf.WriteByte(0) - } - } - - if c.sub != nil { - c.sub.mapHashFill(buf) - } -} - -// CharIn returns true if the rune is in our character set (either ranges or categories). -// It handles negations and subtracted sub-charsets. -func (c CharSet) CharIn(ch rune) bool { - val := false - // in s && !s.subtracted - - //check ranges - for _, r := range c.ranges { - if ch < r.first { - continue - } - if ch <= r.last { - val = true - break - } - } - - //check categories if we haven't already found a range - if !val && len(c.categories) > 0 { - for _, ct := range c.categories { - // special categories...then unicode - if ct.cat == spaceCategoryText { - if unicode.IsSpace(ch) { - // we found a space so we're done - // negate means this is a "bad" thing - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } else if ct.cat == wordCategoryText { - if IsWordChar(ch) { - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } else if unicode.Is(unicodeCategories[ct.cat], ch) { - // if we're in this unicode category then we're done - // if negate=true on this category then we "failed" our test - // otherwise we're good that we found it - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } - } - - // negate the whole char set - if c.negate { - val = !val - } - - // get subtracted recurse - if val && c.sub != nil { - val = !c.sub.CharIn(ch) - } - - //log.Printf("Char '%v' in %v == %v", string(ch), c.String(), val) - return val -} - -func (c category) String() string { - switch c.cat { - case spaceCategoryText: - if c.negate { - return "\\S" - } - return "\\s" - case wordCategoryText: - if c.negate { - return "\\W" - } - return "\\w" - } - if _, ok := unicodeCategories[c.cat]; ok { - - if c.negate { - return "\\P{" + c.cat + "}" - } - return "\\p{" + c.cat + "}" - } - return "Unknown category: " + c.cat -} - -// CharDescription Produces a human-readable description for a single character. -func CharDescription(ch rune) string { - /*if ch == '\\' { - return "\\\\" - } - - if ch > ' ' && ch <= '~' { - return string(ch) - } else if ch == '\n' { - return "\\n" - } else if ch == ' ' { - return "\\ " - }*/ - - b := &bytes.Buffer{} - escape(b, ch, false) //fmt.Sprintf("%U", ch) - return b.String() -} - -// According to UTS#18 Unicode Regular Expressions (http://www.unicode.org/reports/tr18/) -// RL 1.4 Simple Word Boundaries The class of includes all Alphabetic -// values from the Unicode character database, from UnicodeData.txt [UData], plus the U+200C -// ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER. -func IsWordChar(r rune) bool { - //"L", "Mn", "Nd", "Pc" - return unicode.In(r, - unicode.Categories["L"], unicode.Categories["Mn"], - unicode.Categories["Nd"], unicode.Categories["Pc"]) || r == '\u200D' || r == '\u200C' - //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' -} - -func IsECMAWordChar(r rune) bool { - return unicode.In(r, - unicode.Categories["L"], unicode.Categories["Mn"], - unicode.Categories["Nd"], unicode.Categories["Pc"]) - - //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' -} - -// SingletonChar will return the char from the first range without validation. -// It assumes you have checked for IsSingleton or IsSingletonInverse and will panic given bad input -func (c CharSet) SingletonChar() rune { - return c.ranges[0].first -} - -func (c CharSet) IsSingleton() bool { - return !c.negate && //negated is multiple chars - len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars - c.sub == nil && // subtraction means we've got multiple chars - c.ranges[0].first == c.ranges[0].last // first and last equal means we're just 1 char -} - -func (c CharSet) IsSingletonInverse() bool { - return c.negate && //same as above, but requires negated - len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars - c.sub == nil && // subtraction means we've got multiple chars - c.ranges[0].first == c.ranges[0].last // first and last equal means we're just 1 char -} - -func (c CharSet) IsMergeable() bool { - return !c.IsNegated() && !c.HasSubtraction() -} - -func (c CharSet) IsNegated() bool { - return c.negate -} - -func (c CharSet) HasSubtraction() bool { - return c.sub != nil -} - -func (c CharSet) IsEmpty() bool { - return len(c.ranges) == 0 && len(c.categories) == 0 && c.sub == nil -} - -func (c *CharSet) addDigit(ecma, negate bool, pattern string) { - if ecma { - if negate { - c.addRanges(NotECMADigitClass().ranges) - } else { - c.addRanges(ECMADigitClass().ranges) - } - } else { - c.addCategories(category{cat: "Nd", negate: negate}) - } -} - -func (c *CharSet) addChar(ch rune) { - c.addRange(ch, ch) -} - -func (c *CharSet) addSpace(ecma, negate bool) { - if ecma { - if negate { - c.addRanges(NotECMASpaceClass().ranges) - } else { - c.addRanges(ECMASpaceClass().ranges) - } - } else { - c.addCategories(category{cat: spaceCategoryText, negate: negate}) - } -} - -func (c *CharSet) addWord(ecma, negate bool) { - if ecma { - if negate { - c.addRanges(NotECMAWordClass().ranges) - } else { - c.addRanges(ECMAWordClass().ranges) - } - } else { - c.addCategories(category{cat: wordCategoryText, negate: negate}) - } -} - -// Add set ranges and categories into ours -- no deduping or anything -func (c *CharSet) addSet(set CharSet) { - if c.anything { - return - } - if set.anything { - c.makeAnything() - return - } - // just append here to prevent double-canon - c.ranges = append(c.ranges, set.ranges...) - c.addCategories(set.categories...) - c.canonicalize() -} - -func (c *CharSet) makeAnything() { - c.anything = true - c.categories = []category{} - c.ranges = AnyClass().ranges -} - -func (c *CharSet) addCategories(cats ...category) { - // don't add dupes and remove positive+negative - if c.anything { - // if we've had a previous positive+negative group then - // just return, we're as broad as we can get - return - } - - for _, ct := range cats { - found := false - for _, ct2 := range c.categories { - if ct.cat == ct2.cat { - if ct.negate != ct2.negate { - // oposite negations...this mean we just - // take us as anything and move on - c.makeAnything() - return - } - found = true - break - } - } - - if !found { - c.categories = append(c.categories, ct) - } - } -} - -// Merges new ranges to our own -func (c *CharSet) addRanges(ranges []singleRange) { - if c.anything { - return - } - c.ranges = append(c.ranges, ranges...) - c.canonicalize() -} - -func isValidUnicodeCat(catName string) bool { - _, ok := unicodeCategories[catName] - return ok -} - -func (c *CharSet) addCategory(categoryName string, negate, caseInsensitive bool, pattern string) { - if !isValidUnicodeCat(categoryName) { - // unknown unicode category, script, or property "blah" - panic(fmt.Errorf("Unknown unicode category, script, or property '%v'", categoryName)) - - } - - if caseInsensitive && (categoryName == "Ll" || categoryName == "Lu" || categoryName == "Lt") { - // when RegexOptions.IgnoreCase is specified then {Ll} {Lu} and {Lt} cases should all match - c.addCategories( - category{cat: "Ll", negate: negate}, - category{cat: "Lu", negate: negate}, - category{cat: "Lt", negate: negate}) - } - c.addCategories(category{cat: categoryName, negate: negate}) -} - -func (c *CharSet) addSubtraction(sub *CharSet) { - c.sub = sub -} - -func (c *CharSet) addRange(chMin, chMax rune) { - c.ranges = append(c.ranges, singleRange{first: chMin, last: chMax}) - c.canonicalize() -} - -type singleRangeSorter []singleRange - -func (p singleRangeSorter) Len() int { return len(p) } -func (p singleRangeSorter) Less(i, j int) bool { return p[i].first < p[j].first } -func (p singleRangeSorter) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// Logic to reduce a character class to a unique, sorted form. -func (c *CharSet) canonicalize() { - var i, j int - var last rune - - // - // Find and eliminate overlapping or abutting ranges - // - - if len(c.ranges) > 1 { - sort.Sort(singleRangeSorter(c.ranges)) - - done := false - - for i, j = 1, 0; ; i++ { - for last = c.ranges[j].last; ; i++ { - if i == len(c.ranges) || last == utf8.MaxRune { - done = true - break - } - - CurrentRange := c.ranges[i] - if CurrentRange.first > last+1 { - break - } - - if last < CurrentRange.last { - last = CurrentRange.last - } - } - - c.ranges[j] = singleRange{first: c.ranges[j].first, last: last} - - j++ - - if done { - break - } - - if j < i { - c.ranges[j] = c.ranges[i] - } - } - - c.ranges = append(c.ranges[:j], c.ranges[len(c.ranges):]...) - } -} - -// Adds to the class any lowercase versions of characters already -// in the class. Used for case-insensitivity. -func (c *CharSet) addLowercase() { - if c.anything { - return - } - toAdd := []singleRange{} - for i := 0; i < len(c.ranges); i++ { - r := c.ranges[i] - if r.first == r.last { - lower := unicode.ToLower(r.first) - c.ranges[i] = singleRange{first: lower, last: lower} - } else { - toAdd = append(toAdd, r) - } - } - - for _, r := range toAdd { - c.addLowercaseRange(r.first, r.last) - } - c.canonicalize() -} - -/************************************************************************** - Let U be the set of Unicode character values and let L be the lowercase - function, mapping from U to U. To perform case insensitive matching of - character sets, we need to be able to map an interval I in U, say - - I = [chMin, chMax] = { ch : chMin <= ch <= chMax } - - to a set A such that A contains L(I) and A is contained in the union of - I and L(I). - - The table below partitions U into intervals on which L is non-decreasing. - Thus, for any interval J = [a, b] contained in one of these intervals, - L(J) is contained in [L(a), L(b)]. - - It is also true that for any such J, [L(a), L(b)] is contained in the - union of J and L(J). This does not follow from L being non-decreasing on - these intervals. It follows from the nature of the L on each interval. - On each interval, L has one of the following forms: - - (1) L(ch) = constant (LowercaseSet) - (2) L(ch) = ch + offset (LowercaseAdd) - (3) L(ch) = ch | 1 (LowercaseBor) - (4) L(ch) = ch + (ch & 1) (LowercaseBad) - - It is easy to verify that for any of these forms [L(a), L(b)] is - contained in the union of [a, b] and L([a, b]). -***************************************************************************/ - -const ( - LowercaseSet = 0 // Set to arg. - LowercaseAdd = 1 // Add arg. - LowercaseBor = 2 // Bitwise or with 1. - LowercaseBad = 3 // Bitwise and with 1 and add original. -) - -type lcMap struct { - chMin, chMax rune - op, data int32 -} - -var lcTable = []lcMap{ - lcMap{'\u0041', '\u005A', LowercaseAdd, 32}, - lcMap{'\u00C0', '\u00DE', LowercaseAdd, 32}, - lcMap{'\u0100', '\u012E', LowercaseBor, 0}, - lcMap{'\u0130', '\u0130', LowercaseSet, 0x0069}, - lcMap{'\u0132', '\u0136', LowercaseBor, 0}, - lcMap{'\u0139', '\u0147', LowercaseBad, 0}, - lcMap{'\u014A', '\u0176', LowercaseBor, 0}, - lcMap{'\u0178', '\u0178', LowercaseSet, 0x00FF}, - lcMap{'\u0179', '\u017D', LowercaseBad, 0}, - lcMap{'\u0181', '\u0181', LowercaseSet, 0x0253}, - lcMap{'\u0182', '\u0184', LowercaseBor, 0}, - lcMap{'\u0186', '\u0186', LowercaseSet, 0x0254}, - lcMap{'\u0187', '\u0187', LowercaseSet, 0x0188}, - lcMap{'\u0189', '\u018A', LowercaseAdd, 205}, - lcMap{'\u018B', '\u018B', LowercaseSet, 0x018C}, - lcMap{'\u018E', '\u018E', LowercaseSet, 0x01DD}, - lcMap{'\u018F', '\u018F', LowercaseSet, 0x0259}, - lcMap{'\u0190', '\u0190', LowercaseSet, 0x025B}, - lcMap{'\u0191', '\u0191', LowercaseSet, 0x0192}, - lcMap{'\u0193', '\u0193', LowercaseSet, 0x0260}, - lcMap{'\u0194', '\u0194', LowercaseSet, 0x0263}, - lcMap{'\u0196', '\u0196', LowercaseSet, 0x0269}, - lcMap{'\u0197', '\u0197', LowercaseSet, 0x0268}, - lcMap{'\u0198', '\u0198', LowercaseSet, 0x0199}, - lcMap{'\u019C', '\u019C', LowercaseSet, 0x026F}, - lcMap{'\u019D', '\u019D', LowercaseSet, 0x0272}, - lcMap{'\u019F', '\u019F', LowercaseSet, 0x0275}, - lcMap{'\u01A0', '\u01A4', LowercaseBor, 0}, - lcMap{'\u01A7', '\u01A7', LowercaseSet, 0x01A8}, - lcMap{'\u01A9', '\u01A9', LowercaseSet, 0x0283}, - lcMap{'\u01AC', '\u01AC', LowercaseSet, 0x01AD}, - lcMap{'\u01AE', '\u01AE', LowercaseSet, 0x0288}, - lcMap{'\u01AF', '\u01AF', LowercaseSet, 0x01B0}, - lcMap{'\u01B1', '\u01B2', LowercaseAdd, 217}, - lcMap{'\u01B3', '\u01B5', LowercaseBad, 0}, - lcMap{'\u01B7', '\u01B7', LowercaseSet, 0x0292}, - lcMap{'\u01B8', '\u01B8', LowercaseSet, 0x01B9}, - lcMap{'\u01BC', '\u01BC', LowercaseSet, 0x01BD}, - lcMap{'\u01C4', '\u01C5', LowercaseSet, 0x01C6}, - lcMap{'\u01C7', '\u01C8', LowercaseSet, 0x01C9}, - lcMap{'\u01CA', '\u01CB', LowercaseSet, 0x01CC}, - lcMap{'\u01CD', '\u01DB', LowercaseBad, 0}, - lcMap{'\u01DE', '\u01EE', LowercaseBor, 0}, - lcMap{'\u01F1', '\u01F2', LowercaseSet, 0x01F3}, - lcMap{'\u01F4', '\u01F4', LowercaseSet, 0x01F5}, - lcMap{'\u01FA', '\u0216', LowercaseBor, 0}, - lcMap{'\u0386', '\u0386', LowercaseSet, 0x03AC}, - lcMap{'\u0388', '\u038A', LowercaseAdd, 37}, - lcMap{'\u038C', '\u038C', LowercaseSet, 0x03CC}, - lcMap{'\u038E', '\u038F', LowercaseAdd, 63}, - lcMap{'\u0391', '\u03AB', LowercaseAdd, 32}, - lcMap{'\u03E2', '\u03EE', LowercaseBor, 0}, - lcMap{'\u0401', '\u040F', LowercaseAdd, 80}, - lcMap{'\u0410', '\u042F', LowercaseAdd, 32}, - lcMap{'\u0460', '\u0480', LowercaseBor, 0}, - lcMap{'\u0490', '\u04BE', LowercaseBor, 0}, - lcMap{'\u04C1', '\u04C3', LowercaseBad, 0}, - lcMap{'\u04C7', '\u04C7', LowercaseSet, 0x04C8}, - lcMap{'\u04CB', '\u04CB', LowercaseSet, 0x04CC}, - lcMap{'\u04D0', '\u04EA', LowercaseBor, 0}, - lcMap{'\u04EE', '\u04F4', LowercaseBor, 0}, - lcMap{'\u04F8', '\u04F8', LowercaseSet, 0x04F9}, - lcMap{'\u0531', '\u0556', LowercaseAdd, 48}, - lcMap{'\u10A0', '\u10C5', LowercaseAdd, 48}, - lcMap{'\u1E00', '\u1EF8', LowercaseBor, 0}, - lcMap{'\u1F08', '\u1F0F', LowercaseAdd, -8}, - lcMap{'\u1F18', '\u1F1F', LowercaseAdd, -8}, - lcMap{'\u1F28', '\u1F2F', LowercaseAdd, -8}, - lcMap{'\u1F38', '\u1F3F', LowercaseAdd, -8}, - lcMap{'\u1F48', '\u1F4D', LowercaseAdd, -8}, - lcMap{'\u1F59', '\u1F59', LowercaseSet, 0x1F51}, - lcMap{'\u1F5B', '\u1F5B', LowercaseSet, 0x1F53}, - lcMap{'\u1F5D', '\u1F5D', LowercaseSet, 0x1F55}, - lcMap{'\u1F5F', '\u1F5F', LowercaseSet, 0x1F57}, - lcMap{'\u1F68', '\u1F6F', LowercaseAdd, -8}, - lcMap{'\u1F88', '\u1F8F', LowercaseAdd, -8}, - lcMap{'\u1F98', '\u1F9F', LowercaseAdd, -8}, - lcMap{'\u1FA8', '\u1FAF', LowercaseAdd, -8}, - lcMap{'\u1FB8', '\u1FB9', LowercaseAdd, -8}, - lcMap{'\u1FBA', '\u1FBB', LowercaseAdd, -74}, - lcMap{'\u1FBC', '\u1FBC', LowercaseSet, 0x1FB3}, - lcMap{'\u1FC8', '\u1FCB', LowercaseAdd, -86}, - lcMap{'\u1FCC', '\u1FCC', LowercaseSet, 0x1FC3}, - lcMap{'\u1FD8', '\u1FD9', LowercaseAdd, -8}, - lcMap{'\u1FDA', '\u1FDB', LowercaseAdd, -100}, - lcMap{'\u1FE8', '\u1FE9', LowercaseAdd, -8}, - lcMap{'\u1FEA', '\u1FEB', LowercaseAdd, -112}, - lcMap{'\u1FEC', '\u1FEC', LowercaseSet, 0x1FE5}, - lcMap{'\u1FF8', '\u1FF9', LowercaseAdd, -128}, - lcMap{'\u1FFA', '\u1FFB', LowercaseAdd, -126}, - lcMap{'\u1FFC', '\u1FFC', LowercaseSet, 0x1FF3}, - lcMap{'\u2160', '\u216F', LowercaseAdd, 16}, - lcMap{'\u24B6', '\u24D0', LowercaseAdd, 26}, - lcMap{'\uFF21', '\uFF3A', LowercaseAdd, 32}, -} - -func (c *CharSet) addLowercaseRange(chMin, chMax rune) { - var i, iMax, iMid int - var chMinT, chMaxT rune - var lc lcMap - - for i, iMax = 0, len(lcTable); i < iMax; { - iMid = (i + iMax) / 2 - if lcTable[iMid].chMax < chMin { - i = iMid + 1 - } else { - iMax = iMid - } - } - - for ; i < len(lcTable); i++ { - lc = lcTable[i] - if lc.chMin > chMax { - return - } - chMinT = lc.chMin - if chMinT < chMin { - chMinT = chMin - } - - chMaxT = lc.chMax - if chMaxT > chMax { - chMaxT = chMax - } - - switch lc.op { - case LowercaseSet: - chMinT = rune(lc.data) - chMaxT = rune(lc.data) - break - case LowercaseAdd: - chMinT += lc.data - chMaxT += lc.data - break - case LowercaseBor: - chMinT |= 1 - chMaxT |= 1 - break - case LowercaseBad: - chMinT += (chMinT & 1) - chMaxT += (chMaxT & 1) - break - } - - if chMinT < chMin || chMaxT > chMax { - c.addRange(chMinT, chMaxT) - } - } -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/code.go b/vendor/github.com/dlclark/regexp2/syntax/code.go deleted file mode 100644 index 686e822a..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/code.go +++ /dev/null @@ -1,274 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" -) - -// similar to prog.go in the go regex package...also with comment 'may not belong in this package' - -// File provides operator constants for use by the Builder and the Machine. - -// Implementation notes: -// -// Regexps are built into RegexCodes, which contain an operation array, -// a string table, and some constants. -// -// Each operation is one of the codes below, followed by the integer -// operands specified for each op. -// -// Strings and sets are indices into a string table. - -type InstOp int - -const ( - // lef/back operands description - - Onerep InstOp = 0 // lef,back char,min,max a {n} - Notonerep = 1 // lef,back char,min,max .{n} - Setrep = 2 // lef,back set,min,max [\d]{n} - - Oneloop = 3 // lef,back char,min,max a {,n} - Notoneloop = 4 // lef,back char,min,max .{,n} - Setloop = 5 // lef,back set,min,max [\d]{,n} - - Onelazy = 6 // lef,back char,min,max a {,n}? - Notonelazy = 7 // lef,back char,min,max .{,n}? - Setlazy = 8 // lef,back set,min,max [\d]{,n}? - - One = 9 // lef char a - Notone = 10 // lef char [^a] - Set = 11 // lef set [a-z\s] \w \s \d - - Multi = 12 // lef string abcd - Ref = 13 // lef group \# - - Bol = 14 // ^ - Eol = 15 // $ - Boundary = 16 // \b - Nonboundary = 17 // \B - Beginning = 18 // \A - Start = 19 // \G - EndZ = 20 // \Z - End = 21 // \Z - - Nothing = 22 // Reject! - - // Primitive control structures - - Lazybranch = 23 // back jump straight first - Branchmark = 24 // back jump branch first for loop - Lazybranchmark = 25 // back jump straight first for loop - Nullcount = 26 // back val set counter, null mark - Setcount = 27 // back val set counter, make mark - Branchcount = 28 // back jump,limit branch++ if zero<=c impl group slots - Capsize int // number of impl group slots - FcPrefix *Prefix // the set of candidate first characters (may be null) - BmPrefix *BmPrefix // the fixed prefix string as a Boyer-Moore machine (may be null) - Anchors AnchorLoc // the set of zero-length start anchors (RegexFCD.Bol, etc) - RightToLeft bool // true if right to left -} - -func opcodeBacktracks(op InstOp) bool { - op &= Mask - - switch op { - case Oneloop, Notoneloop, Setloop, Onelazy, Notonelazy, Setlazy, Lazybranch, Branchmark, Lazybranchmark, - Nullcount, Setcount, Branchcount, Lazybranchcount, Setmark, Capturemark, Getmark, Setjump, Backjump, - Forejump, Goto: - return true - - default: - return false - } -} - -func opcodeSize(op InstOp) int { - op &= Mask - - switch op { - case Nothing, Bol, Eol, Boundary, Nonboundary, ECMABoundary, NonECMABoundary, Beginning, Start, EndZ, - End, Nullmark, Setmark, Getmark, Setjump, Backjump, Forejump, Stop: - return 1 - - case One, Notone, Multi, Ref, Testref, Goto, Nullcount, Setcount, Lazybranch, Branchmark, Lazybranchmark, - Prune, Set: - return 2 - - case Capturemark, Branchcount, Lazybranchcount, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, - Setlazy, Setrep, Setloop: - return 3 - - default: - panic(fmt.Errorf("Unexpected op code: %v", op)) - } -} - -var codeStr = []string{ - "Onerep", "Notonerep", "Setrep", - "Oneloop", "Notoneloop", "Setloop", - "Onelazy", "Notonelazy", "Setlazy", - "One", "Notone", "Set", - "Multi", "Ref", - "Bol", "Eol", "Boundary", "Nonboundary", "Beginning", "Start", "EndZ", "End", - "Nothing", - "Lazybranch", "Branchmark", "Lazybranchmark", - "Nullcount", "Setcount", "Branchcount", "Lazybranchcount", - "Nullmark", "Setmark", "Capturemark", "Getmark", - "Setjump", "Backjump", "Forejump", "Testref", "Goto", - "Prune", "Stop", - "ECMABoundary", "NonECMABoundary", -} - -func operatorDescription(op InstOp) string { - desc := codeStr[op&Mask] - if (op & Ci) != 0 { - desc += "-Ci" - } - if (op & Rtl) != 0 { - desc += "-Rtl" - } - if (op & Back) != 0 { - desc += "-Back" - } - if (op & Back2) != 0 { - desc += "-Back2" - } - - return desc -} - -// OpcodeDescription is a humman readable string of the specific offset -func (c *Code) OpcodeDescription(offset int) string { - buf := &bytes.Buffer{} - - op := InstOp(c.Codes[offset]) - fmt.Fprintf(buf, "%06d ", offset) - - if opcodeBacktracks(op & Mask) { - buf.WriteString("*") - } else { - buf.WriteString(" ") - } - buf.WriteString(operatorDescription(op)) - buf.WriteString("(") - op &= Mask - - switch op { - case One, Notone, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy: - buf.WriteString("Ch = ") - buf.WriteString(CharDescription(rune(c.Codes[offset+1]))) - - case Set, Setrep, Setloop, Setlazy: - buf.WriteString("Set = ") - buf.WriteString(c.Sets[c.Codes[offset+1]].String()) - - case Multi: - fmt.Fprintf(buf, "String = %s", string(c.Strings[c.Codes[offset+1]])) - - case Ref, Testref: - fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) - - case Capturemark: - fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) - if c.Codes[offset+2] != -1 { - fmt.Fprintf(buf, ", Unindex = %d", c.Codes[offset+2]) - } - - case Nullcount, Setcount: - fmt.Fprintf(buf, "Value = %d", c.Codes[offset+1]) - - case Goto, Lazybranch, Branchmark, Lazybranchmark, Branchcount, Lazybranchcount: - fmt.Fprintf(buf, "Addr = %d", c.Codes[offset+1]) - } - - switch op { - case Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, Setrep, Setloop, Setlazy: - buf.WriteString(", Rep = ") - if c.Codes[offset+2] == math.MaxInt32 { - buf.WriteString("inf") - } else { - fmt.Fprintf(buf, "%d", c.Codes[offset+2]) - } - - case Branchcount, Lazybranchcount: - buf.WriteString(", Limit = ") - if c.Codes[offset+2] == math.MaxInt32 { - buf.WriteString("inf") - } else { - fmt.Fprintf(buf, "%d", c.Codes[offset+2]) - } - - } - - buf.WriteString(")") - - return buf.String() -} - -func (c *Code) Dump() string { - buf := &bytes.Buffer{} - - if c.RightToLeft { - fmt.Fprintln(buf, "Direction: right-to-left") - } else { - fmt.Fprintln(buf, "Direction: left-to-right") - } - if c.FcPrefix == nil { - fmt.Fprintln(buf, "Firstchars: n/a") - } else { - fmt.Fprintf(buf, "Firstchars: %v\n", c.FcPrefix.PrefixSet.String()) - } - - if c.BmPrefix == nil { - fmt.Fprintln(buf, "Prefix: n/a") - } else { - fmt.Fprintf(buf, "Prefix: %v\n", Escape(c.BmPrefix.String())) - } - - fmt.Fprintf(buf, "Anchors: %v\n", c.Anchors) - fmt.Fprintln(buf) - - if c.BmPrefix != nil { - fmt.Fprintln(buf, "BoyerMoore:") - fmt.Fprintln(buf, c.BmPrefix.Dump(" ")) - } - for i := 0; i < len(c.Codes); i += opcodeSize(InstOp(c.Codes[i])) { - fmt.Fprintln(buf, c.OpcodeDescription(i)) - } - - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/escape.go b/vendor/github.com/dlclark/regexp2/syntax/escape.go deleted file mode 100644 index 609df107..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/escape.go +++ /dev/null @@ -1,94 +0,0 @@ -package syntax - -import ( - "bytes" - "strconv" - "strings" - "unicode" -) - -func Escape(input string) string { - b := &bytes.Buffer{} - for _, r := range input { - escape(b, r, false) - } - return b.String() -} - -const meta = `\.+*?()|[]{}^$# ` - -func escape(b *bytes.Buffer, r rune, force bool) { - if unicode.IsPrint(r) { - if strings.IndexRune(meta, r) >= 0 || force { - b.WriteRune('\\') - } - b.WriteRune(r) - return - } - - switch r { - case '\a': - b.WriteString(`\a`) - case '\f': - b.WriteString(`\f`) - case '\n': - b.WriteString(`\n`) - case '\r': - b.WriteString(`\r`) - case '\t': - b.WriteString(`\t`) - case '\v': - b.WriteString(`\v`) - default: - if r < 0x100 { - b.WriteString(`\x`) - s := strconv.FormatInt(int64(r), 16) - if len(s) == 1 { - b.WriteRune('0') - } - b.WriteString(s) - break - } - b.WriteString(`\u`) - b.WriteString(strconv.FormatInt(int64(r), 16)) - } -} - -func Unescape(input string) (string, error) { - idx := strings.IndexRune(input, '\\') - // no slashes means no unescape needed - if idx == -1 { - return input, nil - } - - buf := bytes.NewBufferString(input[:idx]) - // get the runes for the rest of the string -- we're going full parser scan on this - - p := parser{} - p.setPattern(input[idx+1:]) - for { - if p.rightMost() { - return "", p.getErr(ErrIllegalEndEscape) - } - r, err := p.scanCharEscape() - if err != nil { - return "", err - } - buf.WriteRune(r) - // are we done? - if p.rightMost() { - return buf.String(), nil - } - - r = p.moveRightGetChar() - for r != '\\' { - buf.WriteRune(r) - if p.rightMost() { - // we're done, no more slashes - return buf.String(), nil - } - // keep scanning until we get another slash - r = p.moveRightGetChar() - } - } -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/fuzz.go b/vendor/github.com/dlclark/regexp2/syntax/fuzz.go deleted file mode 100644 index ee863866..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/fuzz.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build gofuzz - -package syntax - -// Fuzz is the input point for go-fuzz -func Fuzz(data []byte) int { - sdata := string(data) - tree, err := Parse(sdata, RegexOptions(0)) - if err != nil { - return 0 - } - - // translate it to code - _, err = Write(tree) - if err != nil { - panic(err) - } - - return 1 -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/parser.go b/vendor/github.com/dlclark/regexp2/syntax/parser.go deleted file mode 100644 index 6e8ea834..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/parser.go +++ /dev/null @@ -1,2125 +0,0 @@ -package syntax - -import ( - "fmt" - "math" - "os" - "sort" - "strconv" - "unicode" -) - -type RegexOptions int32 - -const ( - IgnoreCase RegexOptions = 0x0001 // "i" - Multiline = 0x0002 // "m" - ExplicitCapture = 0x0004 // "n" - Compiled = 0x0008 // "c" - Singleline = 0x0010 // "s" - IgnorePatternWhitespace = 0x0020 // "x" - RightToLeft = 0x0040 // "r" - Debug = 0x0080 // "d" - ECMAScript = 0x0100 // "e" -) - -func optionFromCode(ch rune) RegexOptions { - // case-insensitive - switch ch { - case 'i', 'I': - return IgnoreCase - case 'r', 'R': - return RightToLeft - case 'm', 'M': - return Multiline - case 'n', 'N': - return ExplicitCapture - case 's', 'S': - return Singleline - case 'x', 'X': - return IgnorePatternWhitespace - case 'd', 'D': - return Debug - case 'e', 'E': - return ECMAScript - default: - return 0 - } -} - -// An Error describes a failure to parse a regular expression -// and gives the offending expression. -type Error struct { - Code ErrorCode - Expr string - Args []interface{} -} - -func (e *Error) Error() string { - if len(e.Args) == 0 { - return "error parsing regexp: " + e.Code.String() + " in `" + e.Expr + "`" - } - return "error parsing regexp: " + fmt.Sprintf(e.Code.String(), e.Args...) + " in `" + e.Expr + "`" -} - -// An ErrorCode describes a failure to parse a regular expression. -type ErrorCode string - -const ( - // internal issue - ErrInternalError ErrorCode = "regexp/syntax: internal error" - // Parser errors - ErrUnterminatedComment = "unterminated comment" - ErrInvalidCharRange = "invalid character class range" - ErrInvalidRepeatSize = "invalid repeat count" - ErrInvalidUTF8 = "invalid UTF-8" - ErrCaptureGroupOutOfRange = "capture group number out of range" - ErrUnexpectedParen = "unexpected )" - ErrMissingParen = "missing closing )" - ErrMissingBrace = "missing closing }" - ErrInvalidRepeatOp = "invalid nested repetition operator" - ErrMissingRepeatArgument = "missing argument to repetition operator" - ErrConditionalExpression = "illegal conditional (?(...)) expression" - ErrTooManyAlternates = "too many | in (?()|)" - ErrUnrecognizedGrouping = "unrecognized grouping construct: (%v" - ErrInvalidGroupName = "invalid group name: group names must begin with a word character and have a matching terminator" - ErrCapNumNotZero = "capture number cannot be zero" - ErrUndefinedBackRef = "reference to undefined group number %v" - ErrUndefinedNameRef = "reference to undefined group name %v" - ErrAlternationCantCapture = "alternation conditions do not capture and cannot be named" - ErrAlternationCantHaveComment = "alternation conditions cannot be comments" - ErrMalformedReference = "(?(%v) ) malformed" - ErrUndefinedReference = "(?(%v) ) reference to undefined group" - ErrIllegalEndEscape = "illegal \\ at end of pattern" - ErrMalformedSlashP = "malformed \\p{X} character escape" - ErrIncompleteSlashP = "incomplete \\p{X} character escape" - ErrUnknownSlashP = "unknown unicode category, script, or property '%v'" - ErrUnrecognizedEscape = "unrecognized escape sequence \\%v" - ErrMissingControl = "missing control character" - ErrUnrecognizedControl = "unrecognized control character" - ErrTooFewHex = "insufficient hexadecimal digits" - ErrInvalidHex = "hex values may not be larger than 0x10FFFF" - ErrMalformedNameRef = "malformed \\k<...> named back reference" - ErrBadClassInCharRange = "cannot include class \\%v in character range" - ErrUnterminatedBracket = "unterminated [] set" - ErrSubtractionMustBeLast = "a subtraction must be the last element in a character class" - ErrReversedCharRange = "[x-y] range in reverse order" -) - -func (e ErrorCode) String() string { - return string(e) -} - -type parser struct { - stack *regexNode - group *regexNode - alternation *regexNode - concatenation *regexNode - unit *regexNode - - patternRaw string - pattern []rune - - currentPos int - specialCase *unicode.SpecialCase - - autocap int - capcount int - captop int - capsize int - - caps map[int]int - capnames map[string]int - - capnumlist []int - capnamelist []string - - options RegexOptions - optionsStack []RegexOptions - ignoreNextParen bool -} - -const ( - maxValueDiv10 int = math.MaxInt32 / 10 - maxValueMod10 = math.MaxInt32 % 10 -) - -// Parse converts a regex string into a parse tree -func Parse(re string, op RegexOptions) (*RegexTree, error) { - p := parser{ - options: op, - caps: make(map[int]int), - } - p.setPattern(re) - - if err := p.countCaptures(); err != nil { - return nil, err - } - - p.reset(op) - root, err := p.scanRegex() - - if err != nil { - return nil, err - } - tree := &RegexTree{ - root: root, - caps: p.caps, - capnumlist: p.capnumlist, - captop: p.captop, - Capnames: p.capnames, - Caplist: p.capnamelist, - options: op, - } - - if tree.options&Debug > 0 { - os.Stdout.WriteString(tree.Dump()) - } - - return tree, nil -} - -func (p *parser) setPattern(pattern string) { - p.patternRaw = pattern - p.pattern = make([]rune, 0, len(pattern)) - - //populate our rune array to handle utf8 encoding - for _, r := range pattern { - p.pattern = append(p.pattern, r) - } -} -func (p *parser) getErr(code ErrorCode, args ...interface{}) error { - return &Error{Code: code, Expr: p.patternRaw, Args: args} -} - -func (p *parser) noteCaptureSlot(i, pos int) { - if _, ok := p.caps[i]; !ok { - // the rhs of the hashtable isn't used in the parser - p.caps[i] = pos - p.capcount++ - - if p.captop <= i { - if i == math.MaxInt32 { - p.captop = i - } else { - p.captop = i + 1 - } - } - } -} - -func (p *parser) noteCaptureName(name string, pos int) { - if p.capnames == nil { - p.capnames = make(map[string]int) - } - - if _, ok := p.capnames[name]; !ok { - p.capnames[name] = pos - p.capnamelist = append(p.capnamelist, name) - } -} - -func (p *parser) assignNameSlots() { - if p.capnames != nil { - for _, name := range p.capnamelist { - for p.isCaptureSlot(p.autocap) { - p.autocap++ - } - pos := p.capnames[name] - p.capnames[name] = p.autocap - p.noteCaptureSlot(p.autocap, pos) - - p.autocap++ - } - } - - // if the caps array has at least one gap, construct the list of used slots - if p.capcount < p.captop { - p.capnumlist = make([]int, p.capcount) - i := 0 - - for k := range p.caps { - p.capnumlist[i] = k - i++ - } - - sort.Ints(p.capnumlist) - } - - // merge capsnumlist into capnamelist - if p.capnames != nil || p.capnumlist != nil { - var oldcapnamelist []string - var next int - var k int - - if p.capnames == nil { - oldcapnamelist = nil - p.capnames = make(map[string]int) - p.capnamelist = []string{} - next = -1 - } else { - oldcapnamelist = p.capnamelist - p.capnamelist = []string{} - next = p.capnames[oldcapnamelist[0]] - } - - for i := 0; i < p.capcount; i++ { - j := i - if p.capnumlist != nil { - j = p.capnumlist[i] - } - - if next == j { - p.capnamelist = append(p.capnamelist, oldcapnamelist[k]) - k++ - - if k == len(oldcapnamelist) { - next = -1 - } else { - next = p.capnames[oldcapnamelist[k]] - } - - } else { - //feature: culture? - str := strconv.Itoa(j) - p.capnamelist = append(p.capnamelist, str) - p.capnames[str] = j - } - } - } -} - -func (p *parser) consumeAutocap() int { - r := p.autocap - p.autocap++ - return r -} - -// CountCaptures is a prescanner for deducing the slots used for -// captures by doing a partial tokenization of the pattern. -func (p *parser) countCaptures() error { - var ch rune - - p.noteCaptureSlot(0, 0) - - p.autocap = 1 - - for p.charsRight() > 0 { - pos := p.textpos() - ch = p.moveRightGetChar() - switch ch { - case '\\': - if p.charsRight() > 0 { - p.moveRight(1) - } - - case '#': - if p.useOptionX() { - p.moveLeft() - p.scanBlank() - } - - case '[': - p.scanCharSet(false, true) - - case ')': - if !p.emptyOptionsStack() { - p.popOptions() - } - - case '(': - if p.charsRight() >= 2 && p.rightChar(1) == '#' && p.rightChar(0) == '?' { - p.moveLeft() - p.scanBlank() - } else { - p.pushOptions() - if p.charsRight() > 0 && p.rightChar(0) == '?' { - // we have (?... - p.moveRight(1) - - if p.charsRight() > 1 && (p.rightChar(0) == '<' || p.rightChar(0) == '\'') { - // named group: (?<... or (?'... - - p.moveRight(1) - ch = p.rightChar(0) - - if ch != '0' && IsWordChar(ch) { - if ch >= '1' && ch <= '9' { - dec, err := p.scanDecimal() - if err != nil { - return err - } - p.noteCaptureSlot(dec, pos) - } else { - p.noteCaptureName(p.scanCapname(), pos) - } - } - } else { - // (?... - - // get the options if it's an option construct (?cimsx-cimsx...) - p.scanOptions() - - if p.charsRight() > 0 { - if p.rightChar(0) == ')' { - // (?cimsx-cimsx) - p.moveRight(1) - p.popKeepOptions() - } else if p.rightChar(0) == '(' { - // alternation construct: (?(foo)yes|no) - // ignore the next paren so we don't capture the condition - p.ignoreNextParen = true - - // break from here so we don't reset ignoreNextParen - continue - } - } - } - } else { - if !p.useOptionN() && !p.ignoreNextParen { - p.noteCaptureSlot(p.consumeAutocap(), pos) - } - } - } - - p.ignoreNextParen = false - - } - } - - p.assignNameSlots() - return nil -} - -func (p *parser) reset(topopts RegexOptions) { - p.currentPos = 0 - p.autocap = 1 - p.ignoreNextParen = false - - if len(p.optionsStack) > 0 { - p.optionsStack = p.optionsStack[:0] - } - - p.options = topopts - p.stack = nil -} - -func (p *parser) scanRegex() (*regexNode, error) { - ch := '@' // nonspecial ch, means at beginning - isQuant := false - - p.startGroup(newRegexNodeMN(ntCapture, p.options, 0, -1)) - - for p.charsRight() > 0 { - wasPrevQuantifier := isQuant - isQuant = false - - if err := p.scanBlank(); err != nil { - return nil, err - } - - startpos := p.textpos() - - // move past all of the normal characters. We'll stop when we hit some kind of control character, - // or if IgnorePatternWhiteSpace is on, we'll stop when we see some whitespace. - if p.useOptionX() { - for p.charsRight() > 0 { - ch = p.rightChar(0) - //UGLY: clean up, this is ugly - if !(!isStopperX(ch) || (ch == '{' && !p.isTrueQuantifier())) { - break - } - p.moveRight(1) - } - } else { - for p.charsRight() > 0 { - ch = p.rightChar(0) - if !(!isSpecial(ch) || ch == '{' && !p.isTrueQuantifier()) { - break - } - p.moveRight(1) - } - } - - endpos := p.textpos() - - p.scanBlank() - - if p.charsRight() == 0 { - ch = '!' // nonspecial, means at end - } else if ch = p.rightChar(0); isSpecial(ch) { - isQuant = isQuantifier(ch) - p.moveRight(1) - } else { - ch = ' ' // nonspecial, means at ordinary char - } - - if startpos < endpos { - cchUnquantified := endpos - startpos - if isQuant { - cchUnquantified-- - } - wasPrevQuantifier = false - - if cchUnquantified > 0 { - p.addToConcatenate(startpos, cchUnquantified, false) - } - - if isQuant { - p.addUnitOne(p.charAt(endpos - 1)) - } - } - - switch ch { - case '!': - goto BreakOuterScan - - case ' ': - goto ContinueOuterScan - - case '[': - cc, err := p.scanCharSet(p.useOptionI(), false) - if err != nil { - return nil, err - } - p.addUnitSet(cc) - - case '(': - p.pushOptions() - - if grouper, err := p.scanGroupOpen(); err != nil { - return nil, err - } else if grouper == nil { - p.popKeepOptions() - } else { - p.pushGroup() - p.startGroup(grouper) - } - - continue - - case '|': - p.addAlternate() - goto ContinueOuterScan - - case ')': - if p.emptyStack() { - return nil, p.getErr(ErrUnexpectedParen) - } - - if err := p.addGroup(); err != nil { - return nil, err - } - if err := p.popGroup(); err != nil { - return nil, err - } - p.popOptions() - - if p.unit == nil { - goto ContinueOuterScan - } - - case '\\': - n, err := p.scanBackslash() - if err != nil { - return nil, err - } - p.addUnitNode(n) - - case '^': - if p.useOptionM() { - p.addUnitType(ntBol) - } else { - p.addUnitType(ntBeginning) - } - - case '$': - if p.useOptionM() { - p.addUnitType(ntEol) - } else { - p.addUnitType(ntEndZ) - } - - case '.': - if p.useOptionE() { - p.addUnitSet(ECMAAnyClass()) - } else if p.useOptionS() { - p.addUnitSet(AnyClass()) - } else { - p.addUnitNotone('\n') - } - - case '{', '*', '+', '?': - if p.unit == nil { - if wasPrevQuantifier { - return nil, p.getErr(ErrInvalidRepeatOp) - } else { - return nil, p.getErr(ErrMissingRepeatArgument) - } - } - p.moveLeft() - - default: - return nil, p.getErr(ErrInternalError) - } - - if err := p.scanBlank(); err != nil { - return nil, err - } - - if p.charsRight() > 0 { - isQuant = p.isTrueQuantifier() - } - if p.charsRight() == 0 || !isQuant { - //maintain odd C# assignment order -- not sure if required, could clean up? - p.addConcatenate() - goto ContinueOuterScan - } - - ch = p.moveRightGetChar() - - // Handle quantifiers - for p.unit != nil { - var min, max int - var lazy bool - - switch ch { - case '*': - min = 0 - max = math.MaxInt32 - - case '?': - min = 0 - max = 1 - - case '+': - min = 1 - max = math.MaxInt32 - - case '{': - { - var err error - startpos = p.textpos() - if min, err = p.scanDecimal(); err != nil { - return nil, err - } - max = min - if startpos < p.textpos() { - if p.charsRight() > 0 && p.rightChar(0) == ',' { - p.moveRight(1) - if p.charsRight() == 0 || p.rightChar(0) == '}' { - max = math.MaxInt32 - } else { - if max, err = p.scanDecimal(); err != nil { - return nil, err - } - } - } - } - - if startpos == p.textpos() || p.charsRight() == 0 || p.moveRightGetChar() != '}' { - p.addConcatenate() - p.textto(startpos - 1) - goto ContinueOuterScan - } - } - - default: - return nil, p.getErr(ErrInternalError) - } - - if err := p.scanBlank(); err != nil { - return nil, err - } - - if p.charsRight() == 0 || p.rightChar(0) != '?' { - lazy = false - } else { - p.moveRight(1) - lazy = true - } - - if min > max { - return nil, p.getErr(ErrInvalidRepeatSize) - } - - p.addConcatenate3(lazy, min, max) - } - - ContinueOuterScan: - } - -BreakOuterScan: - ; - - if !p.emptyStack() { - return nil, p.getErr(ErrMissingParen) - } - - if err := p.addGroup(); err != nil { - return nil, err - } - - return p.unit, nil - -} - -/* - * Simple parsing for replacement patterns - */ -func (p *parser) scanReplacement() (*regexNode, error) { - var c, startpos int - - p.concatenation = newRegexNode(ntConcatenate, p.options) - - for { - c = p.charsRight() - if c == 0 { - break - } - - startpos = p.textpos() - - for c > 0 && p.rightChar(0) != '$' { - p.moveRight(1) - c-- - } - - p.addToConcatenate(startpos, p.textpos()-startpos, true) - - if c > 0 { - if p.moveRightGetChar() == '$' { - n, err := p.scanDollar() - if err != nil { - return nil, err - } - p.addUnitNode(n) - } - p.addConcatenate() - } - } - - return p.concatenation, nil -} - -/* - * Scans $ patterns recognized within replacement patterns - */ -func (p *parser) scanDollar() (*regexNode, error) { - if p.charsRight() == 0 { - return newRegexNodeCh(ntOne, p.options, '$'), nil - } - - ch := p.rightChar(0) - angled := false - backpos := p.textpos() - lastEndPos := backpos - - // Note angle - - if ch == '{' && p.charsRight() > 1 { - angled = true - p.moveRight(1) - ch = p.rightChar(0) - } - - // Try to parse backreference: \1 or \{1} or \{cap} - - if ch >= '0' && ch <= '9' { - if !angled && p.useOptionE() { - capnum := -1 - newcapnum := int(ch - '0') - p.moveRight(1) - if p.isCaptureSlot(newcapnum) { - capnum = newcapnum - lastEndPos = p.textpos() - } - - for p.charsRight() > 0 { - ch = p.rightChar(0) - if ch < '0' || ch > '9' { - break - } - digit := int(ch - '0') - if newcapnum > maxValueDiv10 || (newcapnum == maxValueDiv10 && digit > maxValueMod10) { - return nil, p.getErr(ErrCaptureGroupOutOfRange) - } - - newcapnum = newcapnum*10 + digit - - p.moveRight(1) - if p.isCaptureSlot(newcapnum) { - capnum = newcapnum - lastEndPos = p.textpos() - } - } - p.textto(lastEndPos) - if capnum >= 0 { - return newRegexNodeM(ntRef, p.options, capnum), nil - } - } else { - capnum, err := p.scanDecimal() - if err != nil { - return nil, err - } - if !angled || p.charsRight() > 0 && p.moveRightGetChar() == '}' { - if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil - } - } - } - } else if angled && IsWordChar(ch) { - capname := p.scanCapname() - - if p.charsRight() > 0 && p.moveRightGetChar() == '}' { - if p.isCaptureName(capname) { - return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil - } - } - } else if !angled { - capnum := 1 - - switch ch { - case '$': - p.moveRight(1) - return newRegexNodeCh(ntOne, p.options, '$'), nil - case '&': - capnum = 0 - case '`': - capnum = replaceLeftPortion - case '\'': - capnum = replaceRightPortion - case '+': - capnum = replaceLastGroup - case '_': - capnum = replaceWholeString - } - - if capnum != 1 { - p.moveRight(1) - return newRegexNodeM(ntRef, p.options, capnum), nil - } - } - - // unrecognized $: literalize - - p.textto(backpos) - return newRegexNodeCh(ntOne, p.options, '$'), nil -} - -// scanGroupOpen scans chars following a '(' (not counting the '('), and returns -// a RegexNode for the type of group scanned, or nil if the group -// simply changed options (?cimsx-cimsx) or was a comment (#...). -func (p *parser) scanGroupOpen() (*regexNode, error) { - var ch rune - var nt nodeType - var err error - close := '>' - start := p.textpos() - - // just return a RegexNode if we have: - // 1. "(" followed by nothing - // 2. "(x" where x != ? - // 3. "(?)" - if p.charsRight() == 0 || p.rightChar(0) != '?' || (p.rightChar(0) == '?' && (p.charsRight() > 1 && p.rightChar(1) == ')')) { - if p.useOptionN() || p.ignoreNextParen { - p.ignoreNextParen = false - return newRegexNode(ntGroup, p.options), nil - } - return newRegexNodeMN(ntCapture, p.options, p.consumeAutocap(), -1), nil - } - - p.moveRight(1) - - for { - if p.charsRight() == 0 { - break - } - - switch ch = p.moveRightGetChar(); ch { - case ':': - nt = ntGroup - - case '=': - p.options &= ^RightToLeft - nt = ntRequire - - case '!': - p.options &= ^RightToLeft - nt = ntPrevent - - case '>': - nt = ntGreedy - - case '\'': - close = '\'' - fallthrough - - case '<': - if p.charsRight() == 0 { - goto BreakRecognize - } - - switch ch = p.moveRightGetChar(); ch { - case '=': - if close == '\'' { - goto BreakRecognize - } - - p.options |= RightToLeft - nt = ntRequire - - case '!': - if close == '\'' { - goto BreakRecognize - } - - p.options |= RightToLeft - nt = ntPrevent - - default: - p.moveLeft() - capnum := -1 - uncapnum := -1 - proceed := false - - // grab part before - - - if ch >= '0' && ch <= '9' { - if capnum, err = p.scanDecimal(); err != nil { - return nil, err - } - - if !p.isCaptureSlot(capnum) { - capnum = -1 - } - - // check if we have bogus characters after the number - if p.charsRight() > 0 && !(p.rightChar(0) == close || p.rightChar(0) == '-') { - return nil, p.getErr(ErrInvalidGroupName) - } - if capnum == 0 { - return nil, p.getErr(ErrCapNumNotZero) - } - } else if IsWordChar(ch) { - capname := p.scanCapname() - - if p.isCaptureName(capname) { - capnum = p.captureSlotFromName(capname) - } - - // check if we have bogus character after the name - if p.charsRight() > 0 && !(p.rightChar(0) == close || p.rightChar(0) == '-') { - return nil, p.getErr(ErrInvalidGroupName) - } - } else if ch == '-' { - proceed = true - } else { - // bad group name - starts with something other than a word character and isn't a number - return nil, p.getErr(ErrInvalidGroupName) - } - - // grab part after - if any - - if (capnum != -1 || proceed == true) && p.charsRight() > 0 && p.rightChar(0) == '-' { - p.moveRight(1) - - //no more chars left, no closing char, etc - if p.charsRight() == 0 { - return nil, p.getErr(ErrInvalidGroupName) - } - - ch = p.rightChar(0) - if ch >= '0' && ch <= '9' { - if uncapnum, err = p.scanDecimal(); err != nil { - return nil, err - } - - if !p.isCaptureSlot(uncapnum) { - return nil, p.getErr(ErrUndefinedBackRef, uncapnum) - } - - // check if we have bogus characters after the number - if p.charsRight() > 0 && p.rightChar(0) != close { - return nil, p.getErr(ErrInvalidGroupName) - } - } else if IsWordChar(ch) { - uncapname := p.scanCapname() - - if !p.isCaptureName(uncapname) { - return nil, p.getErr(ErrUndefinedNameRef, uncapname) - } - uncapnum = p.captureSlotFromName(uncapname) - - // check if we have bogus character after the name - if p.charsRight() > 0 && p.rightChar(0) != close { - return nil, p.getErr(ErrInvalidGroupName) - } - } else { - // bad group name - starts with something other than a word character and isn't a number - return nil, p.getErr(ErrInvalidGroupName) - } - } - - // actually make the node - - if (capnum != -1 || uncapnum != -1) && p.charsRight() > 0 && p.moveRightGetChar() == close { - return newRegexNodeMN(ntCapture, p.options, capnum, uncapnum), nil - } - goto BreakRecognize - } - - case '(': - // alternation construct (?(...) | ) - - parenPos := p.textpos() - if p.charsRight() > 0 { - ch = p.rightChar(0) - - // check if the alternation condition is a backref - if ch >= '0' && ch <= '9' { - var capnum int - if capnum, err = p.scanDecimal(); err != nil { - return nil, err - } - if p.charsRight() > 0 && p.moveRightGetChar() == ')' { - if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntTestref, p.options, capnum), nil - } - return nil, p.getErr(ErrUndefinedReference, capnum) - } - - return nil, p.getErr(ErrMalformedReference, capnum) - - } else if IsWordChar(ch) { - capname := p.scanCapname() - - if p.isCaptureName(capname) && p.charsRight() > 0 && p.moveRightGetChar() == ')' { - return newRegexNodeM(ntTestref, p.options, p.captureSlotFromName(capname)), nil - } - } - } - // not a backref - nt = ntTestgroup - p.textto(parenPos - 1) // jump to the start of the parentheses - p.ignoreNextParen = true // but make sure we don't try to capture the insides - - charsRight := p.charsRight() - if charsRight >= 3 && p.rightChar(1) == '?' { - rightchar2 := p.rightChar(2) - // disallow comments in the condition - if rightchar2 == '#' { - return nil, p.getErr(ErrAlternationCantHaveComment) - } - - // disallow named capture group (?<..>..) in the condition - if rightchar2 == '\'' { - return nil, p.getErr(ErrAlternationCantCapture) - } - - if charsRight >= 4 && (rightchar2 == '<' && p.rightChar(3) != '!' && p.rightChar(3) != '=') { - return nil, p.getErr(ErrAlternationCantCapture) - } - } - - default: - p.moveLeft() - - nt = ntGroup - // disallow options in the children of a testgroup node - if p.group.t != ntTestgroup { - p.scanOptions() - } - if p.charsRight() == 0 { - goto BreakRecognize - } - - if ch = p.moveRightGetChar(); ch == ')' { - return nil, nil - } - - if ch != ':' { - goto BreakRecognize - } - - } - - return newRegexNode(nt, p.options), nil - } - -BreakRecognize: - - // break Recognize comes here - - return nil, p.getErr(ErrUnrecognizedGrouping, string(p.pattern[start:p.textpos()])) -} - -// scans backslash specials and basics -func (p *parser) scanBackslash() (*regexNode, error) { - - if p.charsRight() == 0 { - return nil, p.getErr(ErrIllegalEndEscape) - } - - switch ch := p.rightChar(0); ch { - case 'b', 'B', 'A', 'G', 'Z', 'z': - p.moveRight(1) - return newRegexNode(p.typeFromCode(ch), p.options), nil - - case 'w': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, ECMAWordClass()), nil - } - return newRegexNodeSet(ntSet, p.options, WordClass()), nil - - case 'W': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, NotECMAWordClass()), nil - } - return newRegexNodeSet(ntSet, p.options, NotWordClass()), nil - - case 's': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, ECMASpaceClass()), nil - } - return newRegexNodeSet(ntSet, p.options, SpaceClass()), nil - - case 'S': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, NotECMASpaceClass()), nil - } - return newRegexNodeSet(ntSet, p.options, NotSpaceClass()), nil - - case 'd': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, ECMADigitClass()), nil - } - return newRegexNodeSet(ntSet, p.options, DigitClass()), nil - - case 'D': - p.moveRight(1) - if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, NotECMADigitClass()), nil - } - return newRegexNodeSet(ntSet, p.options, NotDigitClass()), nil - - case 'p', 'P': - p.moveRight(1) - prop, err := p.parseProperty() - if err != nil { - return nil, err - } - cc := &CharSet{} - cc.addCategory(prop, (ch != 'p'), p.useOptionI(), p.patternRaw) - if p.useOptionI() { - cc.addLowercase() - } - - return newRegexNodeSet(ntSet, p.options, cc), nil - - default: - return p.scanBasicBackslash() - } -} - -// Scans \-style backreferences and character escapes -func (p *parser) scanBasicBackslash() (*regexNode, error) { - if p.charsRight() == 0 { - return nil, p.getErr(ErrIllegalEndEscape) - } - angled := false - close := '\x00' - - backpos := p.textpos() - ch := p.rightChar(0) - - // allow \k instead of \, which is now deprecated - - if ch == 'k' { - if p.charsRight() >= 2 { - p.moveRight(1) - ch = p.moveRightGetChar() - - if ch == '<' || ch == '\'' { - angled = true - if ch == '\'' { - close = '\'' - } else { - close = '>' - } - } - } - - if !angled || p.charsRight() <= 0 { - return nil, p.getErr(ErrMalformedNameRef) - } - - ch = p.rightChar(0) - - } else if (ch == '<' || ch == '\'') && p.charsRight() > 1 { // Note angle without \g - angled = true - if ch == '\'' { - close = '\'' - } else { - close = '>' - } - - p.moveRight(1) - ch = p.rightChar(0) - } - - // Try to parse backreference: \<1> or \ - - if angled && ch >= '0' && ch <= '9' { - capnum, err := p.scanDecimal() - if err != nil { - return nil, err - } - - if p.charsRight() > 0 && p.moveRightGetChar() == close { - if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil - } else { - return nil, p.getErr(ErrUndefinedBackRef, capnum) - } - } - } else if !angled && ch >= '1' && ch <= '9' { // Try to parse backreference or octal: \1 - capnum, err := p.scanDecimal() - if err != nil { - return nil, err - } - if p.useOptionE() || p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil - } - if capnum <= 9 { - return nil, p.getErr(ErrUndefinedBackRef, capnum) - } - - } else if angled && IsWordChar(ch) { - capname := p.scanCapname() - - if p.charsRight() > 0 && p.moveRightGetChar() == close { - if p.isCaptureName(capname) { - return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil - } - return nil, p.getErr(ErrUndefinedNameRef, capname) - } - } - - // Not backreference: must be char code - - p.textto(backpos) - ch, err := p.scanCharEscape() - if err != nil { - return nil, err - } - - if p.useOptionI() { - ch = unicode.ToLower(ch) - } - - return newRegexNodeCh(ntOne, p.options, ch), nil -} - -// Scans X for \p{X} or \P{X} -func (p *parser) parseProperty() (string, error) { - if p.charsRight() < 3 { - return "", p.getErr(ErrIncompleteSlashP) - } - ch := p.moveRightGetChar() - if ch != '{' { - return "", p.getErr(ErrMalformedSlashP) - } - - startpos := p.textpos() - for p.charsRight() > 0 { - ch = p.moveRightGetChar() - if !(IsWordChar(ch) || ch == '-') { - p.moveLeft() - break - } - } - capname := string(p.pattern[startpos:p.textpos()]) - - if p.charsRight() == 0 || p.moveRightGetChar() != '}' { - return "", p.getErr(ErrIncompleteSlashP) - } - - if !isValidUnicodeCat(capname) { - return "", p.getErr(ErrUnknownSlashP, capname) - } - - return capname, nil -} - -// Returns ReNode type for zero-length assertions with a \ code. -func (p *parser) typeFromCode(ch rune) nodeType { - switch ch { - case 'b': - if p.useOptionE() { - return ntECMABoundary - } - return ntBoundary - case 'B': - if p.useOptionE() { - return ntNonECMABoundary - } - return ntNonboundary - case 'A': - return ntBeginning - case 'G': - return ntStart - case 'Z': - return ntEndZ - case 'z': - return ntEnd - default: - return ntNothing - } -} - -// Scans whitespace or x-mode comments. -func (p *parser) scanBlank() error { - if p.useOptionX() { - for { - for p.charsRight() > 0 && isSpace(p.rightChar(0)) { - p.moveRight(1) - } - - if p.charsRight() == 0 { - break - } - - if p.rightChar(0) == '#' { - for p.charsRight() > 0 && p.rightChar(0) != '\n' { - p.moveRight(1) - } - } else if p.charsRight() >= 3 && p.rightChar(2) == '#' && - p.rightChar(1) == '?' && p.rightChar(0) == '(' { - for p.charsRight() > 0 && p.rightChar(0) != ')' { - p.moveRight(1) - } - if p.charsRight() == 0 { - return p.getErr(ErrUnterminatedComment) - } - p.moveRight(1) - } else { - break - } - } - } else { - for { - if p.charsRight() < 3 || p.rightChar(2) != '#' || - p.rightChar(1) != '?' || p.rightChar(0) != '(' { - return nil - } - - for p.charsRight() > 0 && p.rightChar(0) != ')' { - p.moveRight(1) - } - if p.charsRight() == 0 { - return p.getErr(ErrUnterminatedComment) - } - p.moveRight(1) - } - } - return nil -} - -func (p *parser) scanCapname() string { - startpos := p.textpos() - - for p.charsRight() > 0 { - if !IsWordChar(p.moveRightGetChar()) { - p.moveLeft() - break - } - } - - return string(p.pattern[startpos:p.textpos()]) -} - -//Scans contents of [] (not including []'s), and converts to a set. -func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { - ch := '\x00' - chPrev := '\x00' - inRange := false - firstChar := true - closed := false - - var cc *CharSet - if !scanOnly { - cc = &CharSet{} - } - - if p.charsRight() > 0 && p.rightChar(0) == '^' { - p.moveRight(1) - if !scanOnly { - cc.negate = true - } - } - - for ; p.charsRight() > 0; firstChar = false { - fTranslatedChar := false - ch = p.moveRightGetChar() - if ch == ']' { - if !firstChar { - closed = true - break - } else if p.useOptionE() { - if !scanOnly { - cc.addRanges(NoneClass().ranges) - } - closed = true - break - } - - } else if ch == '\\' && p.charsRight() > 0 { - switch ch = p.moveRightGetChar(); ch { - case 'D', 'd': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } - cc.addDigit(p.useOptionE(), ch == 'D', p.patternRaw) - } - continue - - case 'S', 's': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } - cc.addSpace(p.useOptionE(), ch == 'S') - } - continue - - case 'W', 'w': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } - - cc.addWord(p.useOptionE(), ch == 'W') - } - continue - - case 'p', 'P': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } - prop, err := p.parseProperty() - if err != nil { - return nil, err - } - cc.addCategory(prop, (ch != 'p'), caseInsensitive, p.patternRaw) - } else { - p.parseProperty() - } - - continue - - case '-': - if !scanOnly { - cc.addRange(ch, ch) - } - continue - - default: - p.moveLeft() - var err error - ch, err = p.scanCharEscape() // non-literal character - if err != nil { - return nil, err - } - fTranslatedChar = true - break // this break will only break out of the switch - } - } else if ch == '[' { - // This is code for Posix style properties - [:Ll:] or [:IsTibetan:]. - // It currently doesn't do anything other than skip the whole thing! - if p.charsRight() > 0 && p.rightChar(0) == ':' && !inRange { - savePos := p.textpos() - - p.moveRight(1) - p.scanCapname() // throwaway the name - if p.charsRight() < 2 || p.moveRightGetChar() != ':' || p.moveRightGetChar() != ']' { - p.textto(savePos) - } - // else lookup name (nyi) - } - } - - if inRange { - inRange = false - if !scanOnly { - if ch == '[' && !fTranslatedChar && !firstChar { - // We thought we were in a range, but we're actually starting a subtraction. - // In that case, we'll add chPrev to our char class, skip the opening [, and - // scan the new character class recursively. - cc.addChar(chPrev) - sub, err := p.scanCharSet(caseInsensitive, false) - if err != nil { - return nil, err - } - cc.addSubtraction(sub) - - if p.charsRight() > 0 && p.rightChar(0) != ']' { - return nil, p.getErr(ErrSubtractionMustBeLast) - } - } else { - // a regular range, like a-z - if chPrev > ch { - return nil, p.getErr(ErrReversedCharRange) - } - cc.addRange(chPrev, ch) - } - } - } else if p.charsRight() >= 2 && p.rightChar(0) == '-' && p.rightChar(1) != ']' { - // this could be the start of a range - chPrev = ch - inRange = true - p.moveRight(1) - } else if p.charsRight() >= 1 && ch == '-' && !fTranslatedChar && p.rightChar(0) == '[' && !firstChar { - // we aren't in a range, and now there is a subtraction. Usually this happens - // only when a subtraction follows a range, like [a-z-[b]] - if !scanOnly { - p.moveRight(1) - sub, err := p.scanCharSet(caseInsensitive, false) - if err != nil { - return nil, err - } - cc.addSubtraction(sub) - - if p.charsRight() > 0 && p.rightChar(0) != ']' { - return nil, p.getErr(ErrSubtractionMustBeLast) - } - } else { - p.moveRight(1) - p.scanCharSet(caseInsensitive, true) - } - } else { - if !scanOnly { - cc.addRange(ch, ch) - } - } - } - - if !closed { - return nil, p.getErr(ErrUnterminatedBracket) - } - - if !scanOnly && caseInsensitive { - cc.addLowercase() - } - - return cc, nil -} - -// Scans any number of decimal digits (pegs value at 2^31-1 if too large) -func (p *parser) scanDecimal() (int, error) { - i := 0 - var d int - - for p.charsRight() > 0 { - d = int(p.rightChar(0) - '0') - if d < 0 || d > 9 { - break - } - p.moveRight(1) - - if i > maxValueDiv10 || (i == maxValueDiv10 && d > maxValueMod10) { - return 0, p.getErr(ErrCaptureGroupOutOfRange) - } - - i *= 10 - i += d - } - - return int(i), nil -} - -// Returns true for options allowed only at the top level -func isOnlyTopOption(option RegexOptions) bool { - return option == RightToLeft || option == ECMAScript -} - -// Scans cimsx-cimsx option string, stops at the first unrecognized char. -func (p *parser) scanOptions() { - - for off := false; p.charsRight() > 0; p.moveRight(1) { - ch := p.rightChar(0) - - if ch == '-' { - off = true - } else if ch == '+' { - off = false - } else { - option := optionFromCode(ch) - if option == 0 || isOnlyTopOption(option) { - return - } - - if off { - p.options &= ^option - } else { - p.options |= option - } - } - } -} - -// Scans \ code for escape codes that map to single unicode chars. -func (p *parser) scanCharEscape() (rune, error) { - - ch := p.moveRightGetChar() - - if ch >= '0' && ch <= '7' { - p.moveLeft() - return p.scanOctal(), nil - } - - switch ch { - case 'x': - // support for \x{HEX} syntax from Perl and PCRE - if p.charsRight() > 0 && p.rightChar(0) == '{' { - p.moveRight(1) - return p.scanHexUntilBrace() - } - return p.scanHex(2) - case 'u': - return p.scanHex(4) - case 'a': - return '\u0007', nil - case 'b': - return '\b', nil - case 'e': - return '\u001B', nil - case 'f': - return '\f', nil - case 'n': - return '\n', nil - case 'r': - return '\r', nil - case 't': - return '\t', nil - case 'v': - return '\u000B', nil - case 'c': - return p.scanControl() - default: - if !p.useOptionE() && IsWordChar(ch) { - return 0, p.getErr(ErrUnrecognizedEscape, string(ch)) - } - return ch, nil - } -} - -// Grabs and converts an ascii control character -func (p *parser) scanControl() (rune, error) { - if p.charsRight() <= 0 { - return 0, p.getErr(ErrMissingControl) - } - - ch := p.moveRightGetChar() - - // \ca interpreted as \cA - - if ch >= 'a' && ch <= 'z' { - ch = (ch - ('a' - 'A')) - } - ch = (ch - '@') - if ch >= 0 && ch < ' ' { - return ch, nil - } - - return 0, p.getErr(ErrUnrecognizedControl) - -} - -// Scan hex digits until we hit a closing brace. -// Non-hex digits, hex value too large for UTF-8, or running out of chars are errors -func (p *parser) scanHexUntilBrace() (rune, error) { - // PCRE spec reads like unlimited hex digits are allowed, but unicode has a limit - // so we can enforce that - i := 0 - hasContent := false - - for p.charsRight() > 0 { - ch := p.moveRightGetChar() - if ch == '}' { - // hit our close brace, we're done here - // prevent \x{} - if !hasContent { - return 0, p.getErr(ErrTooFewHex) - } - return rune(i), nil - } - hasContent = true - // no brace needs to be hex digit - d := hexDigit(ch) - if d < 0 { - return 0, p.getErr(ErrMissingBrace) - } - - i *= 0x10 - i += d - - if i > unicode.MaxRune { - return 0, p.getErr(ErrInvalidHex) - } - } - - // we only make it here if we run out of digits without finding the brace - return 0, p.getErr(ErrMissingBrace) -} - -// Scans exactly c hex digits (c=2 for \xFF, c=4 for \uFFFF) -func (p *parser) scanHex(c int) (rune, error) { - - i := 0 - - if p.charsRight() >= c { - for c > 0 { - d := hexDigit(p.moveRightGetChar()) - if d < 0 { - break - } - i *= 0x10 - i += d - c-- - } - } - - if c > 0 { - return 0, p.getErr(ErrTooFewHex) - } - - return rune(i), nil -} - -// Returns n <= 0xF for a hex digit. -func hexDigit(ch rune) int { - - if d := uint(ch - '0'); d <= 9 { - return int(d) - } - - if d := uint(ch - 'a'); d <= 5 { - return int(d + 0xa) - } - - if d := uint(ch - 'A'); d <= 5 { - return int(d + 0xa) - } - - return -1 -} - -// Scans up to three octal digits (stops before exceeding 0377). -func (p *parser) scanOctal() rune { - // Consume octal chars only up to 3 digits and value 0377 - - c := 3 - - if c > p.charsRight() { - c = p.charsRight() - } - - //we know the first char is good because the caller had to check - i := 0 - d := int(p.rightChar(0) - '0') - for c > 0 && d <= 7 { - i *= 8 - i += d - if p.useOptionE() && i >= 0x20 { - break - } - c-- - - p.moveRight(1) - if !p.rightMost() { - d = int(p.rightChar(0) - '0') - } - } - - // Octal codes only go up to 255. Any larger and the behavior that Perl follows - // is simply to truncate the high bits. - i &= 0xFF - - return rune(i) -} - -// Returns the current parsing position. -func (p *parser) textpos() int { - return p.currentPos -} - -// Zaps to a specific parsing position. -func (p *parser) textto(pos int) { - p.currentPos = pos -} - -// Returns the char at the right of the current parsing position and advances to the right. -func (p *parser) moveRightGetChar() rune { - ch := p.pattern[p.currentPos] - p.currentPos++ - return ch -} - -// Moves the current position to the right. -func (p *parser) moveRight(i int) { - // default would be 1 - p.currentPos += i -} - -// Moves the current parsing position one to the left. -func (p *parser) moveLeft() { - p.currentPos-- -} - -// Returns the char left of the current parsing position. -func (p *parser) charAt(i int) rune { - return p.pattern[i] -} - -// Returns the char i chars right of the current parsing position. -func (p *parser) rightChar(i int) rune { - // default would be 0 - return p.pattern[p.currentPos+i] -} - -// Number of characters to the right of the current parsing position. -func (p *parser) charsRight() int { - return len(p.pattern) - p.currentPos -} - -func (p *parser) rightMost() bool { - return p.currentPos == len(p.pattern) -} - -// Looks up the slot number for a given name -func (p *parser) captureSlotFromName(capname string) int { - return p.capnames[capname] -} - -// True if the capture slot was noted -func (p *parser) isCaptureSlot(i int) bool { - if p.caps != nil { - _, ok := p.caps[i] - return ok - } - - return (i >= 0 && i < p.capsize) -} - -// Looks up the slot number for a given name -func (p *parser) isCaptureName(capname string) bool { - if p.capnames == nil { - return false - } - - _, ok := p.capnames[capname] - return ok -} - -// option shortcuts - -// True if N option disabling '(' autocapture is on. -func (p *parser) useOptionN() bool { - return (p.options & ExplicitCapture) != 0 -} - -// True if I option enabling case-insensitivity is on. -func (p *parser) useOptionI() bool { - return (p.options & IgnoreCase) != 0 -} - -// True if M option altering meaning of $ and ^ is on. -func (p *parser) useOptionM() bool { - return (p.options & Multiline) != 0 -} - -// True if S option altering meaning of . is on. -func (p *parser) useOptionS() bool { - return (p.options & Singleline) != 0 -} - -// True if X option enabling whitespace/comment mode is on. -func (p *parser) useOptionX() bool { - return (p.options & IgnorePatternWhitespace) != 0 -} - -// True if E option enabling ECMAScript behavior on. -func (p *parser) useOptionE() bool { - return (p.options & ECMAScript) != 0 -} - -// True if options stack is empty. -func (p *parser) emptyOptionsStack() bool { - return len(p.optionsStack) == 0 -} - -// Finish the current quantifiable (when a quantifier is not found or is not possible) -func (p *parser) addConcatenate() { - // The first (| inside a Testgroup group goes directly to the group - p.concatenation.addChild(p.unit) - p.unit = nil -} - -// Finish the current quantifiable (when a quantifier is found) -func (p *parser) addConcatenate3(lazy bool, min, max int) { - p.concatenation.addChild(p.unit.makeQuantifier(lazy, min, max)) - p.unit = nil -} - -// Sets the current unit to a single char node -func (p *parser) addUnitOne(ch rune) { - if p.useOptionI() { - ch = unicode.ToLower(ch) - } - - p.unit = newRegexNodeCh(ntOne, p.options, ch) -} - -// Sets the current unit to a single inverse-char node -func (p *parser) addUnitNotone(ch rune) { - if p.useOptionI() { - ch = unicode.ToLower(ch) - } - - p.unit = newRegexNodeCh(ntNotone, p.options, ch) -} - -// Sets the current unit to a single set node -func (p *parser) addUnitSet(set *CharSet) { - p.unit = newRegexNodeSet(ntSet, p.options, set) -} - -// Sets the current unit to a subtree -func (p *parser) addUnitNode(node *regexNode) { - p.unit = node -} - -// Sets the current unit to an assertion of the specified type -func (p *parser) addUnitType(t nodeType) { - p.unit = newRegexNode(t, p.options) -} - -// Finish the current group (in response to a ')' or end) -func (p *parser) addGroup() error { - if p.group.t == ntTestgroup || p.group.t == ntTestref { - p.group.addChild(p.concatenation.reverseLeft()) - if (p.group.t == ntTestref && len(p.group.children) > 2) || len(p.group.children) > 3 { - return p.getErr(ErrTooManyAlternates) - } - } else { - p.alternation.addChild(p.concatenation.reverseLeft()) - p.group.addChild(p.alternation) - } - - p.unit = p.group - return nil -} - -// Pops the option stack, but keeps the current options unchanged. -func (p *parser) popKeepOptions() { - lastIdx := len(p.optionsStack) - 1 - p.optionsStack = p.optionsStack[:lastIdx] -} - -// Recalls options from the stack. -func (p *parser) popOptions() { - lastIdx := len(p.optionsStack) - 1 - // get the last item on the stack and then remove it by reslicing - p.options = p.optionsStack[lastIdx] - p.optionsStack = p.optionsStack[:lastIdx] -} - -// Saves options on a stack. -func (p *parser) pushOptions() { - p.optionsStack = append(p.optionsStack, p.options) -} - -// Add a string to the last concatenate. -func (p *parser) addToConcatenate(pos, cch int, isReplacement bool) { - var node *regexNode - - if cch == 0 { - return - } - - if cch > 1 { - str := p.pattern[pos : pos+cch] - - if p.useOptionI() && !isReplacement { - // We do the ToLower character by character for consistency. With surrogate chars, doing - // a ToLower on the entire string could actually change the surrogate pair. This is more correct - // linguistically, but since Regex doesn't support surrogates, it's more important to be - // consistent. - for i := 0; i < len(str); i++ { - str[i] = unicode.ToLower(str[i]) - } - } - - node = newRegexNodeStr(ntMulti, p.options, str) - } else { - ch := p.charAt(pos) - - if p.useOptionI() && !isReplacement { - ch = unicode.ToLower(ch) - } - - node = newRegexNodeCh(ntOne, p.options, ch) - } - - p.concatenation.addChild(node) -} - -// Push the parser state (in response to an open paren) -func (p *parser) pushGroup() { - p.group.next = p.stack - p.alternation.next = p.group - p.concatenation.next = p.alternation - p.stack = p.concatenation -} - -// Remember the pushed state (in response to a ')') -func (p *parser) popGroup() error { - p.concatenation = p.stack - p.alternation = p.concatenation.next - p.group = p.alternation.next - p.stack = p.group.next - - // The first () inside a Testgroup group goes directly to the group - if p.group.t == ntTestgroup && len(p.group.children) == 0 { - if p.unit == nil { - return p.getErr(ErrConditionalExpression) - } - - p.group.addChild(p.unit) - p.unit = nil - } - return nil -} - -// True if the group stack is empty. -func (p *parser) emptyStack() bool { - return p.stack == nil -} - -// Start a new round for the parser state (in response to an open paren or string start) -func (p *parser) startGroup(openGroup *regexNode) { - p.group = openGroup - p.alternation = newRegexNode(ntAlternate, p.options) - p.concatenation = newRegexNode(ntConcatenate, p.options) -} - -// Finish the current concatenation (in response to a |) -func (p *parser) addAlternate() { - // The | parts inside a Testgroup group go directly to the group - - if p.group.t == ntTestgroup || p.group.t == ntTestref { - p.group.addChild(p.concatenation.reverseLeft()) - } else { - p.alternation.addChild(p.concatenation.reverseLeft()) - } - - p.concatenation = newRegexNode(ntConcatenate, p.options) -} - -// For categorizing ascii characters. - -const ( - Q byte = 5 // quantifier - S = 4 // ordinary stopper - Z = 3 // ScanBlank stopper - X = 2 // whitespace - E = 1 // should be escaped -) - -var _category = []byte{ - //01 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0, 0, 0, 0, 0, 0, 0, 0, 0, X, X, X, X, X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? - X, 0, 0, Z, S, 0, 0, 0, S, S, Q, Q, 0, 0, S, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Q, - //@A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, S, 0, - //'a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Q, S, 0, 0, 0, -} - -func isSpace(ch rune) bool { - return (ch <= ' ' && _category[ch] == X) -} - -// Returns true for those characters that terminate a string of ordinary chars. -func isSpecial(ch rune) bool { - return (ch <= '|' && _category[ch] >= S) -} - -// Returns true for those characters that terminate a string of ordinary chars. -func isStopperX(ch rune) bool { - return (ch <= '|' && _category[ch] >= X) -} - -// Returns true for those characters that begin a quantifier. -func isQuantifier(ch rune) bool { - return (ch <= '{' && _category[ch] >= Q) -} - -func (p *parser) isTrueQuantifier() bool { - nChars := p.charsRight() - if nChars == 0 { - return false - } - - startpos := p.textpos() - ch := p.charAt(startpos) - if ch != '{' { - return ch <= '{' && _category[ch] >= Q - } - - //UGLY: this is ugly -- the original code was ugly too - pos := startpos - for { - nChars-- - if nChars <= 0 { - break - } - pos++ - ch = p.charAt(pos) - if ch < '0' || ch > '9' { - break - } - } - - if nChars == 0 || pos-startpos == 1 { - return false - } - if ch == '}' { - return true - } - if ch != ',' { - return false - } - for { - nChars-- - if nChars <= 0 { - break - } - pos++ - ch = p.charAt(pos) - if ch < '0' || ch > '9' { - break - } - } - - return nChars > 0 && ch == '}' -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/prefix.go b/vendor/github.com/dlclark/regexp2/syntax/prefix.go deleted file mode 100644 index 011ef0b4..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/prefix.go +++ /dev/null @@ -1,896 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "strconv" - "unicode" - "unicode/utf8" -) - -type Prefix struct { - PrefixStr []rune - PrefixSet CharSet - CaseInsensitive bool -} - -// It takes a RegexTree and computes the set of chars that can start it. -func getFirstCharsPrefix(tree *RegexTree) *Prefix { - s := regexFcd{ - fcStack: make([]regexFc, 32), - intStack: make([]int, 32), - } - fc := s.regexFCFromRegexTree(tree) - - if fc == nil || fc.nullable || fc.cc.IsEmpty() { - return nil - } - fcSet := fc.getFirstChars() - return &Prefix{PrefixSet: fcSet, CaseInsensitive: fc.caseInsensitive} -} - -type regexFcd struct { - intStack []int - intDepth int - fcStack []regexFc - fcDepth int - skipAllChildren bool // don't process any more children at the current level - skipchild bool // don't process the current child. - failed bool -} - -/* - * The main FC computation. It does a shortcutted depth-first walk - * through the tree and calls CalculateFC to emits code before - * and after each child of an interior node, and at each leaf. - */ -func (s *regexFcd) regexFCFromRegexTree(tree *RegexTree) *regexFc { - curNode := tree.root - curChild := 0 - - for { - if len(curNode.children) == 0 { - // This is a leaf node - s.calculateFC(curNode.t, curNode, 0) - } else if curChild < len(curNode.children) && !s.skipAllChildren { - // This is an interior node, and we have more children to analyze - s.calculateFC(curNode.t|beforeChild, curNode, curChild) - - if !s.skipchild { - curNode = curNode.children[curChild] - // this stack is how we get a depth first walk of the tree. - s.pushInt(curChild) - curChild = 0 - } else { - curChild++ - s.skipchild = false - } - continue - } - - // This is an interior node where we've finished analyzing all the children, or - // the end of a leaf node. - s.skipAllChildren = false - - if s.intIsEmpty() { - break - } - - curChild = s.popInt() - curNode = curNode.next - - s.calculateFC(curNode.t|afterChild, curNode, curChild) - if s.failed { - return nil - } - - curChild++ - } - - if s.fcIsEmpty() { - return nil - } - - return s.popFC() -} - -// To avoid recursion, we use a simple integer stack. -// This is the push. -func (s *regexFcd) pushInt(I int) { - if s.intDepth >= len(s.intStack) { - expanded := make([]int, s.intDepth*2) - copy(expanded, s.intStack) - s.intStack = expanded - } - - s.intStack[s.intDepth] = I - s.intDepth++ -} - -// True if the stack is empty. -func (s *regexFcd) intIsEmpty() bool { - return s.intDepth == 0 -} - -// This is the pop. -func (s *regexFcd) popInt() int { - s.intDepth-- - return s.intStack[s.intDepth] -} - -// We also use a stack of RegexFC objects. -// This is the push. -func (s *regexFcd) pushFC(fc regexFc) { - if s.fcDepth >= len(s.fcStack) { - expanded := make([]regexFc, s.fcDepth*2) - copy(expanded, s.fcStack) - s.fcStack = expanded - } - - s.fcStack[s.fcDepth] = fc - s.fcDepth++ -} - -// True if the stack is empty. -func (s *regexFcd) fcIsEmpty() bool { - return s.fcDepth == 0 -} - -// This is the pop. -func (s *regexFcd) popFC() *regexFc { - s.fcDepth-- - return &s.fcStack[s.fcDepth] -} - -// This is the top. -func (s *regexFcd) topFC() *regexFc { - return &s.fcStack[s.fcDepth-1] -} - -// Called in Beforechild to prevent further processing of the current child -func (s *regexFcd) skipChild() { - s.skipchild = true -} - -// FC computation and shortcut cases for each node type -func (s *regexFcd) calculateFC(nt nodeType, node *regexNode, CurIndex int) { - //fmt.Printf("NodeType: %v, CurIndex: %v, Desc: %v\n", nt, CurIndex, node.description()) - ci := false - rtl := false - - if nt <= ntRef { - if (node.options & IgnoreCase) != 0 { - ci = true - } - if (node.options & RightToLeft) != 0 { - rtl = true - } - } - - switch nt { - case ntConcatenate | beforeChild, ntAlternate | beforeChild, ntTestref | beforeChild, ntLoop | beforeChild, ntLazyloop | beforeChild: - break - - case ntTestgroup | beforeChild: - if CurIndex == 0 { - s.skipChild() - } - break - - case ntEmpty: - s.pushFC(regexFc{nullable: true}) - break - - case ntConcatenate | afterChild: - if CurIndex != 0 { - child := s.popFC() - cumul := s.topFC() - - s.failed = !cumul.addFC(*child, true) - } - - fc := s.topFC() - if !fc.nullable { - s.skipAllChildren = true - } - break - - case ntTestgroup | afterChild: - if CurIndex > 1 { - child := s.popFC() - cumul := s.topFC() - - s.failed = !cumul.addFC(*child, false) - } - break - - case ntAlternate | afterChild, ntTestref | afterChild: - if CurIndex != 0 { - child := s.popFC() - cumul := s.topFC() - - s.failed = !cumul.addFC(*child, false) - } - break - - case ntLoop | afterChild, ntLazyloop | afterChild: - if node.m == 0 { - fc := s.topFC() - fc.nullable = true - } - break - - case ntGroup | beforeChild, ntGroup | afterChild, ntCapture | beforeChild, ntCapture | afterChild, ntGreedy | beforeChild, ntGreedy | afterChild: - break - - case ntRequire | beforeChild, ntPrevent | beforeChild: - s.skipChild() - s.pushFC(regexFc{nullable: true}) - break - - case ntRequire | afterChild, ntPrevent | afterChild: - break - - case ntOne, ntNotone: - s.pushFC(newRegexFc(node.ch, nt == ntNotone, false, ci)) - break - - case ntOneloop, ntOnelazy: - s.pushFC(newRegexFc(node.ch, false, node.m == 0, ci)) - break - - case ntNotoneloop, ntNotonelazy: - s.pushFC(newRegexFc(node.ch, true, node.m == 0, ci)) - break - - case ntMulti: - if len(node.str) == 0 { - s.pushFC(regexFc{nullable: true}) - } else if !rtl { - s.pushFC(newRegexFc(node.str[0], false, false, ci)) - } else { - s.pushFC(newRegexFc(node.str[len(node.str)-1], false, false, ci)) - } - break - - case ntSet: - s.pushFC(regexFc{cc: node.set.Copy(), nullable: false, caseInsensitive: ci}) - break - - case ntSetloop, ntSetlazy: - s.pushFC(regexFc{cc: node.set.Copy(), nullable: node.m == 0, caseInsensitive: ci}) - break - - case ntRef: - s.pushFC(regexFc{cc: *AnyClass(), nullable: true, caseInsensitive: false}) - break - - case ntNothing, ntBol, ntEol, ntBoundary, ntNonboundary, ntECMABoundary, ntNonECMABoundary, ntBeginning, ntStart, ntEndZ, ntEnd: - s.pushFC(regexFc{nullable: true}) - break - - default: - panic(fmt.Sprintf("unexpected op code: %v", nt)) - } -} - -type regexFc struct { - cc CharSet - nullable bool - caseInsensitive bool -} - -func newRegexFc(ch rune, not, nullable, caseInsensitive bool) regexFc { - r := regexFc{ - caseInsensitive: caseInsensitive, - nullable: nullable, - } - if not { - if ch > 0 { - r.cc.addRange('\x00', ch-1) - } - if ch < 0xFFFF { - r.cc.addRange(ch+1, utf8.MaxRune) - } - } else { - r.cc.addRange(ch, ch) - } - return r -} - -func (r *regexFc) getFirstChars() CharSet { - if r.caseInsensitive { - r.cc.addLowercase() - } - - return r.cc -} - -func (r *regexFc) addFC(fc regexFc, concatenate bool) bool { - if !r.cc.IsMergeable() || !fc.cc.IsMergeable() { - return false - } - - if concatenate { - if !r.nullable { - return true - } - - if !fc.nullable { - r.nullable = false - } - } else { - if fc.nullable { - r.nullable = true - } - } - - r.caseInsensitive = r.caseInsensitive || fc.caseInsensitive - r.cc.addSet(fc.cc) - - return true -} - -// This is a related computation: it takes a RegexTree and computes the -// leading substring if it sees one. It's quite trivial and gives up easily. -func getPrefix(tree *RegexTree) *Prefix { - var concatNode *regexNode - nextChild := 0 - - curNode := tree.root - - for { - switch curNode.t { - case ntConcatenate: - if len(curNode.children) > 0 { - concatNode = curNode - nextChild = 0 - } - - case ntGreedy, ntCapture: - curNode = curNode.children[0] - concatNode = nil - continue - - case ntOneloop, ntOnelazy: - if curNode.m > 0 { - return &Prefix{ - PrefixStr: repeat(curNode.ch, curNode.m), - CaseInsensitive: (curNode.options & IgnoreCase) != 0, - } - } - return nil - - case ntOne: - return &Prefix{ - PrefixStr: []rune{curNode.ch}, - CaseInsensitive: (curNode.options & IgnoreCase) != 0, - } - - case ntMulti: - return &Prefix{ - PrefixStr: curNode.str, - CaseInsensitive: (curNode.options & IgnoreCase) != 0, - } - - case ntBol, ntEol, ntBoundary, ntECMABoundary, ntBeginning, ntStart, - ntEndZ, ntEnd, ntEmpty, ntRequire, ntPrevent: - - default: - return nil - } - - if concatNode == nil || nextChild >= len(concatNode.children) { - return nil - } - - curNode = concatNode.children[nextChild] - nextChild++ - } -} - -// repeat the rune r, c times... up to the max of MaxPrefixSize -func repeat(r rune, c int) []rune { - if c > MaxPrefixSize { - c = MaxPrefixSize - } - - ret := make([]rune, c) - - // binary growth using copy for speed - ret[0] = r - bp := 1 - for bp < len(ret) { - copy(ret[bp:], ret[:bp]) - bp *= 2 - } - - return ret -} - -// BmPrefix precomputes the Boyer-Moore -// tables for fast string scanning. These tables allow -// you to scan for the first occurrence of a string within -// a large body of text without examining every character. -// The performance of the heuristic depends on the actual -// string and the text being searched, but usually, the longer -// the string that is being searched for, the fewer characters -// need to be examined. -type BmPrefix struct { - positive []int - negativeASCII []int - negativeUnicode [][]int - pattern []rune - lowASCII rune - highASCII rune - rightToLeft bool - caseInsensitive bool -} - -func newBmPrefix(pattern []rune, caseInsensitive, rightToLeft bool) *BmPrefix { - - b := &BmPrefix{ - rightToLeft: rightToLeft, - caseInsensitive: caseInsensitive, - pattern: pattern, - } - - if caseInsensitive { - for i := 0; i < len(b.pattern); i++ { - // We do the ToLower character by character for consistency. With surrogate chars, doing - // a ToLower on the entire string could actually change the surrogate pair. This is more correct - // linguistically, but since Regex doesn't support surrogates, it's more important to be - // consistent. - - b.pattern[i] = unicode.ToLower(b.pattern[i]) - } - } - - var beforefirst, last, bump int - var scan, match int - - if !rightToLeft { - beforefirst = -1 - last = len(b.pattern) - 1 - bump = 1 - } else { - beforefirst = len(b.pattern) - last = 0 - bump = -1 - } - - // PART I - the good-suffix shift table - // - // compute the positive requirement: - // if char "i" is the first one from the right that doesn't match, - // then we know the matcher can advance by _positive[i]. - // - // This algorithm is a simplified variant of the standard - // Boyer-Moore good suffix calculation. - - b.positive = make([]int, len(b.pattern)) - - examine := last - ch := b.pattern[examine] - b.positive[examine] = bump - examine -= bump - -Outerloop: - for { - // find an internal char (examine) that matches the tail - - for { - if examine == beforefirst { - break Outerloop - } - if b.pattern[examine] == ch { - break - } - examine -= bump - } - - match = last - scan = examine - - // find the length of the match - for { - if scan == beforefirst || b.pattern[match] != b.pattern[scan] { - // at the end of the match, note the difference in _positive - // this is not the length of the match, but the distance from the internal match - // to the tail suffix. - if b.positive[match] == 0 { - b.positive[match] = match - scan - } - - // System.Diagnostics.Debug.WriteLine("Set positive[" + match + "] to " + (match - scan)); - - break - } - - scan -= bump - match -= bump - } - - examine -= bump - } - - match = last - bump - - // scan for the chars for which there are no shifts that yield a different candidate - - // The inside of the if statement used to say - // "_positive[match] = last - beforefirst;" - // This is slightly less aggressive in how much we skip, but at worst it - // should mean a little more work rather than skipping a potential match. - for match != beforefirst { - if b.positive[match] == 0 { - b.positive[match] = bump - } - - match -= bump - } - - // PART II - the bad-character shift table - // - // compute the negative requirement: - // if char "ch" is the reject character when testing position "i", - // we can slide up by _negative[ch]; - // (_negative[ch] = str.Length - 1 - str.LastIndexOf(ch)) - // - // the lookup table is divided into ASCII and Unicode portions; - // only those parts of the Unicode 16-bit code set that actually - // appear in the string are in the table. (Maximum size with - // Unicode is 65K; ASCII only case is 512 bytes.) - - b.negativeASCII = make([]int, 128) - - for i := 0; i < len(b.negativeASCII); i++ { - b.negativeASCII[i] = last - beforefirst - } - - b.lowASCII = 127 - b.highASCII = 0 - - for examine = last; examine != beforefirst; examine -= bump { - ch = b.pattern[examine] - - switch { - case ch < 128: - if b.lowASCII > ch { - b.lowASCII = ch - } - - if b.highASCII < ch { - b.highASCII = ch - } - - if b.negativeASCII[ch] == last-beforefirst { - b.negativeASCII[ch] = last - examine - } - case ch <= 0xffff: - i, j := ch>>8, ch&0xFF - - if b.negativeUnicode == nil { - b.negativeUnicode = make([][]int, 256) - } - - if b.negativeUnicode[i] == nil { - newarray := make([]int, 256) - - for k := 0; k < len(newarray); k++ { - newarray[k] = last - beforefirst - } - - if i == 0 { - copy(newarray, b.negativeASCII) - //TODO: this line needed? - b.negativeASCII = newarray - } - - b.negativeUnicode[i] = newarray - } - - if b.negativeUnicode[i][j] == last-beforefirst { - b.negativeUnicode[i][j] = last - examine - } - default: - // we can't do the filter because this algo doesn't support - // unicode chars >0xffff - return nil - } - } - - return b -} - -func (b *BmPrefix) String() string { - return string(b.pattern) -} - -// Dump returns the contents of the filter as a human readable string -func (b *BmPrefix) Dump(indent string) string { - buf := &bytes.Buffer{} - - fmt.Fprintf(buf, "%sBM Pattern: %s\n%sPositive: ", indent, string(b.pattern), indent) - for i := 0; i < len(b.positive); i++ { - buf.WriteString(strconv.Itoa(b.positive[i])) - buf.WriteRune(' ') - } - buf.WriteRune('\n') - - if b.negativeASCII != nil { - buf.WriteString(indent) - buf.WriteString("Negative table\n") - for i := 0; i < len(b.negativeASCII); i++ { - if b.negativeASCII[i] != len(b.pattern) { - fmt.Fprintf(buf, "%s %s %s\n", indent, Escape(string(rune(i))), strconv.Itoa(b.negativeASCII[i])) - } - } - } - - return buf.String() -} - -// Scan uses the Boyer-Moore algorithm to find the first occurrence -// of the specified string within text, beginning at index, and -// constrained within beglimit and endlimit. -// -// The direction and case-sensitivity of the match is determined -// by the arguments to the RegexBoyerMoore constructor. -func (b *BmPrefix) Scan(text []rune, index, beglimit, endlimit int) int { - var ( - defadv, test, test2 int - match, startmatch, endmatch int - bump, advance int - chTest rune - unicodeLookup []int - ) - - if !b.rightToLeft { - defadv = len(b.pattern) - startmatch = len(b.pattern) - 1 - endmatch = 0 - test = index + defadv - 1 - bump = 1 - } else { - defadv = -len(b.pattern) - startmatch = 0 - endmatch = -defadv - 1 - test = index + defadv - bump = -1 - } - - chMatch := b.pattern[startmatch] - - for { - if test >= endlimit || test < beglimit { - return -1 - } - - chTest = text[test] - - if b.caseInsensitive { - chTest = unicode.ToLower(chTest) - } - - if chTest != chMatch { - if chTest < 128 { - advance = b.negativeASCII[chTest] - } else if chTest < 0xffff && len(b.negativeUnicode) > 0 { - unicodeLookup = b.negativeUnicode[chTest>>8] - if len(unicodeLookup) > 0 { - advance = unicodeLookup[chTest&0xFF] - } else { - advance = defadv - } - } else { - advance = defadv - } - - test += advance - } else { // if (chTest == chMatch) - test2 = test - match = startmatch - - for { - if match == endmatch { - if b.rightToLeft { - return test2 + 1 - } else { - return test2 - } - } - - match -= bump - test2 -= bump - - chTest = text[test2] - - if b.caseInsensitive { - chTest = unicode.ToLower(chTest) - } - - if chTest != b.pattern[match] { - advance = b.positive[match] - if (chTest & 0xFF80) == 0 { - test2 = (match - startmatch) + b.negativeASCII[chTest] - } else if chTest < 0xffff && len(b.negativeUnicode) > 0 { - unicodeLookup = b.negativeUnicode[chTest>>8] - if len(unicodeLookup) > 0 { - test2 = (match - startmatch) + unicodeLookup[chTest&0xFF] - } else { - test += advance - break - } - } else { - test += advance - break - } - - if b.rightToLeft { - if test2 < advance { - advance = test2 - } - } else if test2 > advance { - advance = test2 - } - - test += advance - break - } - } - } - } -} - -// When a regex is anchored, we can do a quick IsMatch test instead of a Scan -func (b *BmPrefix) IsMatch(text []rune, index, beglimit, endlimit int) bool { - if !b.rightToLeft { - if index < beglimit || endlimit-index < len(b.pattern) { - return false - } - - return b.matchPattern(text, index) - } else { - if index > endlimit || index-beglimit < len(b.pattern) { - return false - } - - return b.matchPattern(text, index-len(b.pattern)) - } -} - -func (b *BmPrefix) matchPattern(text []rune, index int) bool { - if len(text)-index < len(b.pattern) { - return false - } - - if b.caseInsensitive { - for i := 0; i < len(b.pattern); i++ { - //Debug.Assert(textinfo.ToLower(_pattern[i]) == _pattern[i], "pattern should be converted to lower case in constructor!"); - if unicode.ToLower(text[index+i]) != b.pattern[i] { - return false - } - } - return true - } else { - for i := 0; i < len(b.pattern); i++ { - if text[index+i] != b.pattern[i] { - return false - } - } - return true - } -} - -type AnchorLoc int16 - -// where the regex can be pegged -const ( - AnchorBeginning AnchorLoc = 0x0001 - AnchorBol = 0x0002 - AnchorStart = 0x0004 - AnchorEol = 0x0008 - AnchorEndZ = 0x0010 - AnchorEnd = 0x0020 - AnchorBoundary = 0x0040 - AnchorECMABoundary = 0x0080 -) - -func getAnchors(tree *RegexTree) AnchorLoc { - - var concatNode *regexNode - nextChild, result := 0, AnchorLoc(0) - - curNode := tree.root - - for { - switch curNode.t { - case ntConcatenate: - if len(curNode.children) > 0 { - concatNode = curNode - nextChild = 0 - } - - case ntGreedy, ntCapture: - curNode = curNode.children[0] - concatNode = nil - continue - - case ntBol, ntEol, ntBoundary, ntECMABoundary, ntBeginning, - ntStart, ntEndZ, ntEnd: - return result | anchorFromType(curNode.t) - - case ntEmpty, ntRequire, ntPrevent: - - default: - return result - } - - if concatNode == nil || nextChild >= len(concatNode.children) { - return result - } - - curNode = concatNode.children[nextChild] - nextChild++ - } -} - -func anchorFromType(t nodeType) AnchorLoc { - switch t { - case ntBol: - return AnchorBol - case ntEol: - return AnchorEol - case ntBoundary: - return AnchorBoundary - case ntECMABoundary: - return AnchorECMABoundary - case ntBeginning: - return AnchorBeginning - case ntStart: - return AnchorStart - case ntEndZ: - return AnchorEndZ - case ntEnd: - return AnchorEnd - default: - return 0 - } -} - -// anchorDescription returns a human-readable description of the anchors -func (anchors AnchorLoc) String() string { - buf := &bytes.Buffer{} - - if 0 != (anchors & AnchorBeginning) { - buf.WriteString(", Beginning") - } - if 0 != (anchors & AnchorStart) { - buf.WriteString(", Start") - } - if 0 != (anchors & AnchorBol) { - buf.WriteString(", Bol") - } - if 0 != (anchors & AnchorBoundary) { - buf.WriteString(", Boundary") - } - if 0 != (anchors & AnchorECMABoundary) { - buf.WriteString(", ECMABoundary") - } - if 0 != (anchors & AnchorEol) { - buf.WriteString(", Eol") - } - if 0 != (anchors & AnchorEnd) { - buf.WriteString(", End") - } - if 0 != (anchors & AnchorEndZ) { - buf.WriteString(", EndZ") - } - - // trim off comma - if buf.Len() >= 2 { - return buf.String()[2:] - } - return "None" -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go b/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go deleted file mode 100644 index bcf4d3f2..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go +++ /dev/null @@ -1,87 +0,0 @@ -package syntax - -import ( - "bytes" - "errors" -) - -type ReplacerData struct { - Rep string - Strings []string - Rules []int -} - -const ( - replaceSpecials = 4 - replaceLeftPortion = -1 - replaceRightPortion = -2 - replaceLastGroup = -3 - replaceWholeString = -4 -) - -//ErrReplacementError is a general error during parsing the replacement text -var ErrReplacementError = errors.New("Replacement pattern error.") - -// NewReplacerData will populate a reusable replacer data struct based on the given replacement string -// and the capture group data from a regexp -func NewReplacerData(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions) (*ReplacerData, error) { - p := parser{ - options: op, - caps: caps, - capsize: capsize, - capnames: capnames, - } - p.setPattern(rep) - concat, err := p.scanReplacement() - if err != nil { - return nil, err - } - - if concat.t != ntConcatenate { - panic(ErrReplacementError) - } - - sb := &bytes.Buffer{} - var ( - strings []string - rules []int - ) - - for _, child := range concat.children { - switch child.t { - case ntMulti: - child.writeStrToBuf(sb) - - case ntOne: - sb.WriteRune(child.ch) - - case ntRef: - if sb.Len() > 0 { - rules = append(rules, len(strings)) - strings = append(strings, sb.String()) - sb.Reset() - } - slot := child.m - - if len(caps) > 0 && slot >= 0 { - slot = caps[slot] - } - - rules = append(rules, -replaceSpecials-1-slot) - - default: - panic(ErrReplacementError) - } - } - - if sb.Len() > 0 { - rules = append(rules, len(strings)) - strings = append(strings, sb.String()) - } - - return &ReplacerData{ - Rep: rep, - Strings: strings, - Rules: rules, - }, nil -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/tree.go b/vendor/github.com/dlclark/regexp2/syntax/tree.go deleted file mode 100644 index ea288293..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/tree.go +++ /dev/null @@ -1,654 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" - "strconv" -) - -type RegexTree struct { - root *regexNode - caps map[int]int - capnumlist []int - captop int - Capnames map[string]int - Caplist []string - options RegexOptions -} - -// It is built into a parsed tree for a regular expression. - -// Implementation notes: -// -// Since the node tree is a temporary data structure only used -// during compilation of the regexp to integer codes, it's -// designed for clarity and convenience rather than -// space efficiency. -// -// RegexNodes are built into a tree, linked by the n.children list. -// Each node also has a n.parent and n.ichild member indicating -// its parent and which child # it is in its parent's list. -// -// RegexNodes come in as many types as there are constructs in -// a regular expression, for example, "concatenate", "alternate", -// "one", "rept", "group". There are also node types for basic -// peephole optimizations, e.g., "onerep", "notsetrep", etc. -// -// Because perl 5 allows "lookback" groups that scan backwards, -// each node also gets a "direction". Normally the value of -// boolean n.backward = false. -// -// During parsing, top-level nodes are also stacked onto a parse -// stack (a stack of trees). For this purpose we have a n.next -// pointer. [Note that to save a few bytes, we could overload the -// n.parent pointer instead.] -// -// On the parse stack, each tree has a "role" - basically, the -// nonterminal in the grammar that the parser has currently -// assigned to the tree. That code is stored in n.role. -// -// Finally, some of the different kinds of nodes have data. -// Two integers (for the looping constructs) are stored in -// n.operands, an an object (either a string or a set) -// is stored in n.data -type regexNode struct { - t nodeType - children []*regexNode - str []rune - set *CharSet - ch rune - m int - n int - options RegexOptions - next *regexNode -} - -type nodeType int32 - -const ( - // The following are leaves, and correspond to primitive operations - - ntOnerep nodeType = 0 // lef,back char,min,max a {n} - ntNotonerep = 1 // lef,back char,min,max .{n} - ntSetrep = 2 // lef,back set,min,max [\d]{n} - ntOneloop = 3 // lef,back char,min,max a {,n} - ntNotoneloop = 4 // lef,back char,min,max .{,n} - ntSetloop = 5 // lef,back set,min,max [\d]{,n} - ntOnelazy = 6 // lef,back char,min,max a {,n}? - ntNotonelazy = 7 // lef,back char,min,max .{,n}? - ntSetlazy = 8 // lef,back set,min,max [\d]{,n}? - ntOne = 9 // lef char a - ntNotone = 10 // lef char [^a] - ntSet = 11 // lef set [a-z\s] \w \s \d - ntMulti = 12 // lef string abcd - ntRef = 13 // lef group \# - ntBol = 14 // ^ - ntEol = 15 // $ - ntBoundary = 16 // \b - ntNonboundary = 17 // \B - ntBeginning = 18 // \A - ntStart = 19 // \G - ntEndZ = 20 // \Z - ntEnd = 21 // \Z - - // Interior nodes do not correspond to primitive operations, but - // control structures compositing other operations - - // Concat and alternate take n children, and can run forward or backwards - - ntNothing = 22 // [] - ntEmpty = 23 // () - ntAlternate = 24 // a|b - ntConcatenate = 25 // ab - ntLoop = 26 // m,x * + ? {,} - ntLazyloop = 27 // m,x *? +? ?? {,}? - ntCapture = 28 // n () - ntGroup = 29 // (?:) - ntRequire = 30 // (?=) (?<=) - ntPrevent = 31 // (?!) (?) (?<) - ntTestref = 33 // (?(n) | ) - ntTestgroup = 34 // (?(...) | ) - - ntECMABoundary = 41 // \b - ntNonECMABoundary = 42 // \B -) - -func newRegexNode(t nodeType, opt RegexOptions) *regexNode { - return ®exNode{ - t: t, - options: opt, - } -} - -func newRegexNodeCh(t nodeType, opt RegexOptions, ch rune) *regexNode { - return ®exNode{ - t: t, - options: opt, - ch: ch, - } -} - -func newRegexNodeStr(t nodeType, opt RegexOptions, str []rune) *regexNode { - return ®exNode{ - t: t, - options: opt, - str: str, - } -} - -func newRegexNodeSet(t nodeType, opt RegexOptions, set *CharSet) *regexNode { - return ®exNode{ - t: t, - options: opt, - set: set, - } -} - -func newRegexNodeM(t nodeType, opt RegexOptions, m int) *regexNode { - return ®exNode{ - t: t, - options: opt, - m: m, - } -} -func newRegexNodeMN(t nodeType, opt RegexOptions, m, n int) *regexNode { - return ®exNode{ - t: t, - options: opt, - m: m, - n: n, - } -} - -func (n *regexNode) writeStrToBuf(buf *bytes.Buffer) { - for i := 0; i < len(n.str); i++ { - buf.WriteRune(n.str[i]) - } -} - -func (n *regexNode) addChild(child *regexNode) { - reduced := child.reduce() - n.children = append(n.children, reduced) - reduced.next = n -} - -func (n *regexNode) insertChildren(afterIndex int, nodes []*regexNode) { - newChildren := make([]*regexNode, 0, len(n.children)+len(nodes)) - n.children = append(append(append(newChildren, n.children[:afterIndex]...), nodes...), n.children[afterIndex:]...) -} - -// removes children including the start but not the end index -func (n *regexNode) removeChildren(startIndex, endIndex int) { - n.children = append(n.children[:startIndex], n.children[endIndex:]...) -} - -// Pass type as OneLazy or OneLoop -func (n *regexNode) makeRep(t nodeType, min, max int) { - n.t += (t - ntOne) - n.m = min - n.n = max -} - -func (n *regexNode) reduce() *regexNode { - switch n.t { - case ntAlternate: - return n.reduceAlternation() - - case ntConcatenate: - return n.reduceConcatenation() - - case ntLoop, ntLazyloop: - return n.reduceRep() - - case ntGroup: - return n.reduceGroup() - - case ntSet, ntSetloop: - return n.reduceSet() - - default: - return n - } -} - -// Basic optimization. Single-letter alternations can be replaced -// by faster set specifications, and nested alternations with no -// intervening operators can be flattened: -// -// a|b|c|def|g|h -> [a-c]|def|[gh] -// apple|(?:orange|pear)|grape -> apple|orange|pear|grape -func (n *regexNode) reduceAlternation() *regexNode { - if len(n.children) == 0 { - return newRegexNode(ntNothing, n.options) - } - - wasLastSet := false - lastNodeCannotMerge := false - var optionsLast RegexOptions - var i, j int - - for i, j = 0, 0; i < len(n.children); i, j = i+1, j+1 { - at := n.children[i] - - if j < i { - n.children[j] = at - } - - for { - if at.t == ntAlternate { - for k := 0; k < len(at.children); k++ { - at.children[k].next = n - } - n.insertChildren(i+1, at.children) - - j-- - } else if at.t == ntSet || at.t == ntOne { - // Cannot merge sets if L or I options differ, or if either are negated. - optionsAt := at.options & (RightToLeft | IgnoreCase) - - if at.t == ntSet { - if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !at.set.IsMergeable() { - wasLastSet = true - lastNodeCannotMerge = !at.set.IsMergeable() - optionsLast = optionsAt - break - } - } else if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge { - wasLastSet = true - lastNodeCannotMerge = false - optionsLast = optionsAt - break - } - - // The last node was a Set or a One, we're a Set or One and our options are the same. - // Merge the two nodes. - j-- - prev := n.children[j] - - var prevCharClass *CharSet - if prev.t == ntOne { - prevCharClass = &CharSet{} - prevCharClass.addChar(prev.ch) - } else { - prevCharClass = prev.set - } - - if at.t == ntOne { - prevCharClass.addChar(at.ch) - } else { - prevCharClass.addSet(*at.set) - } - - prev.t = ntSet - prev.set = prevCharClass - } else if at.t == ntNothing { - j-- - } else { - wasLastSet = false - lastNodeCannotMerge = false - } - break - } - } - - if j < i { - n.removeChildren(j, i) - } - - return n.stripEnation(ntNothing) -} - -// Basic optimization. Adjacent strings can be concatenated. -// -// (?:abc)(?:def) -> abcdef -func (n *regexNode) reduceConcatenation() *regexNode { - // Eliminate empties and concat adjacent strings/chars - - var optionsLast RegexOptions - var optionsAt RegexOptions - var i, j int - - if len(n.children) == 0 { - return newRegexNode(ntEmpty, n.options) - } - - wasLastString := false - - for i, j = 0, 0; i < len(n.children); i, j = i+1, j+1 { - var at, prev *regexNode - - at = n.children[i] - - if j < i { - n.children[j] = at - } - - if at.t == ntConcatenate && - ((at.options & RightToLeft) == (n.options & RightToLeft)) { - for k := 0; k < len(at.children); k++ { - at.children[k].next = n - } - - //insert at.children at i+1 index in n.children - n.insertChildren(i+1, at.children) - - j-- - } else if at.t == ntMulti || at.t == ntOne { - // Cannot merge strings if L or I options differ - optionsAt = at.options & (RightToLeft | IgnoreCase) - - if !wasLastString || optionsLast != optionsAt { - wasLastString = true - optionsLast = optionsAt - continue - } - - j-- - prev = n.children[j] - - if prev.t == ntOne { - prev.t = ntMulti - prev.str = []rune{prev.ch} - } - - if (optionsAt & RightToLeft) == 0 { - if at.t == ntOne { - prev.str = append(prev.str, at.ch) - } else { - prev.str = append(prev.str, at.str...) - } - } else { - if at.t == ntOne { - // insert at the front by expanding our slice, copying the data over, and then setting the value - prev.str = append(prev.str, 0) - copy(prev.str[1:], prev.str) - prev.str[0] = at.ch - } else { - //insert at the front...this one we'll make a new slice and copy both into it - merge := make([]rune, len(prev.str)+len(at.str)) - copy(merge, at.str) - copy(merge[len(at.str):], prev.str) - prev.str = merge - } - } - } else if at.t == ntEmpty { - j-- - } else { - wasLastString = false - } - } - - if j < i { - // remove indices j through i from the children - n.removeChildren(j, i) - } - - return n.stripEnation(ntEmpty) -} - -// Nested repeaters just get multiplied with each other if they're not -// too lumpy -func (n *regexNode) reduceRep() *regexNode { - - u := n - t := n.t - min := n.m - max := n.n - - for { - if len(u.children) == 0 { - break - } - - child := u.children[0] - - // multiply reps of the same type only - if child.t != t { - childType := child.t - - if !(childType >= ntOneloop && childType <= ntSetloop && t == ntLoop || - childType >= ntOnelazy && childType <= ntSetlazy && t == ntLazyloop) { - break - } - } - - // child can be too lumpy to blur, e.g., (a {100,105}) {3} or (a {2,})? - // [but things like (a {2,})+ are not too lumpy...] - if u.m == 0 && child.m > 1 || child.n < child.m*2 { - break - } - - u = child - if u.m > 0 { - if (math.MaxInt32-1)/u.m < min { - u.m = math.MaxInt32 - } else { - u.m = u.m * min - } - } - if u.n > 0 { - if (math.MaxInt32-1)/u.n < max { - u.n = math.MaxInt32 - } else { - u.n = u.n * max - } - } - } - - if math.MaxInt32 == min { - return newRegexNode(ntNothing, n.options) - } - return u - -} - -// Simple optimization. If a concatenation or alternation has only -// one child strip out the intermediate node. If it has zero children, -// turn it into an empty. -func (n *regexNode) stripEnation(emptyType nodeType) *regexNode { - switch len(n.children) { - case 0: - return newRegexNode(emptyType, n.options) - case 1: - return n.children[0] - default: - return n - } -} - -func (n *regexNode) reduceGroup() *regexNode { - u := n - - for u.t == ntGroup { - u = u.children[0] - } - - return u -} - -// Simple optimization. If a set is a singleton, an inverse singleton, -// or empty, it's transformed accordingly. -func (n *regexNode) reduceSet() *regexNode { - // Extract empty-set, one and not-one case as special - - if n.set == nil { - n.t = ntNothing - } else if n.set.IsSingleton() { - n.ch = n.set.SingletonChar() - n.set = nil - n.t += (ntOne - ntSet) - } else if n.set.IsSingletonInverse() { - n.ch = n.set.SingletonChar() - n.set = nil - n.t += (ntNotone - ntSet) - } - - return n -} - -func (n *regexNode) reverseLeft() *regexNode { - if n.options&RightToLeft != 0 && n.t == ntConcatenate && len(n.children) > 0 { - //reverse children order - for left, right := 0, len(n.children)-1; left < right; left, right = left+1, right-1 { - n.children[left], n.children[right] = n.children[right], n.children[left] - } - } - - return n -} - -func (n *regexNode) makeQuantifier(lazy bool, min, max int) *regexNode { - if min == 0 && max == 0 { - return newRegexNode(ntEmpty, n.options) - } - - if min == 1 && max == 1 { - return n - } - - switch n.t { - case ntOne, ntNotone, ntSet: - if lazy { - n.makeRep(Onelazy, min, max) - } else { - n.makeRep(Oneloop, min, max) - } - return n - - default: - var t nodeType - if lazy { - t = ntLazyloop - } else { - t = ntLoop - } - result := newRegexNodeMN(t, n.options, min, max) - result.addChild(n) - return result - } -} - -// debug functions - -var typeStr = []string{ - "Onerep", "Notonerep", "Setrep", - "Oneloop", "Notoneloop", "Setloop", - "Onelazy", "Notonelazy", "Setlazy", - "One", "Notone", "Set", - "Multi", "Ref", - "Bol", "Eol", "Boundary", "Nonboundary", - "Beginning", "Start", "EndZ", "End", - "Nothing", "Empty", - "Alternate", "Concatenate", - "Loop", "Lazyloop", - "Capture", "Group", "Require", "Prevent", "Greedy", - "Testref", "Testgroup", - "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", - "ECMABoundary", "NonECMABoundary", -} - -func (n *regexNode) description() string { - buf := &bytes.Buffer{} - - buf.WriteString(typeStr[n.t]) - - if (n.options & ExplicitCapture) != 0 { - buf.WriteString("-C") - } - if (n.options & IgnoreCase) != 0 { - buf.WriteString("-I") - } - if (n.options & RightToLeft) != 0 { - buf.WriteString("-L") - } - if (n.options & Multiline) != 0 { - buf.WriteString("-M") - } - if (n.options & Singleline) != 0 { - buf.WriteString("-S") - } - if (n.options & IgnorePatternWhitespace) != 0 { - buf.WriteString("-X") - } - if (n.options & ECMAScript) != 0 { - buf.WriteString("-E") - } - - switch n.t { - case ntOneloop, ntNotoneloop, ntOnelazy, ntNotonelazy, ntOne, ntNotone: - buf.WriteString("(Ch = " + CharDescription(n.ch) + ")") - break - case ntCapture: - buf.WriteString("(index = " + strconv.Itoa(n.m) + ", unindex = " + strconv.Itoa(n.n) + ")") - break - case ntRef, ntTestref: - buf.WriteString("(index = " + strconv.Itoa(n.m) + ")") - break - case ntMulti: - fmt.Fprintf(buf, "(String = %s)", string(n.str)) - break - case ntSet, ntSetloop, ntSetlazy: - buf.WriteString("(Set = " + n.set.String() + ")") - break - } - - switch n.t { - case ntOneloop, ntNotoneloop, ntOnelazy, ntNotonelazy, ntSetloop, ntSetlazy, ntLoop, ntLazyloop: - buf.WriteString("(Min = ") - buf.WriteString(strconv.Itoa(n.m)) - buf.WriteString(", Max = ") - if n.n == math.MaxInt32 { - buf.WriteString("inf") - } else { - buf.WriteString(strconv.Itoa(n.n)) - } - buf.WriteString(")") - - break - } - - return buf.String() -} - -var padSpace = []byte(" ") - -func (t *RegexTree) Dump() string { - return t.root.dump() -} - -func (n *regexNode) dump() string { - var stack []int - CurNode := n - CurChild := 0 - - buf := bytes.NewBufferString(CurNode.description()) - buf.WriteRune('\n') - - for { - if CurNode.children != nil && CurChild < len(CurNode.children) { - stack = append(stack, CurChild+1) - CurNode = CurNode.children[CurChild] - CurChild = 0 - - Depth := len(stack) - if Depth > 32 { - Depth = 32 - } - buf.Write(padSpace[:Depth]) - buf.WriteString(CurNode.description()) - buf.WriteRune('\n') - } else { - if len(stack) == 0 { - break - } - - CurChild = stack[len(stack)-1] - stack = stack[:len(stack)-1] - CurNode = CurNode.next - } - } - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/writer.go b/vendor/github.com/dlclark/regexp2/syntax/writer.go deleted file mode 100644 index a5aa11ca..00000000 --- a/vendor/github.com/dlclark/regexp2/syntax/writer.go +++ /dev/null @@ -1,500 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" - "os" -) - -func Write(tree *RegexTree) (*Code, error) { - w := writer{ - intStack: make([]int, 0, 32), - emitted: make([]int, 2), - stringhash: make(map[string]int), - sethash: make(map[string]int), - } - - code, err := w.codeFromTree(tree) - - if tree.options&Debug > 0 && code != nil { - os.Stdout.WriteString(code.Dump()) - os.Stdout.WriteString("\n") - } - - return code, err -} - -type writer struct { - emitted []int - - intStack []int - curpos int - stringhash map[string]int - stringtable [][]rune - sethash map[string]int - settable []*CharSet - counting bool - count int - trackcount int - caps map[int]int -} - -const ( - beforeChild nodeType = 64 - afterChild = 128 - //MaxPrefixSize is the largest number of runes we'll use for a BoyerMoyer prefix - MaxPrefixSize = 50 -) - -// The top level RegexCode generator. It does a depth-first walk -// through the tree and calls EmitFragment to emits code before -// and after each child of an interior node, and at each leaf. -// -// It runs two passes, first to count the size of the generated -// code, and second to generate the code. -// -// We should time it against the alternative, which is -// to just generate the code and grow the array as we go. -func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { - var ( - curNode *regexNode - curChild int - capsize int - ) - // construct sparse capnum mapping if some numbers are unused - - if tree.capnumlist == nil || tree.captop == len(tree.capnumlist) { - capsize = tree.captop - w.caps = nil - } else { - capsize = len(tree.capnumlist) - w.caps = tree.caps - for i := 0; i < len(tree.capnumlist); i++ { - w.caps[tree.capnumlist[i]] = i - } - } - - w.counting = true - - for { - if !w.counting { - w.emitted = make([]int, w.count) - } - - curNode = tree.root - curChild = 0 - - w.emit1(Lazybranch, 0) - - for { - if len(curNode.children) == 0 { - w.emitFragment(curNode.t, curNode, 0) - } else if curChild < len(curNode.children) { - w.emitFragment(curNode.t|beforeChild, curNode, curChild) - - curNode = curNode.children[curChild] - - w.pushInt(curChild) - curChild = 0 - continue - } - - if w.emptyStack() { - break - } - - curChild = w.popInt() - curNode = curNode.next - - w.emitFragment(curNode.t|afterChild, curNode, curChild) - curChild++ - } - - w.patchJump(0, w.curPos()) - w.emit(Stop) - - if !w.counting { - break - } - - w.counting = false - } - - fcPrefix := getFirstCharsPrefix(tree) - prefix := getPrefix(tree) - rtl := (tree.options & RightToLeft) != 0 - - var bmPrefix *BmPrefix - //TODO: benchmark string prefixes - if prefix != nil && len(prefix.PrefixStr) > 0 && MaxPrefixSize > 0 { - if len(prefix.PrefixStr) > MaxPrefixSize { - // limit prefix changes to 10k - prefix.PrefixStr = prefix.PrefixStr[:MaxPrefixSize] - } - bmPrefix = newBmPrefix(prefix.PrefixStr, prefix.CaseInsensitive, rtl) - } else { - bmPrefix = nil - } - - return &Code{ - Codes: w.emitted, - Strings: w.stringtable, - Sets: w.settable, - TrackCount: w.trackcount, - Caps: w.caps, - Capsize: capsize, - FcPrefix: fcPrefix, - BmPrefix: bmPrefix, - Anchors: getAnchors(tree), - RightToLeft: rtl, - }, nil -} - -// The main RegexCode generator. It does a depth-first walk -// through the tree and calls EmitFragment to emits code before -// and after each child of an interior node, and at each leaf. -func (w *writer) emitFragment(nodetype nodeType, node *regexNode, curIndex int) error { - bits := InstOp(0) - - if nodetype <= ntRef { - if (node.options & RightToLeft) != 0 { - bits |= Rtl - } - if (node.options & IgnoreCase) != 0 { - bits |= Ci - } - } - ntBits := nodeType(bits) - - switch nodetype { - case ntConcatenate | beforeChild, ntConcatenate | afterChild, ntEmpty: - break - - case ntAlternate | beforeChild: - if curIndex < len(node.children)-1 { - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - } - - case ntAlternate | afterChild: - if curIndex < len(node.children)-1 { - lbPos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(lbPos, w.curPos()) - } else { - for i := 0; i < curIndex; i++ { - w.patchJump(w.popInt(), w.curPos()) - } - } - break - - case ntTestref | beforeChild: - if curIndex == 0 { - w.emit(Setjump) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - w.emit1(Testref, w.mapCapnum(node.m)) - w.emit(Forejump) - } - - case ntTestref | afterChild: - if curIndex == 0 { - branchpos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(branchpos, w.curPos()) - w.emit(Forejump) - if len(node.children) <= 1 { - w.patchJump(w.popInt(), w.curPos()) - } - } else if curIndex == 1 { - w.patchJump(w.popInt(), w.curPos()) - } - - case ntTestgroup | beforeChild: - if curIndex == 0 { - w.emit(Setjump) - w.emit(Setmark) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - } - - case ntTestgroup | afterChild: - if curIndex == 0 { - w.emit(Getmark) - w.emit(Forejump) - } else if curIndex == 1 { - Branchpos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(Branchpos, w.curPos()) - w.emit(Getmark) - w.emit(Forejump) - if len(node.children) <= 2 { - w.patchJump(w.popInt(), w.curPos()) - } - } else if curIndex == 2 { - w.patchJump(w.popInt(), w.curPos()) - } - - case ntLoop | beforeChild, ntLazyloop | beforeChild: - - if node.n < math.MaxInt32 || node.m > 1 { - if node.m == 0 { - w.emit1(Nullcount, 0) - } else { - w.emit1(Setcount, 1-node.m) - } - } else if node.m == 0 { - w.emit(Nullmark) - } else { - w.emit(Setmark) - } - - if node.m == 0 { - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - } - w.pushInt(w.curPos()) - - case ntLoop | afterChild, ntLazyloop | afterChild: - - startJumpPos := w.curPos() - lazy := (nodetype - (ntLoop | afterChild)) - - if node.n < math.MaxInt32 || node.m > 1 { - if node.n == math.MaxInt32 { - w.emit2(InstOp(Branchcount+lazy), w.popInt(), math.MaxInt32) - } else { - w.emit2(InstOp(Branchcount+lazy), w.popInt(), node.n-node.m) - } - } else { - w.emit1(InstOp(Branchmark+lazy), w.popInt()) - } - - if node.m == 0 { - w.patchJump(w.popInt(), startJumpPos) - } - - case ntGroup | beforeChild, ntGroup | afterChild: - - case ntCapture | beforeChild: - w.emit(Setmark) - - case ntCapture | afterChild: - w.emit2(Capturemark, w.mapCapnum(node.m), w.mapCapnum(node.n)) - - case ntRequire | beforeChild: - // NOTE: the following line causes lookahead/lookbehind to be - // NON-BACKTRACKING. It can be commented out with (*) - w.emit(Setjump) - - w.emit(Setmark) - - case ntRequire | afterChild: - w.emit(Getmark) - - // NOTE: the following line causes lookahead/lookbehind to be - // NON-BACKTRACKING. It can be commented out with (*) - w.emit(Forejump) - - case ntPrevent | beforeChild: - w.emit(Setjump) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - - case ntPrevent | afterChild: - w.emit(Backjump) - w.patchJump(w.popInt(), w.curPos()) - w.emit(Forejump) - - case ntGreedy | beforeChild: - w.emit(Setjump) - - case ntGreedy | afterChild: - w.emit(Forejump) - - case ntOne, ntNotone: - w.emit1(InstOp(node.t|ntBits), int(node.ch)) - - case ntNotoneloop, ntNotonelazy, ntOneloop, ntOnelazy: - if node.m > 0 { - if node.t == ntOneloop || node.t == ntOnelazy { - w.emit2(Onerep|bits, int(node.ch), node.m) - } else { - w.emit2(Notonerep|bits, int(node.ch), node.m) - } - } - if node.n > node.m { - if node.n == math.MaxInt32 { - w.emit2(InstOp(node.t|ntBits), int(node.ch), math.MaxInt32) - } else { - w.emit2(InstOp(node.t|ntBits), int(node.ch), node.n-node.m) - } - } - - case ntSetloop, ntSetlazy: - if node.m > 0 { - w.emit2(Setrep|bits, w.setCode(node.set), node.m) - } - if node.n > node.m { - if node.n == math.MaxInt32 { - w.emit2(InstOp(node.t|ntBits), w.setCode(node.set), math.MaxInt32) - } else { - w.emit2(InstOp(node.t|ntBits), w.setCode(node.set), node.n-node.m) - } - } - - case ntMulti: - w.emit1(InstOp(node.t|ntBits), w.stringCode(node.str)) - - case ntSet: - w.emit1(InstOp(node.t|ntBits), w.setCode(node.set)) - - case ntRef: - w.emit1(InstOp(node.t|ntBits), w.mapCapnum(node.m)) - - case ntNothing, ntBol, ntEol, ntBoundary, ntNonboundary, ntECMABoundary, ntNonECMABoundary, ntBeginning, ntStart, ntEndZ, ntEnd: - w.emit(InstOp(node.t)) - - default: - return fmt.Errorf("unexpected opcode in regular expression generation: %v", nodetype) - } - - return nil -} - -// To avoid recursion, we use a simple integer stack. -// This is the push. -func (w *writer) pushInt(i int) { - w.intStack = append(w.intStack, i) -} - -// Returns true if the stack is empty. -func (w *writer) emptyStack() bool { - return len(w.intStack) == 0 -} - -// This is the pop. -func (w *writer) popInt() int { - //get our item - idx := len(w.intStack) - 1 - i := w.intStack[idx] - //trim our slice - w.intStack = w.intStack[:idx] - return i -} - -// Returns the current position in the emitted code. -func (w *writer) curPos() int { - return w.curpos -} - -// Fixes up a jump instruction at the specified offset -// so that it jumps to the specified jumpDest. -func (w *writer) patchJump(offset, jumpDest int) { - w.emitted[offset+1] = jumpDest -} - -// Returns an index in the set table for a charset -// uses a map to eliminate duplicates. -func (w *writer) setCode(set *CharSet) int { - if w.counting { - return 0 - } - - buf := &bytes.Buffer{} - - set.mapHashFill(buf) - hash := buf.String() - i, ok := w.sethash[hash] - if !ok { - i = len(w.sethash) - w.sethash[hash] = i - w.settable = append(w.settable, set) - } - return i -} - -// Returns an index in the string table for a string. -// uses a map to eliminate duplicates. -func (w *writer) stringCode(str []rune) int { - if w.counting { - return 0 - } - - hash := string(str) - i, ok := w.stringhash[hash] - if !ok { - i = len(w.stringhash) - w.stringhash[hash] = i - w.stringtable = append(w.stringtable, str) - } - - return i -} - -// When generating code on a regex that uses a sparse set -// of capture slots, we hash them to a dense set of indices -// for an array of capture slots. Instead of doing the hash -// at match time, it's done at compile time, here. -func (w *writer) mapCapnum(capnum int) int { - if capnum == -1 { - return -1 - } - - if w.caps != nil { - return w.caps[capnum] - } - - return capnum -} - -// Emits a zero-argument operation. Note that the emit -// functions all run in two modes: they can emit code, or -// they can just count the size of the code. -func (w *writer) emit(op InstOp) { - if w.counting { - w.count++ - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ -} - -// Emits a one-argument operation. -func (w *writer) emit1(op InstOp, opd1 int) { - if w.counting { - w.count += 2 - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ - w.emitted[w.curpos] = opd1 - w.curpos++ -} - -// Emits a two-argument operation. -func (w *writer) emit2(op InstOp, opd1, opd2 int) { - if w.counting { - w.count += 3 - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ - w.emitted[w.curpos] = opd1 - w.curpos++ - w.emitted[w.curpos] = opd2 - w.curpos++ -} diff --git a/vendor/github.com/dlclark/regexp2/testoutput1 b/vendor/github.com/dlclark/regexp2/testoutput1 deleted file mode 100644 index fbf63fdf..00000000 --- a/vendor/github.com/dlclark/regexp2/testoutput1 +++ /dev/null @@ -1,7061 +0,0 @@ -# This set of tests is for features that are compatible with all versions of -# Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and -# 32-bit PCRE libraries, and also using the perltest.pl script. - -#forbid_utf -#newline_default lf any anycrlf -#perltest - -/the quick brown fox/ - the quick brown fox - 0: the quick brown fox - What do you know about the quick brown fox? - 0: the quick brown fox -\= Expect no match - The quick brown FOX -No match - What do you know about THE QUICK BROWN FOX? -No match - -/The quick brown fox/i - the quick brown fox - 0: the quick brown fox - The quick brown FOX - 0: The quick brown FOX - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? - 0: THE QUICK BROWN FOX - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - 0: aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - 0: aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - 0: aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - 0: aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - 0: aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - 0: abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - 0: aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - 0: abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - 0: aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - 0: aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - 0: aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz -\= Expect no match - abxyzpqrrabbxyyyypqAzz -No match - abxyzpqrrrrabbxyyyypqAzz -No match - abxyzpqrrrabxyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyypqAzz -No match - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz -No match - -/^(abc){1,2}zz/ - abczz - 0: abczz - 1: abc - abcabczz - 0: abcabczz - 1: abc -\= Expect no match - zz -No match - abcabcabczz -No match - >>abczz -No match - -/^(b+?|a){1,2}?c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: b - bbbc - 0: bbbc - 1: bb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a -\= Expect no match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: bb - bbbc - 0: bbbc - 1: bbb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a -\= Expect no match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}?bc/ - bbc - 0: bbc - 1: b - -/^(b*|ba){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba -\= Expect no match - bababbc -No match - babababc -No match - -/^(ba|b*){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba -\= Expect no match - bababbc -No match - babababc -No match - -#/^\ca\cA\c[;\c:/ -# \x01\x01\e;z -# 0: \x01\x01\x1b;z - -/^[ab\]cde]/ - athing - 0: a - bthing - 0: b - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e -\= Expect no match - fthing -No match - [thing -No match - \\thing -No match - -/^[]cde]/ - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e -\= Expect no match - athing -No match - fthing -No match - -/^[^ab\]cde]/ - fthing - 0: f - [thing - 0: [ - \\thing - 0: \ -\= Expect no match - athing -No match - bthing -No match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^[^]cde]/ - athing - 0: a - fthing - 0: f -\= Expect no match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -# DLC - I don't get this one -#/^\/ -#  -# 0: \x81 - -#updated to handle 16-bits utf8 -/^ÿ/ - ÿ - 0: \xc3\xbf - -/^[0-9]+$/ - 0 - 0: 0 - 1 - 0: 1 - 2 - 0: 2 - 3 - 0: 3 - 4 - 0: 4 - 5 - 0: 5 - 6 - 0: 6 - 7 - 0: 7 - 8 - 0: 8 - 9 - 0: 9 - 10 - 0: 10 - 100 - 0: 100 -\= Expect no match - abc -No match - -/^.*nter/ - enter - 0: enter - inter - 0: inter - uponter - 0: uponter - -/^xxx[0-9]+$/ - xxx0 - 0: xxx0 - xxx1234 - 0: xxx1234 -\= Expect no match - xxx -No match - -/^.+[0-9][0-9][0-9]$/ - x123 - 0: x123 - x1234 - 0: x1234 - xx123 - 0: xx123 - 123456 - 0: 123456 -\= Expect no match - 123 -No match - -/^.+?[0-9][0-9][0-9]$/ - x123 - 0: x123 - x1234 - 0: x1234 - xx123 - 0: xx123 - 123456 - 0: 123456 -\= Expect no match - 123 -No match - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - 0: abc!pqr=apquxz.ixr.zzz.ac.uk - 1: abc - 2: pqr -\= Expect no match - !pqr=apquxz.ixr.zzz.ac.uk -No match - abc!=apquxz.ixr.zzz.ac.uk -No match - abc!pqr=apquxz:ixr.zzz.ac.uk -No match - abc!pqr=apquxz.ixr.zzz.ac.ukk -No match - -/:/ - Well, we need a colon: somewhere - 0: : -\= Expect no match - Fail without a colon -No match - -/([\da-f:]+)$/i - 0abc - 0: 0abc - 1: 0abc - abc - 0: abc - 1: abc - fed - 0: fed - 1: fed - E - 0: E - 1: E - :: - 0: :: - 1: :: - 5f03:12C0::932e - 0: 5f03:12C0::932e - 1: 5f03:12C0::932e - fed def - 0: def - 1: def - Any old stuff - 0: ff - 1: ff -\= Expect no match - 0zzz -No match - gzzz -No match - fed\x20 -No match - Any old rubbish -No match - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - 0: .1.2.3 - 1: 1 - 2: 2 - 3: 3 - A.12.123.0 - 0: A.12.123.0 - 1: 12 - 2: 123 - 3: 0 -\= Expect no match - .1.2.3333 -No match - 1.2.3 -No match - 1234.2.3 -No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1: 1 - 2: non-sp1 - 3: non-sp2 - 1 IN SOA non-sp1 non-sp2 ( - 0: 1 IN SOA non-sp1 non-sp2 ( - 1: 1 - 2: non-sp1 - 3: non-sp2 -\= Expect no match - 1IN SOA non-sp1 non-sp2( -No match - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - 0: a. - Z. - 0: Z. - 2. - 0: 2. - ab-c.pq-r. - 0: ab-c.pq-r. - 1: .pq-r - sxk.zzz.ac.uk. - 0: sxk.zzz.ac.uk. - 1: .uk - x-.y-. - 0: x-.y-. - 1: .y- -\= Expect no match - -abc.peq. -No match - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - 0: *.a - *.b0-a - 0: *.b0-a - 1: 0-a - *.c3-b.c - 0: *.c3-b.c - 1: 3-b - 2: .c - *.c-a.b-c - 0: *.c-a.b-c - 1: -a - 2: .b-c - 3: -c -\= Expect no match - *.0 -No match - *.a- -No match - *.a-b.c- -No match - *.c-a.0-c -No match - -/^(?=ab(de))(abd)(e)/ - abde - 0: abde - 1: de - 2: abd - 3: e - -/^(?!(ab)de|x)(abd)(f)/ - abdf - 0: abdf - 1: - 2: abd - 3: f - -/^(?=(ab(cd)))(ab)/ - abcd - 0: ab - 1: abcd - 2: cd - 3: ab - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - 0: a.b.c.d - 1: .d - A.B.C.D - 0: A.B.C.D - 1: .D - a.b.c.1.2.3.C - 0: a.b.c.1.2.3.C - 1: .C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - 0: "1234" - \"abcd\" ; - 0: "abcd" ; - 1: ; - \"\" ; rhubarb - 0: "" ; rhubarb - 1: ; rhubarb -\= Expect no match - \"1234\" : things -No match - -/^$/ - \ - 0: -\= Expect no match - A non-empty line -No match - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - 0: ab c -\= Expect no match - abc -No match - ab cde -No match - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - 0: ab c -\= Expect no match - abc -No match - ab cde -No match - -/^ a\ b[c ]d $/x - a bcd - 0: a bcd - a b d - 0: a b d -\= Expect no match - abcd -No match - ab d -No match - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: abc - 2: bc - 3: c - 4: def - 5: ef - 6: f - 7: hij - 8: ij - 9: j -10: klm -11: lm -12: m - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: bc - 2: c - 3: ef - 4: f - 5: ij - 6: j - 7: lm - 8: m - -#/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ -# a+ Z0+\x08\n\x1d\x12 -# 0: a+ Z0+\x08\x0a\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - 0: .^$(*+)|{?,?} - -/^a*\w/ - z - 0: z - az - 0: az - aaaz - 0: aaaz - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - a+ - 0: a - aa+ - 0: aa - -/^a*?\w/ - z - 0: z - az - 0: a - aaaz - 0: a - a - 0: a - aa - 0: a - aaaa - 0: a - a+ - 0: a - aa+ - 0: a - -/^a+\w/ - az - 0: az - aaaz - 0: aaaz - aa - 0: aa - aaaa - 0: aaaa - aa+ - 0: aa - -/^a+?\w/ - az - 0: az - aaaz - 0: aa - aa - 0: aa - aaaa - 0: aa - aa+ - 0: aa - -/^\d{8}\w{2,}/ - 1234567890 - 0: 1234567890 - 12345678ab - 0: 12345678ab - 12345678__ - 0: 12345678__ -\= Expect no match - 1234567 -No match - -/^[aeiou\d]{4,5}$/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - aaaaa - 0: aaaaa -\= Expect no match - 123456 -No match - -/^[aeiou\d]{4,5}?/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 1234 - aaaaa - 0: aaaa - 123456 - 0: 1234 - -/\A(abc|def)=(\1){2,3}\Z/ - abc=abcabc - 0: abc=abcabc - 1: abc - 2: abc - def=defdefdef - 0: def=defdefdef - 1: def - 2: def -\= Expect no match - abc=defdef -No match - -/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ - abcdefghijkcda2 - 0: abcdefghijkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - abcdefghijkkkkcda2 - 0: abcdefghijkkkkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - -/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ - cataract cataract23 - 0: cataract cataract23 - 1: cataract - 2: aract - 3: ract - 4: - 5: 3 - catatonic catatonic23 - 0: catatonic catatonic23 - 1: catatonic - 2: atonic - 3: tonic - 4: - 5: 3 - caterpillar caterpillar23 - 0: caterpillar caterpillar23 - 1: caterpillar - 2: erpillar - 3: - 4: - 5: 3 - - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: abcd - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: Sep - From abcd Mon Sep 1 12:33:02 1997 - 0: From abcd Mon Sep 1 12:33 - 1: Sep -\= Expect no match - From abcd Sep 01 12:33:02 1997 -No match - -/^12.34/s - 12\n34 - 0: 12\x0a34 - 12\r34 - 0: 12\x0d34 - -/\w+(?=\t)/ - the quick brown\t fox - 0: brown - -/foo(?!bar)(.*)/ - foobar is foolish see? - 0: foolish see? - 1: lish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - 0: rowbar etc - 1: etc - barrel - 0: barrel - 1: rel - 2barrel - 0: 2barrel - 1: rel - A barrel - 0: A barrel - 1: rel - -/^(\D*)(?=\d)(?!123)/ - abc456 - 0: abc - 1: abc -\= Expect no match - abc123 -No match - -/^1234(?# test newlines - inside)/ - 1234 - 0: 1234 - -/^1234 #comment in extended re - /x - 1234 - 0: 1234 - -/#rhubarb - abcd/x - abcd - 0: abcd - -/^abcd#rhubarb/x - abcd - 0: abcd - -/^(a)\1{2,3}(.)/ - aaab - 0: aaab - 1: a - 2: b - aaaab - 0: aaaab - 1: a - 2: b - aaaaab - 0: aaaaa - 1: a - 2: a - aaaaaab - 0: aaaaa - 1: a - 2: a - -/(?!^)abc/ - the abc - 0: abc -\= Expect no match - abc -No match - -/(?=^)abc/ - abc - 0: abc -\= Expect no match - the abc -No match - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - 0: aabb - 1: b - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: abbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - 0: aa - 1: a - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - 0: aabb - 1: b - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" (a comment) - 0: "A. Other" (a comment) - A. Other (a comment) - 0: Other (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" (a comment) - 0: "A. Other" - A. Other (a comment) - 0: Other - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 - 1.235 - 0: .235 - 1: .23 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 0: .23 - 1: .23 - 2: - 1.875000282 - 0: .875 - 1: .875 - 2: 5 -\= Expect no match - 1.235 -No match - -/\b(foo)\s+(\w+)/i - Food is on the foo table - 0: foo table - 1: foo - 2: table - -/foo(.*)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: d is under the bar in the - -/foo(.*?)bar/ - The food is under the bar in the barn. - 0: food is under the bar - 1: d is under the - -/(.*)(\d*)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 53147 - 2: - -/(.*)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - 0: - 1: - 2: - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 - 1: I have - 2: 2 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/^\D*(?!123)/ - ABC123 - 0: AB - -/^(\D*)(?=\d)(?!123)/ - ABC445 - 0: ABC - 1: ABC -\= Expect no match - ABC123 -No match - -/^[W-]46]/ - W46]789 - 0: W46] - -46]789 - 0: -46] -\= Expect no match - Wall -No match - Zebra -No match - 42 -No match - [abcd] -No match - ]abcd[ -No match - -/^[W-\]46]/ - W46]789 - 0: W - Wall - 0: W - Zebra - 0: Z - Xylophone - 0: X - 42 - 0: 4 - [abcd] - 0: [ - ]abcd[ - 0: ] - \\backslash - 0: \ -\= Expect no match - -46]789 -No match - well -No match - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - 0: 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/^(a){0,0}/ - bcd - 0: - abc - 0: - aab - 0: - -/^(a){0,1}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: a - 1: a - -/^(a){0,2}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - -/^(a){0,3}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - -/^(a){0,}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a - -/^(a){1,1}/ - abc - 0: a - 1: a - aab - 0: a - 1: a -\= Expect no match - bcd -No match - -/^(a){1,2}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a -\= Expect no match - bcd -No match - -/^(a){1,3}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a -\= Expect no match - bcd -No match - -/^(a){1,}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a -\= Expect no match - bcd -No match - -/.*\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.{0,}\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/m - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*\.gif/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*$/ - borfle\nbib.gif\nno - 0: no - -/.*$/m - borfle\nbib.gif\nno - 0: borfle - -/.*$/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ - borfle\nbib.gif\nno\n - 0: no - -/.*$/m - borfle\nbib.gif\nno\n - 0: borfle - -/.*$/s - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/.*$/ms - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/(.*X|^B)/ - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(.*X|^B)/m - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(.*X|^B)/s - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(.*X|^B)/ms - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(?s:.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B -\= Expect no match - abcde\nBar -No match - -/^.*B/ -\= Expect no match - abc\nB -No match - -/(?s)^.*B/ - abc\nB - 0: abc\x0aB - -/(?m)^.*B/ - abc\nB - 0: B - -/(?ms)^.*B/ - abc\nB - 0: abc\x0aB - -/(?ms)^B/ - abc\nB - 0: B - -/(?s)B$/ - B\n - 0: B - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - 0: 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - 0: 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - 0: 123456654321 - -/^[abc]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - 0: abcabcabcabc - 1: c - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - 0: n -\= Expect no match - z -No match - -/abcde{0,0}/ - abcd - 0: abcd -\= Expect no match - abce -No match - -/ab[cd]{0,0}e/ - abe - 0: abe -\= Expect no match - abcde -No match - -/ab(c){0,0}d/ - abd - 0: abd -\= Expect no match - abcd -No match - -/a(b*)/ - a - 0: a - 1: - ab - 0: ab - 1: b - abbbb - 0: abbbb - 1: bbbb -\= Expect no match - bbbbb -No match - -/ab\d{0}e/ - abe - 0: abe -\= Expect no match - ab1e -No match - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - 0: "quick" - 1: quick - \"the \\\"quick\\\" brown fox\" - 0: "the \"quick\" brown fox" - 1: brown fox - -/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - 0: 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - 1: BGCOLOR='#DBE9E9' - 2: align=left valign=top - 3: 43. - 4: Word Processor
(N-1286) - 5: - 6: - 7: - 8: align=left valign=top - 9: Lega lstaff.com -10: align=left valign=top -11: CA - Statewide - -/a[^a]b/ - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/ - acb - 0: acb -\= Expect no match - a\nb -No match - -/a[^a]b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/^(b+?|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/^(b+|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/(?!\A)x/m - a\bx\n - 0: x - a\nx\n - 0: x -\= Expect no match - x\nb\n -No match - -/(A|B)*?CD/ - CD - 0: CD - -/(A|B)*CD/ - CD - 0: CD - -/(AB)*?\1/ - ABABAB - 0: ABAB - 1: AB - -/(AB)*\1/ - ABABAB - 0: ABABAB - 1: AB - -/(?.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo -\= Expect no match - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ -No match - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 -\= Expect no match - 1.235 -No match - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - 1: party -\= Expect no match - this is not a line with only words and spaces! -No match - -/(\d+)(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a - 12345+ - 0: 12345 - 1: 1234 - 2: 5 - -/((?>\d+))(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a -\= Expect no match - 12345+ -No match - -/(?>a+)b/ - aaab - 0: aaab - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/(?>b)+/ - aaabbbccc - 0: bbb - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbc - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - 0: (abc) - 1: abc - (abc(def)xyz) - 0: (abc(def)xyz) - 1: xyz -\= Expect no match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/a(?-i)b/i - ab - 0: ab - Ab - 0: Ab -\= Expect no match - aB -No match - AB -No match - -/(a (?x)b c)d e/ - a bcd e - 0: a bcd e - 1: a bc -\= Expect no match - a b cd e -No match - abcd e -No match - a bcde -No match - -/(a b(?x)c d (?-x)e f)/ - a bcde f - 0: a bcde f - 1: a bcde f -\= Expect no match - abcdef -No match - -/(a(?i)b)c/ - abc - 0: abc - 1: ab - aBc - 0: aBc - 1: aB -\= Expect no match - abC -No match - aBC -No match - Abc -No match - ABc -No match - ABC -No match - AbC -No match - -/a(?i:b)c/ - abc - 0: abc - aBc - 0: aBc -\= Expect no match - ABC -No match - abC -No match - aBC -No match - -/a(?i:b)*c/ - aBc - 0: aBc - aBBc - 0: aBBc -\= Expect no match - aBC -No match - aBBC -No match - -/a(?=b(?i)c)\w\wd/ - abcd - 0: abcd - abCd - 0: abCd -\= Expect no match - aBCd -No match - abcD -No match - -/(?s-i:more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million -\= Expect no match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?:(?s-i)more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million -\= Expect no match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?>a(?i)b+)+c/ - abc - 0: abc - aBbc - 0: aBbc - aBBc - 0: aBBc -\= Expect no match - Abc -No match - abAb -No match - abbC -No match - -/(?=a(?i)b)\w\wc/ - abc - 0: abc - aBc - 0: aBc -\= Expect no match - Ab -No match - abC -No match - aBC -No match - -/(?<=a(?i)b)(\w\w)c/ - abxxc - 0: xxc - 1: xx - aBxxc - 0: xxc - 1: xx -\= Expect no match - Abxxc -No match - ABxxc -No match - abxxC -No match - -/(?:(a)|b)(?(1)A|B)/ - aA - 0: aA - 1: a - bB - 0: bB -\= Expect no match - aB -No match - bA -No match - -/^(a)?(?(1)a|b)+$/ - aa - 0: aa - 1: a - b - 0: b - bb - 0: bb -\= Expect no match - ab -No match - -# Perl gets this next one wrong if the pattern ends with $; in that case it -# fails to match "12". - -/^(?(?=abc)\w{3}:|\d\d)/ - abc: - 0: abc: - 12 - 0: 12 - 123 - 0: 12 -\= Expect no match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 -\= Expect no match - 123 -No match - xyz -No match - -/(?(?<=foo)bar|cat)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat -\= Expect no match - foocat -No match - -/(?(?a*)*/ - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - -/(abc|)+/ - abc - 0: abc - 1: - abcabc - 0: abcabc - 1: - abcabcabc - 0: abcabcabc - 1: - xyz - 0: - 1: - -/([a]*)*/ - a - 0: a - 1: - aaaaa - 0: aaaaa - 1: - -/([ab]*)*/ - a - 0: a - 1: - b - 0: b - 1: - ababab - 0: ababab - 1: - aaaabcde - 0: aaaab - 1: - bbbb - 0: bbbb - 1: - -/([^a]*)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: - aaa - 0: - 1: - -/([^ab]*)*/ - cccc - 0: cccc - 1: - abab - 0: - 1: - -/([a]*?)*/ - a - 0: - 1: - aaaa - 0: - 1: - -/([ab]*?)*/ - a - 0: - 1: - b - 0: - 1: - abab - 0: - 1: - baba - 0: - 1: - -/([^a]*?)*/ - b - 0: - 1: - bbbb - 0: - 1: - aaa - 0: - 1: - -/([^ab]*?)*/ - c - 0: - 1: - cccc - 0: - 1: - baba - 0: - 1: - -/(?>a*)*/ - a - 0: a - aaabcde - 0: aaa - -/((?>a*))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/((?>a*?))*/ - aaaaa - 0: - 1: - aabbaa - 0: - 1: - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 0: 12-sep-98 - 12-09-98 - 0: 12-09-98 -\= Expect no match - sep-12-98 -No match - -/(?<=(foo))bar\1/ - foobarfoo - 0: barfoo - 1: foo - foobarfootling - 0: barfoo - 1: foo -\= Expect no match - foobar -No match - barfoo -No match - -/(?i:saturday|sunday)/ - saturday - 0: saturday - sunday - 0: sunday - Saturday - 0: Saturday - Sunday - 0: Sunday - SATURDAY - 0: SATURDAY - SUNDAY - 0: SUNDAY - SunDay - 0: SunDay - -/(a(?i)bc|BB)x/ - abcx - 0: abcx - 1: abc - aBCx - 0: aBCx - 1: aBC - bbx - 0: bbx - 1: bb - BBx - 0: BBx - 1: BB -\= Expect no match - abcX -No match - aBCX -No match - bbX -No match - BBX -No match - -/^([ab](?i)[cd]|[ef])/ - ac - 0: ac - 1: ac - aC - 0: aC - 1: aC - bD - 0: bD - 1: bD - elephant - 0: e - 1: e - Europe - 0: E - 1: E - frog - 0: f - 1: f - France - 0: F - 1: F -\= Expect no match - Africa -No match - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - 0: ab - 1: ab - aBd - 0: aBd - 1: aBd - xy - 0: xy - 1: xy - xY - 0: xY - 1: xY - zebra - 0: z - 1: z - Zambesi - 0: Z - 1: Z -\= Expect no match - aCD -No match - XY -No match - -/(?<=foo\n)^bar/m - foo\nbar - 0: bar -\= Expect no match - bar -No match - baz\nbar -No match - -/(?<=(?]&/ - <&OUT - 0: <& - -/^(a\1?){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa -\= Expect no match - AB -No match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/^(a(?(1)\1)){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa -\= Expect no match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - 0: foobar - 1: f - 2: o - 3: o - 4: b - 5: a - 6: r - -/(?<=a)b/ - ab - 0: b -\= Expect no match - cb -No match - b -No match - -/(? - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(a*)b+/ - caab - 0: aab - 1: aa - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - 1: - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd -\= Expect no match - abcd: -No match - abcd: -No match - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(>a+)ab/ - -/(?>a+)b/ - aaab - 0: aaab - -/([[:]+)/ - a:[b]: - 0: :[ - 1: :[ - -/([[=]+)/ - a=[b]= - 0: =[ - 1: =[ - -/([[.]+)/ - a.[b]. - 0: .[ - 1: .[ - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/a\Z/ -\= Expect no match - aaab -No match - a\nb\n -No match - -/b\Z/ - a\nb\n - 0: b - -/b\z/ - -/b\Z/ - a\nb - 0: b - -/b\z/ - a\nb - 0: b - -/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ - a - 0: a - 1: - abc - 0: abc - 1: - a-b - 0: a-b - 1: - 0-9 - 0: 0-9 - 1: - a.b - 0: a.b - 1: - 5.6.7 - 0: 5.6.7 - 1: - the.quick.brown.fox - 0: the.quick.brown.fox - 1: - a100.b200.300c - 0: a100.b200.300c - 1: - 12-ab.1245 - 0: 12-ab.1245 - 1: -\= Expect no match - \ -No match - .a -No match - -a -No match - a- -No match - a. -No match - a_b -No match - a.- -No match - a.. -No match - ab..bc -No match - the.quick.brown.fox- -No match - the.quick.brown.fox. -No match - the.quick.brown.fox_ -No match - the.quick.brown.fox+ -No match - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - 0: alphabetabcd - 1: abcd - endingwxyz - 0: endingwxyz - 1: wxyz -\= Expect no match - a rather long string that doesn't end with one of them -No match - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/(?<=\d{3}(?!999))foo/ - 999foo - 0: foo - 123999foo - 0: foo -\= Expect no match - 123abcfoo -No match - -/(?<=(?!...999)\d{3})foo/ - 999foo - 0: foo - 123999foo - 0: foo -\= Expect no match - 123abcfoo -No match - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo -\= Expect no match - 123999foo -No match - -/(?<=\d{3}...)(? - 2: - 3: abcd -
- 2: - 3: abcd - \s*)=(?>\s*) # find - 2: - 3: abcd - Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: A - -/((?>)+|A)*/ - ZABCDEFG - 0: - 1: - -/^[\d-a]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 -\= Expect no match - bcdef -No match - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - -/a b/x - ab - 0: ab - -/(?!\A)x/m - a\nxb\n - 0: x - -/(?!^)x/m -\= Expect no match - a\nxb\n -No match - -#/abc\Qabc\Eabc/ -# abcabcabc -# 0: abcabcabc - -#/abc\Q(*+|\Eabc/ -# abc(*+|abc -# 0: abc(*+|abc - -#/ abc\Q abc\Eabc/x -# abc abcabc -# 0: abc abcabc -#\= Expect no match -# abcabcabc -#No match - -#/abc#comment -# \Q#not comment -# literal\E/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal\E #more comment -# /x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal\E #more comment/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/\Qabc\$xyz\E/ -# abc\\\$xyz -# 0: abc\$xyz - -#/\Qabc\E\$\Qxyz\E/ -# abc\$xyz -# 0: abc$xyz - -/\Gabc/ - abc - 0: abc -\= Expect no match - xyzabc -No match - -/a(?x: b c )d/ - XabcdY - 0: abcd -\= Expect no match - Xa b c d Y -No match - -/((?x)x y z | a b c)/ - XabcY - 0: abc - 1: abc - AxyzB - 0: xyz - 1: xyz - -/(?i)AB(?-i)C/ - XabCY - 0: abC -\= Expect no match - XabcY -No match - -/((?i)AB(?-i)C|D)E/ - abCE - 0: abCE - 1: abC - DE - 0: DE - 1: D -\= Expect no match - abcE -No match - abCe -No match - dE -No match - De -No match - -/(.*)\d+\1/ - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/(.*)\d+\1/s - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/((.*))\d+\1/ - abc123abc - 0: abc123abc - 1: abc - 2: abc - abc123bc - 0: bc123bc - 1: bc - 2: bc - -# This tests for an IPv6 address in the form where it can have up to -# eight components, one and only one of which is empty. This must be -# an internal component. - -/^(?!:) # colon disallowed at start - (?: # start of item - (?: [0-9a-f]{1,4} | # 1-4 hex digits or - (?(1)0 | () ) ) # if null previously matched, fail; else null - : # followed by colon - ){1,7} # end item; 1-7 of them required - [0-9a-f]{1,4} $ # final hex number at end of string - (?(1)|.) # check that there was an empty component - /ix - a123::a123 - 0: a123::a123 - 1: - a123:b342::abcd - 0: a123:b342::abcd - 1: - a123:b342::324e:abcd - 0: a123:b342::324e:abcd - 1: - a123:ddde:b342::324e:abcd - 0: a123:ddde:b342::324e:abcd - 1: - a123:ddde:b342::324e:dcba:abcd - 0: a123:ddde:b342::324e:dcba:abcd - 1: - a123:ddde:9999:b342::324e:dcba:abcd - 0: a123:ddde:9999:b342::324e:dcba:abcd - 1: -\= Expect no match - 1:2:3:4:5:6:7:8 -No match - a123:bce:ddde:9999:b342::324e:dcba:abcd -No match - a123::9999:b342::324e:dcba:abcd -No match - abcde:2:3:4:5:6:7:8 -No match - ::1 -No match - abcd:fee0:123:: -No match - :1 -No match - 1: -No match - -#/[z\Qa-d]\E]/ -# z -# 0: z -# a -# 0: a -# - -# 0: - -# d -# 0: d -# ] -# 0: ] -#\= Expect no match -# b -#No match - -#TODO: PCRE has an optimization to make this workable, .NET does not -#/(a+)*b/ -#\= Expect no match -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -#No match - -# All these had to be updated because we understand unicode -# and this looks like it's expecting single byte matches - -# .NET generates \xe4...not sure what's up, might just be different code pages -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - 0: REGular - regulaer - 0: regulaer - Regex - 0: Regex - regulär - 0: regul\xc3\xa4r - -#/Åæåä[à-ÿÀ-ß]+/ -# Åæåäà -# 0: \xc5\xe6\xe5\xe4\xe0 -# Åæåäÿ -# 0: \xc5\xe6\xe5\xe4\xff -# ÅæåäÀ -# 0: \xc5\xe6\xe5\xe4\xc0 -# Åæåäß -# 0: \xc5\xe6\xe5\xe4\xdf - -/(?<=Z)X./ - \x84XAZXB - 0: XB - -/ab cd (?x) de fg/ - ab cd defg - 0: ab cd defg - -/ab cd(?x) de fg/ - ab cddefg - 0: ab cddefg -\= Expect no match - abcddefg -No match - -/(? - 2: - D - 0: D - 1: - 2: - -# this is really long with debug -- removing for now -#/(a|)*\d/ -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -# 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -# 1: -#\= Expect no match -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -#No match - -/(?>a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -\= Expect no match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(?:a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -\= Expect no match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/^(?s)(?>.*)(? - 2: a - -/(?>(a))b|(a)c/ - ac - 0: ac - 1: - 2: a - -/(?=(a))ab|(a)c/ - ac - 0: ac - 1: - 2: a - -/((?>(a))b|(a)c)/ - ac - 0: ac - 1: ac - 2: - 3: a - -/(?=(?>(a))b|(a)c)(..)/ - ac - 0: ac - 1: - 2: a - 3: ac - -/(?>(?>(a))b|(a)c)/ - ac - 0: ac - 1: - 2: a - -/((?>(a+)b)+(aabab))/ - aaaabaaabaabab - 0: aaaabaaabaabab - 1: aaaabaaabaabab - 2: aaa - 3: aabab - -/(?>a+|ab)+?c/ -\= Expect no match - aabc -No match - -/(?>a+|ab)+c/ -\= Expect no match - aabc -No match - -/(?:a+|ab)+c/ - aabc - 0: aabc - -/^(?:a|ab)+c/ - aaaabc - 0: aaaabc - -/(?=abc){0}xyz/ - xyz - 0: xyz - -/(?=abc){1}xyz/ -\= Expect no match - xyz -No match - -/(?=(a))?./ - ab - 0: a - 1: a - bc - 0: b - -/(?=(a))??./ - ab - 0: a - bc - 0: b - -/^(?!a){0}\w+/ - aaaaa - 0: aaaaa - -/(?<=(abc))?xyz/ - abcxyz - 0: xyz - 1: abc - pqrxyz - 0: xyz - -/^[g]+/ - ggg<<>> - 0: ggg<<>> -\= Expect no match - \\ga -No match - -/^[ga]+/ - gggagagaxyz - 0: gggagaga - -/[:a]xxx[b:]/ - :xxx: - 0: :xxx: - -/(?<=a{2})b/i - xaabc - 0: b -\= Expect no match - xabc -No match - -/(? -# 4: -# 5: c -# 6: d -# 7: Y - -#/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ -# XYabcdY -# 0: XYabcdY -# 1: a -# 2: b -# 3: -# 4: -# 5: c -# 6: d -# 7: Y - -/(?'abc'\w+):\k{2}/ - a:aaxyz - 0: a:aa - 1: a - ab:ababxyz - 0: ab:abab - 1: ab -\= Expect no match - a:axyz -No match - ab:abxyz -No match - -/^(?a)? (?(ab)b|c) (?(ab)d|e)/x - abd - 0: abd - 1: a - ce - 0: ce - -# .NET has more consistent grouping numbers with these dupe groups for the two options -/(?:a(? (?')|(?")) |b(? (?')|(?")) ) (?(quote)[a-z]+|[0-9]+)/x,dupnames - a\"aaaaa - 0: a"aaaaa - 1: " - 2: - 3: " - b\"aaaaa - 0: b"aaaaa - 1: " - 2: - 3: " -\= Expect no match - b\"11111 -No match - -#/(?P(?P0)(?P>L1)|(?P>L2))/ -# 0 -# 0: 0 -# 1: 0 -# 00 -# 0: 00 -# 1: 00 -# 2: 0 -# 0000 -# 0: 0000 -# 1: 0000 -# 2: 0 - -#/(?P(?P0)|(?P>L2)(?P>L1))/ -# 0 -# 0: 0 -# 1: 0 -# 2: 0 -# 00 -# 0: 0 -# 1: 0 -# 2: 0 -# 0000 -# 0: 0 -# 1: 0 -# 2: 0 - -# Check the use of names for failure - -# Check opening parens in comment when seeking forward reference. - -#/(?P(?P=abn)xxx|)+/ -# xxx -# 0: -# 1: - -#Posses -/^(a)?(\w)/ - aaaaX - 0: aa - 1: a - 2: a - YZ - 0: Y - 1: - 2: Y - -#Posses -/^(?:a)?(\w)/ - aaaaX - 0: aa - 1: a - YZ - 0: Y - 1: Y - -/\A.*?(a|bc)/ - ba - 0: ba - 1: a - -/\A.*?(?:a|bc|d)/ - ba - 0: ba - -# -------------------------- - -/(another)?(\1?)test/ - hello world test - 0: test - 1: - 2: - -/(another)?(\1+)test/ -\= Expect no match - hello world test -No match - -/((?:a?)*)*c/ - aac - 0: aac - 1: - -/((?>a?)*)*c/ - aac - 0: aac - 1: - -/(?>.*?a)(?<=ba)/ - aba - 0: ba - -/(?:.*?a)(?<=ba)/ - aba - 0: aba - -/(?>.*?a)b/s - aab - 0: ab - -/(?>.*?a)b/ - aab - 0: ab - -/(?>^a)b/s -\= Expect no match - aab -No match - -/(?>.*?)(?<=(abcd)|(wxyz))/ - alphabetabcd - 0: - 1: abcd - endingwxyz - 0: - 1: - 2: wxyz - -/(?>.*)(?<=(abcd)|(wxyz))/ - alphabetabcd - 0: alphabetabcd - 1: abcd - endingwxyz - 0: endingwxyz - 1: - 2: wxyz - -"(?>.*)foo" -\= Expect no match - abcdfooxyz -No match - -"(?>.*?)foo" - abcdfooxyz - 0: foo - -# Tests that try to figure out how Perl works. My hypothesis is that the first -# verb that is backtracked onto is the one that acts. This seems to be the case -# almost all the time, but there is one exception that is perhaps a bug. - -/a(?=bc).|abd/ - abd - 0: abd - abc - 0: ab - -/a(?>bc)d|abd/ - abceabd - 0: abd - -# These tests were formerly in test 2, but changes in PCRE and Perl have -# made them compatible. - -/^(a)?(?(1)a|b)+$/ -\= Expect no match - a -No match - -# ---- - -/^\d*\w{4}/ - 1234 - 0: 1234 -\= Expect no match - 123 -No match - -/^[^b]*\w{4}/ - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^[^b]*\w{4}/i - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^a*\w{4}/ - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^a*\w{4}/i - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/(?:(?foo)|(?bar))\k/dupnames - foofoo - 0: foofoo - 1: foo - barbar - 0: barbar - 1: bar - -# A notable difference between PCRE and .NET. According to -# the PCRE docs: -# If you make a subroutine call to a non-unique named -# subpattern, the one that corresponds to the first -# occurrence of the name is used. In the absence of -# duplicate numbers (see the previous section) this is -# the one with the lowest number. -# .NET takes the most recently captured number according to MSDN: -# A backreference refers to the most recent definition of -# a group (the definition most immediately to the left, -# when matching left to right). When a group makes multiple -# captures, a backreference refers to the most recent capture. - -#/(?A)(?:(?foo)|(?bar))\k/dupnames -# AfooA -# 0: AfooA -# 1: A -# 2: foo -# AbarA -# 0: AbarA -# 1: A -# 2: -# 3: bar -#\= Expect no match -# Afoofoo -#No match -# Abarbar -#No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1: 1 - 2: non-sp1 - 3: non-sp2 - -# TODO: .NET's group number ordering here in the second example is a bit odd -/^ (?:(?A)|(?'B'B)(?A)) (?(A)x) (?(B)y)$/x,dupnames - Ax - 0: Ax - 1: A - BAxy - 0: BAxy - 1: A - 2: B - -/ ^ a + b $ /x - aaaab - 0: aaaab - -/ ^ a + #comment - b $ /x - aaaab - 0: aaaab - -/ ^ a + #comment - #comment - b $ /x - aaaab - 0: aaaab - -/ ^ (?> a + ) b $ /x - aaaab - 0: aaaab - -/ ^ ( a + ) + \w $ /x - aaaab - 0: aaaab - 1: aaaa - -/(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/ -\= Expect no match - acb -No match - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]*|\"\")*\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]+|\"\")*\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]+|\"\")+\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A([^\"1]+|[\"2]([^\"3]*|[\"4][\"5])*[\"6])+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER -# 1: AFTER -# 2: - -/^\w+(?>\s*)(?<=\w)/ - test test - 0: tes - -#/(?Pa)?(?Pb)?(?()c|d)*l/ -# acl -# 0: acl -# 1: a -# bdl -# 0: bdl -# 1: -# 2: b -# adl -# 0: dl -# bcl -# 0: l - -/\sabc/ - \x0babc - 0: \x0babc - -#/[\Qa]\E]+/ -# aa]] -# 0: aa]] - -#/[\Q]a\E]+/ -# aa]] -# 0: aa]] - -/A((((((((a))))))))\8B/ - AaaB - 0: AaaB - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - -/A(((((((((a)))))))))\9B/ - AaaB - 0: AaaB - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a - -/(|ab)*?d/ - abd - 0: abd - 1: ab - xyd - 0: d - -/(\2|a)(\1)/ - aaa - 0: aa - 1: a - 2: a - -/(\2)(\1)/ - -"Z*(|d*){216}" - -/((((((((((((x))))))))))))\12/ - xx - 0: xx - 1: x - 2: x - 3: x - 4: x - 5: x - 6: x - 7: x - 8: x - 9: x -10: x -11: x -12: x - -#"(?|(\k'Pm')|(?'Pm'))" -# abcd -# 0: -# 1: - -#/(?|(aaa)|(b))\g{1}/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# bb -# 0: bb -# 1: b - -#/(?|(aaa)|(b))(?1)/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# baaa -# 0: baaa -# 1: b -#\= Expect no match -# bb -#No match - -#/(?|(aaa)|(b))/ -# xaaa -# 0: aaa -# 1: aaa -# xbc -# 0: b -# 1: b - -#/(?|(?'a'aaa)|(?'a'b))\k'a'/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# bb -# 0: bb -# 1: b - -#/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames -# aaaccccaaa -# 0: aaaccccaaa -# 1: aaa -# 2: cccc -# bccccb -# 0: bccccb -# 1: b -# 2: cccc - -# End of testinput1 diff --git a/vendor/github.com/docker/distribution/LICENSE b/vendor/github.com/docker/distribution/LICENSE deleted file mode 100644 index e06d2081..00000000 --- a/vendor/github.com/docker/distribution/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/vendor/github.com/docker/distribution/digestset/set.go b/vendor/github.com/docker/distribution/digestset/set.go deleted file mode 100644 index 71327dca..00000000 --- a/vendor/github.com/docker/distribution/digestset/set.go +++ /dev/null @@ -1,247 +0,0 @@ -package digestset - -import ( - "errors" - "sort" - "strings" - "sync" - - digest "github.com/opencontainers/go-digest" -) - -var ( - // ErrDigestNotFound is used when a matching digest - // could not be found in a set. - ErrDigestNotFound = errors.New("digest not found") - - // ErrDigestAmbiguous is used when multiple digests - // are found in a set. None of the matching digests - // should be considered valid matches. - ErrDigestAmbiguous = errors.New("ambiguous digest string") -) - -// Set is used to hold a unique set of digests which -// may be easily referenced by easily referenced by a string -// representation of the digest as well as short representation. -// The uniqueness of the short representation is based on other -// digests in the set. If digests are omitted from this set, -// collisions in a larger set may not be detected, therefore it -// is important to always do short representation lookups on -// the complete set of digests. To mitigate collisions, an -// appropriately long short code should be used. -type Set struct { - mutex sync.RWMutex - entries digestEntries -} - -// NewSet creates an empty set of digests -// which may have digests added. -func NewSet() *Set { - return &Set{ - entries: digestEntries{}, - } -} - -// checkShortMatch checks whether two digests match as either whole -// values or short values. This function does not test equality, -// rather whether the second value could match against the first -// value. -func checkShortMatch(alg digest.Algorithm, hex, shortAlg, shortHex string) bool { - if len(hex) == len(shortHex) { - if hex != shortHex { - return false - } - if len(shortAlg) > 0 && string(alg) != shortAlg { - return false - } - } else if !strings.HasPrefix(hex, shortHex) { - return false - } else if len(shortAlg) > 0 && string(alg) != shortAlg { - return false - } - return true -} - -// Lookup looks for a digest matching the given string representation. -// If no digests could be found ErrDigestNotFound will be returned -// with an empty digest value. If multiple matches are found -// ErrDigestAmbiguous will be returned with an empty digest value. -func (dst *Set) Lookup(d string) (digest.Digest, error) { - dst.mutex.RLock() - defer dst.mutex.RUnlock() - if len(dst.entries) == 0 { - return "", ErrDigestNotFound - } - var ( - searchFunc func(int) bool - alg digest.Algorithm - hex string - ) - dgst, err := digest.Parse(d) - if err == digest.ErrDigestInvalidFormat { - hex = d - searchFunc = func(i int) bool { - return dst.entries[i].val >= d - } - } else { - hex = dgst.Hex() - alg = dgst.Algorithm() - searchFunc = func(i int) bool { - if dst.entries[i].val == hex { - return dst.entries[i].alg >= alg - } - return dst.entries[i].val >= hex - } - } - idx := sort.Search(len(dst.entries), searchFunc) - if idx == len(dst.entries) || !checkShortMatch(dst.entries[idx].alg, dst.entries[idx].val, string(alg), hex) { - return "", ErrDigestNotFound - } - if dst.entries[idx].alg == alg && dst.entries[idx].val == hex { - return dst.entries[idx].digest, nil - } - if idx+1 < len(dst.entries) && checkShortMatch(dst.entries[idx+1].alg, dst.entries[idx+1].val, string(alg), hex) { - return "", ErrDigestAmbiguous - } - - return dst.entries[idx].digest, nil -} - -// Add adds the given digest to the set. An error will be returned -// if the given digest is invalid. If the digest already exists in the -// set, this operation will be a no-op. -func (dst *Set) Add(d digest.Digest) error { - if err := d.Validate(); err != nil { - return err - } - dst.mutex.Lock() - defer dst.mutex.Unlock() - entry := &digestEntry{alg: d.Algorithm(), val: d.Hex(), digest: d} - searchFunc := func(i int) bool { - if dst.entries[i].val == entry.val { - return dst.entries[i].alg >= entry.alg - } - return dst.entries[i].val >= entry.val - } - idx := sort.Search(len(dst.entries), searchFunc) - if idx == len(dst.entries) { - dst.entries = append(dst.entries, entry) - return nil - } else if dst.entries[idx].digest == d { - return nil - } - - entries := append(dst.entries, nil) - copy(entries[idx+1:], entries[idx:len(entries)-1]) - entries[idx] = entry - dst.entries = entries - return nil -} - -// Remove removes the given digest from the set. An err will be -// returned if the given digest is invalid. If the digest does -// not exist in the set, this operation will be a no-op. -func (dst *Set) Remove(d digest.Digest) error { - if err := d.Validate(); err != nil { - return err - } - dst.mutex.Lock() - defer dst.mutex.Unlock() - entry := &digestEntry{alg: d.Algorithm(), val: d.Hex(), digest: d} - searchFunc := func(i int) bool { - if dst.entries[i].val == entry.val { - return dst.entries[i].alg >= entry.alg - } - return dst.entries[i].val >= entry.val - } - idx := sort.Search(len(dst.entries), searchFunc) - // Not found if idx is after or value at idx is not digest - if idx == len(dst.entries) || dst.entries[idx].digest != d { - return nil - } - - entries := dst.entries - copy(entries[idx:], entries[idx+1:]) - entries = entries[:len(entries)-1] - dst.entries = entries - - return nil -} - -// All returns all the digests in the set -func (dst *Set) All() []digest.Digest { - dst.mutex.RLock() - defer dst.mutex.RUnlock() - retValues := make([]digest.Digest, len(dst.entries)) - for i := range dst.entries { - retValues[i] = dst.entries[i].digest - } - - return retValues -} - -// ShortCodeTable returns a map of Digest to unique short codes. The -// length represents the minimum value, the maximum length may be the -// entire value of digest if uniqueness cannot be achieved without the -// full value. This function will attempt to make short codes as short -// as possible to be unique. -func ShortCodeTable(dst *Set, length int) map[digest.Digest]string { - dst.mutex.RLock() - defer dst.mutex.RUnlock() - m := make(map[digest.Digest]string, len(dst.entries)) - l := length - resetIdx := 0 - for i := 0; i < len(dst.entries); i++ { - var short string - extended := true - for extended { - extended = false - if len(dst.entries[i].val) <= l { - short = dst.entries[i].digest.String() - } else { - short = dst.entries[i].val[:l] - for j := i + 1; j < len(dst.entries); j++ { - if checkShortMatch(dst.entries[j].alg, dst.entries[j].val, "", short) { - if j > resetIdx { - resetIdx = j - } - extended = true - } else { - break - } - } - if extended { - l++ - } - } - } - m[dst.entries[i].digest] = short - if i >= resetIdx { - l = length - } - } - return m -} - -type digestEntry struct { - alg digest.Algorithm - val string - digest digest.Digest -} - -type digestEntries []*digestEntry - -func (d digestEntries) Len() int { - return len(d) -} - -func (d digestEntries) Less(i, j int) bool { - if d[i].val != d[j].val { - return d[i].val < d[j].val - } - return d[i].alg < d[j].alg -} - -func (d digestEntries) Swap(i, j int) { - d[i], d[j] = d[j], d[i] -} diff --git a/vendor/github.com/docker/distribution/reference/helpers.go b/vendor/github.com/docker/distribution/reference/helpers.go deleted file mode 100644 index 978df7ea..00000000 --- a/vendor/github.com/docker/distribution/reference/helpers.go +++ /dev/null @@ -1,42 +0,0 @@ -package reference - -import "path" - -// IsNameOnly returns true if reference only contains a repo name. -func IsNameOnly(ref Named) bool { - if _, ok := ref.(NamedTagged); ok { - return false - } - if _, ok := ref.(Canonical); ok { - return false - } - return true -} - -// FamiliarName returns the familiar name string -// for the given named, familiarizing if needed. -func FamiliarName(ref Named) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().Name() - } - return ref.Name() -} - -// FamiliarString returns the familiar string representation -// for the given reference, familiarizing if needed. -func FamiliarString(ref Reference) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().String() - } - return ref.String() -} - -// FamiliarMatch reports whether ref matches the specified pattern. -// See https://godoc.org/path#Match for supported patterns. -func FamiliarMatch(pattern string, ref Reference) (bool, error) { - matched, err := path.Match(pattern, FamiliarString(ref)) - if namedRef, isNamed := ref.(Named); isNamed && !matched { - matched, _ = path.Match(pattern, FamiliarName(namedRef)) - } - return matched, err -} diff --git a/vendor/github.com/docker/distribution/reference/normalize.go b/vendor/github.com/docker/distribution/reference/normalize.go deleted file mode 100644 index 2d71fc5e..00000000 --- a/vendor/github.com/docker/distribution/reference/normalize.go +++ /dev/null @@ -1,170 +0,0 @@ -package reference - -import ( - "errors" - "fmt" - "strings" - - "github.com/docker/distribution/digestset" - "github.com/opencontainers/go-digest" -) - -var ( - legacyDefaultDomain = "index.docker.io" - defaultDomain = "docker.io" - officialRepoName = "library" - defaultTag = "latest" -) - -// normalizedNamed represents a name which has been -// normalized and has a familiar form. A familiar name -// is what is used in Docker UI. An example normalized -// name is "docker.io/library/ubuntu" and corresponding -// familiar name of "ubuntu". -type normalizedNamed interface { - Named - Familiar() Named -} - -// ParseNormalizedNamed parses a string into a named reference -// transforming a familiar name from Docker UI to a fully -// qualified reference. If the value may be an identifier -// use ParseAnyReference. -func ParseNormalizedNamed(s string) (Named, error) { - if ok := anchoredIdentifierRegexp.MatchString(s); ok { - return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) - } - domain, remainder := splitDockerDomain(s) - var remoteName string - if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { - remoteName = remainder[:tagSep] - } else { - remoteName = remainder - } - if strings.ToLower(remoteName) != remoteName { - return nil, errors.New("invalid reference format: repository name must be lowercase") - } - - ref, err := Parse(domain + "/" + remainder) - if err != nil { - return nil, err - } - named, isNamed := ref.(Named) - if !isNamed { - return nil, fmt.Errorf("reference %s has no name", ref.String()) - } - return named, nil -} - -// splitDockerDomain splits a repository name to domain and remotename string. -// If no valid domain is found, the default domain is used. Repository name -// needs to be already validated before. -func splitDockerDomain(name string) (domain, remainder string) { - i := strings.IndexRune(name, '/') - if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != "localhost") { - domain, remainder = defaultDomain, name - } else { - domain, remainder = name[:i], name[i+1:] - } - if domain == legacyDefaultDomain { - domain = defaultDomain - } - if domain == defaultDomain && !strings.ContainsRune(remainder, '/') { - remainder = officialRepoName + "/" + remainder - } - return -} - -// familiarizeName returns a shortened version of the name familiar -// to to the Docker UI. Familiar names have the default domain -// "docker.io" and "library/" repository prefix removed. -// For example, "docker.io/library/redis" will have the familiar -// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". -// Returns a familiarized named only reference. -func familiarizeName(named namedRepository) repository { - repo := repository{ - domain: named.Domain(), - path: named.Path(), - } - - if repo.domain == defaultDomain { - repo.domain = "" - // Handle official repositories which have the pattern "library/" - if split := strings.Split(repo.path, "/"); len(split) == 2 && split[0] == officialRepoName { - repo.path = split[1] - } - } - return repo -} - -func (r reference) Familiar() Named { - return reference{ - namedRepository: familiarizeName(r.namedRepository), - tag: r.tag, - digest: r.digest, - } -} - -func (r repository) Familiar() Named { - return familiarizeName(r) -} - -func (t taggedReference) Familiar() Named { - return taggedReference{ - namedRepository: familiarizeName(t.namedRepository), - tag: t.tag, - } -} - -func (c canonicalReference) Familiar() Named { - return canonicalReference{ - namedRepository: familiarizeName(c.namedRepository), - digest: c.digest, - } -} - -// TagNameOnly adds the default tag "latest" to a reference if it only has -// a repo name. -func TagNameOnly(ref Named) Named { - if IsNameOnly(ref) { - namedTagged, err := WithTag(ref, defaultTag) - if err != nil { - // Default tag must be valid, to create a NamedTagged - // type with non-validated input the WithTag function - // should be used instead - panic(err) - } - return namedTagged - } - return ref -} - -// ParseAnyReference parses a reference string as a possible identifier, -// full digest, or familiar name. -func ParseAnyReference(ref string) (Reference, error) { - if ok := anchoredIdentifierRegexp.MatchString(ref); ok { - return digestReference("sha256:" + ref), nil - } - if dgst, err := digest.Parse(ref); err == nil { - return digestReference(dgst), nil - } - - return ParseNormalizedNamed(ref) -} - -// ParseAnyReferenceWithSet parses a reference string as a possible short -// identifier to be matched in a digest set, a full digest, or familiar name. -func ParseAnyReferenceWithSet(ref string, ds *digestset.Set) (Reference, error) { - if ok := anchoredShortIdentifierRegexp.MatchString(ref); ok { - dgst, err := ds.Lookup(ref) - if err == nil { - return digestReference(dgst), nil - } - } else { - if dgst, err := digest.Parse(ref); err == nil { - return digestReference(dgst), nil - } - } - - return ParseNormalizedNamed(ref) -} diff --git a/vendor/github.com/docker/distribution/reference/reference.go b/vendor/github.com/docker/distribution/reference/reference.go deleted file mode 100644 index 2f66cca8..00000000 --- a/vendor/github.com/docker/distribution/reference/reference.go +++ /dev/null @@ -1,433 +0,0 @@ -// Package reference provides a general type to represent any way of referencing images within the registry. -// Its main purpose is to abstract tags and digests (content-addressable hash). -// -// Grammar -// -// reference := name [ ":" tag ] [ "@" digest ] -// name := [domain '/'] path-component ['/' path-component]* -// domain := domain-component ['.' domain-component]* [':' port-number] -// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ -// port-number := /[0-9]+/ -// path-component := alpha-numeric [separator alpha-numeric]* -// alpha-numeric := /[a-z0-9]+/ -// separator := /[_.]|__|[-]*/ -// -// tag := /[\w][\w.-]{0,127}/ -// -// digest := digest-algorithm ":" digest-hex -// digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* -// digest-algorithm-separator := /[+.-_]/ -// digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ -// digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value -// -// identifier := /[a-f0-9]{64}/ -// short-identifier := /[a-f0-9]{6,64}/ -package reference - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // NameTotalLengthMax is the maximum total number of characters in a repository name. - NameTotalLengthMax = 255 -) - -var ( - // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. - ErrReferenceInvalidFormat = errors.New("invalid reference format") - - // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. - ErrTagInvalidFormat = errors.New("invalid tag format") - - // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. - ErrDigestInvalidFormat = errors.New("invalid digest format") - - // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. - ErrNameContainsUppercase = errors.New("repository name must be lowercase") - - // ErrNameEmpty is returned for empty, invalid repository names. - ErrNameEmpty = errors.New("repository name must have at least one component") - - // ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax. - ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) - - // ErrNameNotCanonical is returned when a name is not canonical. - ErrNameNotCanonical = errors.New("repository name must be canonical") -) - -// Reference is an opaque object reference identifier that may include -// modifiers such as a hostname, name, tag, and digest. -type Reference interface { - // String returns the full reference - String() string -} - -// Field provides a wrapper type for resolving correct reference types when -// working with encoding. -type Field struct { - reference Reference -} - -// AsField wraps a reference in a Field for encoding. -func AsField(reference Reference) Field { - return Field{reference} -} - -// Reference unwraps the reference type from the field to -// return the Reference object. This object should be -// of the appropriate type to further check for different -// reference types. -func (f Field) Reference() Reference { - return f.reference -} - -// MarshalText serializes the field to byte text which -// is the string of the reference. -func (f Field) MarshalText() (p []byte, err error) { - return []byte(f.reference.String()), nil -} - -// UnmarshalText parses text bytes by invoking the -// reference parser to ensure the appropriately -// typed reference object is wrapped by field. -func (f *Field) UnmarshalText(p []byte) error { - r, err := Parse(string(p)) - if err != nil { - return err - } - - f.reference = r - return nil -} - -// Named is an object with a full name -type Named interface { - Reference - Name() string -} - -// Tagged is an object which has a tag -type Tagged interface { - Reference - Tag() string -} - -// NamedTagged is an object including a name and tag. -type NamedTagged interface { - Named - Tag() string -} - -// Digested is an object which has a digest -// in which it can be referenced by -type Digested interface { - Reference - Digest() digest.Digest -} - -// Canonical reference is an object with a fully unique -// name including a name with domain and digest -type Canonical interface { - Named - Digest() digest.Digest -} - -// namedRepository is a reference to a repository with a name. -// A namedRepository has both domain and path components. -type namedRepository interface { - Named - Domain() string - Path() string -} - -// Domain returns the domain part of the Named reference -func Domain(named Named) string { - if r, ok := named.(namedRepository); ok { - return r.Domain() - } - domain, _ := splitDomain(named.Name()) - return domain -} - -// Path returns the name without the domain part of the Named reference -func Path(named Named) (name string) { - if r, ok := named.(namedRepository); ok { - return r.Path() - } - _, path := splitDomain(named.Name()) - return path -} - -func splitDomain(name string) (string, string) { - match := anchoredNameRegexp.FindStringSubmatch(name) - if len(match) != 3 { - return "", name - } - return match[1], match[2] -} - -// SplitHostname splits a named reference into a -// hostname and name string. If no valid hostname is -// found, the hostname is empty and the full value -// is returned as name -// DEPRECATED: Use Domain or Path -func SplitHostname(named Named) (string, string) { - if r, ok := named.(namedRepository); ok { - return r.Domain(), r.Path() - } - return splitDomain(named.Name()) -} - -// Parse parses s and returns a syntactically valid Reference. -// If an error was encountered it is returned, along with a nil Reference. -// NOTE: Parse will not handle short digests. -func Parse(s string) (Reference, error) { - matches := ReferenceRegexp.FindStringSubmatch(s) - if matches == nil { - if s == "" { - return nil, ErrNameEmpty - } - if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { - return nil, ErrNameContainsUppercase - } - return nil, ErrReferenceInvalidFormat - } - - if len(matches[1]) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - var repo repository - - nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) - if nameMatch != nil && len(nameMatch) == 3 { - repo.domain = nameMatch[1] - repo.path = nameMatch[2] - } else { - repo.domain = "" - repo.path = matches[1] - } - - ref := reference{ - namedRepository: repo, - tag: matches[2], - } - if matches[3] != "" { - var err error - ref.digest, err = digest.Parse(matches[3]) - if err != nil { - return nil, err - } - } - - r := getBestReferenceType(ref) - if r == nil { - return nil, ErrNameEmpty - } - - return r, nil -} - -// ParseNamed parses s and returns a syntactically valid reference implementing -// the Named interface. The reference must have a name and be in the canonical -// form, otherwise an error is returned. -// If an error was encountered it is returned, along with a nil Reference. -// NOTE: ParseNamed will not handle short digests. -func ParseNamed(s string) (Named, error) { - named, err := ParseNormalizedNamed(s) - if err != nil { - return nil, err - } - if named.String() != s { - return nil, ErrNameNotCanonical - } - return named, nil -} - -// WithName returns a named object representing the given string. If the input -// is invalid ErrReferenceInvalidFormat will be returned. -func WithName(name string) (Named, error) { - if len(name) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - match := anchoredNameRegexp.FindStringSubmatch(name) - if match == nil || len(match) != 3 { - return nil, ErrReferenceInvalidFormat - } - return repository{ - domain: match[1], - path: match[2], - }, nil -} - -// WithTag combines the name from "name" and the tag from "tag" to form a -// reference incorporating both the name and the tag. -func WithTag(name Named, tag string) (NamedTagged, error) { - if !anchoredTagRegexp.MatchString(tag) { - return nil, ErrTagInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if canonical, ok := name.(Canonical); ok { - return reference{ - namedRepository: repo, - tag: tag, - digest: canonical.Digest(), - }, nil - } - return taggedReference{ - namedRepository: repo, - tag: tag, - }, nil -} - -// WithDigest combines the name from "name" and the digest from "digest" to form -// a reference incorporating both the name and the digest. -func WithDigest(name Named, digest digest.Digest) (Canonical, error) { - if !anchoredDigestRegexp.MatchString(digest.String()) { - return nil, ErrDigestInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if tagged, ok := name.(Tagged); ok { - return reference{ - namedRepository: repo, - tag: tagged.Tag(), - digest: digest, - }, nil - } - return canonicalReference{ - namedRepository: repo, - digest: digest, - }, nil -} - -// TrimNamed removes any tag or digest from the named reference. -func TrimNamed(ref Named) Named { - domain, path := SplitHostname(ref) - return repository{ - domain: domain, - path: path, - } -} - -func getBestReferenceType(ref reference) Reference { - if ref.Name() == "" { - // Allow digest only references - if ref.digest != "" { - return digestReference(ref.digest) - } - return nil - } - if ref.tag == "" { - if ref.digest != "" { - return canonicalReference{ - namedRepository: ref.namedRepository, - digest: ref.digest, - } - } - return ref.namedRepository - } - if ref.digest == "" { - return taggedReference{ - namedRepository: ref.namedRepository, - tag: ref.tag, - } - } - - return ref -} - -type reference struct { - namedRepository - tag string - digest digest.Digest -} - -func (r reference) String() string { - return r.Name() + ":" + r.tag + "@" + r.digest.String() -} - -func (r reference) Tag() string { - return r.tag -} - -func (r reference) Digest() digest.Digest { - return r.digest -} - -type repository struct { - domain string - path string -} - -func (r repository) String() string { - return r.Name() -} - -func (r repository) Name() string { - if r.domain == "" { - return r.path - } - return r.domain + "/" + r.path -} - -func (r repository) Domain() string { - return r.domain -} - -func (r repository) Path() string { - return r.path -} - -type digestReference digest.Digest - -func (d digestReference) String() string { - return digest.Digest(d).String() -} - -func (d digestReference) Digest() digest.Digest { - return digest.Digest(d) -} - -type taggedReference struct { - namedRepository - tag string -} - -func (t taggedReference) String() string { - return t.Name() + ":" + t.tag -} - -func (t taggedReference) Tag() string { - return t.tag -} - -type canonicalReference struct { - namedRepository - digest digest.Digest -} - -func (c canonicalReference) String() string { - return c.Name() + "@" + c.digest.String() -} - -func (c canonicalReference) Digest() digest.Digest { - return c.digest -} diff --git a/vendor/github.com/docker/distribution/reference/regexp.go b/vendor/github.com/docker/distribution/reference/regexp.go deleted file mode 100644 index 78603493..00000000 --- a/vendor/github.com/docker/distribution/reference/regexp.go +++ /dev/null @@ -1,143 +0,0 @@ -package reference - -import "regexp" - -var ( - // alphaNumericRegexp defines the alpha numeric atom, typically a - // component of names. This only allows lower case characters and digits. - alphaNumericRegexp = match(`[a-z0-9]+`) - - // separatorRegexp defines the separators allowed to be embedded in name - // components. This allow one period, one or two underscore and multiple - // dashes. - separatorRegexp = match(`(?:[._]|__|[-]*)`) - - // nameComponentRegexp restricts registry path component names to start - // with at least one letter or number, with following parts able to be - // separated by one period, one or two underscore and multiple dashes. - nameComponentRegexp = expression( - alphaNumericRegexp, - optional(repeated(separatorRegexp, alphaNumericRegexp))) - - // domainComponentRegexp restricts the registry domain component of a - // repository name to start with a component as defined by DomainRegexp - // and followed by an optional port. - domainComponentRegexp = match(`(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])`) - - // DomainRegexp defines the structure of potential domain components - // that may be part of image names. This is purposely a subset of what is - // allowed by DNS to ensure backwards compatibility with Docker image - // names. - DomainRegexp = expression( - domainComponentRegexp, - optional(repeated(literal(`.`), domainComponentRegexp)), - optional(literal(`:`), match(`[0-9]+`))) - - // TagRegexp matches valid tag names. From docker/docker:graph/tags.go. - TagRegexp = match(`[\w][\w.-]{0,127}`) - - // anchoredTagRegexp matches valid tag names, anchored at the start and - // end of the matched string. - anchoredTagRegexp = anchored(TagRegexp) - - // DigestRegexp matches valid digests. - DigestRegexp = match(`[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}`) - - // anchoredDigestRegexp matches valid digests, anchored at the start and - // end of the matched string. - anchoredDigestRegexp = anchored(DigestRegexp) - - // NameRegexp is the format for the name component of references. The - // regexp has capturing groups for the domain and name part omitting - // the separating forward slash from either. - NameRegexp = expression( - optional(DomainRegexp, literal(`/`)), - nameComponentRegexp, - optional(repeated(literal(`/`), nameComponentRegexp))) - - // anchoredNameRegexp is used to parse a name value, capturing the - // domain and trailing components. - anchoredNameRegexp = anchored( - optional(capture(DomainRegexp), literal(`/`)), - capture(nameComponentRegexp, - optional(repeated(literal(`/`), nameComponentRegexp)))) - - // ReferenceRegexp is the full supported format of a reference. The regexp - // is anchored and has capturing groups for name, tag, and digest - // components. - ReferenceRegexp = anchored(capture(NameRegexp), - optional(literal(":"), capture(TagRegexp)), - optional(literal("@"), capture(DigestRegexp))) - - // IdentifierRegexp is the format for string identifier used as a - // content addressable identifier using sha256. These identifiers - // are like digests without the algorithm, since sha256 is used. - IdentifierRegexp = match(`([a-f0-9]{64})`) - - // ShortIdentifierRegexp is the format used to represent a prefix - // of an identifier. A prefix may be used to match a sha256 identifier - // within a list of trusted identifiers. - ShortIdentifierRegexp = match(`([a-f0-9]{6,64})`) - - // anchoredIdentifierRegexp is used to check or match an - // identifier value, anchored at start and end of string. - anchoredIdentifierRegexp = anchored(IdentifierRegexp) - - // anchoredShortIdentifierRegexp is used to check if a value - // is a possible identifier prefix, anchored at start and end - // of string. - anchoredShortIdentifierRegexp = anchored(ShortIdentifierRegexp) -) - -// match compiles the string to a regular expression. -var match = regexp.MustCompile - -// literal compiles s into a literal regular expression, escaping any regexp -// reserved characters. -func literal(s string) *regexp.Regexp { - re := match(regexp.QuoteMeta(s)) - - if _, complete := re.LiteralPrefix(); !complete { - panic("must be a literal") - } - - return re -} - -// expression defines a full expression, where each regular expression must -// follow the previous. -func expression(res ...*regexp.Regexp) *regexp.Regexp { - var s string - for _, re := range res { - s += re.String() - } - - return match(s) -} - -// optional wraps the expression in a non-capturing group and makes the -// production optional. -func optional(res ...*regexp.Regexp) *regexp.Regexp { - return match(group(expression(res...)).String() + `?`) -} - -// repeated wraps the regexp in a non-capturing group to get one or more -// matches. -func repeated(res ...*regexp.Regexp) *regexp.Regexp { - return match(group(expression(res...)).String() + `+`) -} - -// group wraps the regexp in a non-capturing group. -func group(res ...*regexp.Regexp) *regexp.Regexp { - return match(`(?:` + expression(res...).String() + `)`) -} - -// capture wraps the expression in a capturing group. -func capture(res ...*regexp.Regexp) *regexp.Regexp { - return match(`(` + expression(res...).String() + `)`) -} - -// anchored anchors the regular expression by adding start and end delimiters. -func anchored(res ...*regexp.Regexp) *regexp.Regexp { - return match(`^` + expression(res...).String() + `$`) -} diff --git a/vendor/github.com/docker/docker/AUTHORS b/vendor/github.com/docker/docker/AUTHORS deleted file mode 100644 index 246e2a33..00000000 --- a/vendor/github.com/docker/docker/AUTHORS +++ /dev/null @@ -1,1652 +0,0 @@ -# This file lists all individuals having contributed content to the repository. -# For how it is generated, see `hack/generate-authors.sh`. - -Aanand Prasad -Aaron Davidson -Aaron Feng -Aaron Huslage -Aaron Lehmann -Aaron Welch -Abel Muiño -Abhijeet Kasurde -Abhinav Ajgaonkar -Abhishek Chanda -Abin Shahab -Adam Avilla -Adam Kunk -Adam Miller -Adam Mills -Adam Singer -Adam Walz -Aditi Rajagopal -Aditya -Adolfo Ochagavía -Adria Casas -Adrian Moisey -Adrian Mouat -Adrian Oprea -Adrien Folie -Adrien Gallouët -Ahmed Kamal -Ahmet Alp Balkan -Aidan Feldman -Aidan Hobson Sayers -AJ Bowen -Ajey Charantimath -ajneu -Akihiro Suda -Al Tobey -alambike -Alan Scherger -Alan Thompson -Albert Callarisa -Albert Zhang -Aleksa Sarai -Aleksandrs Fadins -Alena Prokharchyk -Alessandro Boch -Alessio Biancalana -Alex Chan -Alex Coventry -Alex Crawford -Alex Ellis -Alex Gaynor -Alex Olshansky -Alex Samorukov -Alex Warhawk -Alexander Artemenko -Alexander Boyd -Alexander Larsson -Alexander Morozov -Alexander Shopov -Alexandre Beslic -Alexandre González -Alexandru Sfirlogea -Alexey Guskov -Alexey Kotlyarov -Alexey Shamrin -Alexis THOMAS -Ali Dehghani -Allen Madsen -Allen Sun -almoehi -Alvaro Saurin -Alvin Richards -amangoel -Amen Belayneh -Amit Bakshi -Amit Krishnan -Amit Shukla -Amy Lindburg -Anand Patil -AnandkumarPatel -Anatoly Borodin -Anchal Agrawal -Anders Janmyr -Andre Dublin <81dublin@gmail.com> -Andre Granovsky -Andrea Luzzardi -Andrea Turli -Andreas Köhler -Andreas Savvides -Andreas Tiefenthaler -Andrei Gherzan -Andrew C. Bodine -Andrew Clay Shafer -Andrew Duckworth -Andrew France -Andrew Gerrand -Andrew Guenther -Andrew Kuklewicz -Andrew Macgregor -Andrew Macpherson -Andrew Martin -Andrew Munsell -Andrew Po -Andrew Weiss -Andrew Williams -Andrews Medina -Andrey Petrov -Andrey Stolbovsky -André Martins -andy -Andy Chambers -andy diller -Andy Goldstein -Andy Kipp -Andy Rothfusz -Andy Smith -Andy Wilson -Anes Hasicic -Anil Belur -Anil Madhavapeddy -Ankush Agarwal -Anonmily -Anthon van der Neut -Anthony Baire -Anthony Bishopric -Anthony Dahanne -Anton Löfgren -Anton Nikitin -Anton Polonskiy -Anton Tiurin -Antonio Murdaca -Antonis Kalipetis -Antony Messerli -Anuj Bahuguna -Anusha Ragunathan -apocas -ArikaChen -Arnaud Lefebvre -Arnaud Porterie -Arthur Barr -Arthur Gautier -Artur Meyster -Arun Gupta -Asbjørn Enge -averagehuman -Avi Das -Avi Miller -Avi Vaid -ayoshitake -Azat Khuyiyakhmetov -Bardia Keyoumarsi -Barnaby Gray -Barry Allard -Bartłomiej Piotrowski -Bastiaan Bakker -bdevloed -Ben Firshman -Ben Golub -Ben Hall -Ben Sargent -Ben Severson -Ben Toews -Ben Wiklund -Benjamin Atkin -Benoit Chesneau -Bernerd Schaefer -Bert Goethals -Bharath Thiruveedula -Bhiraj Butala -Bilal Amarni -Bill W -bin liu -Blake Geno -Boaz Shuster -bobby abbott -boucher -Bouke Haarsma -Boyd Hemphill -boynux -Bradley Cicenas -Bradley Wright -Brandon Liu -Brandon Philips -Brandon Rhodes -Brendan Dixon -Brent Salisbury -Brett Higgins -Brett Kochendorfer -Brian (bex) Exelbierd -Brian Bland -Brian DeHamer -Brian Dorsey -Brian Flad -Brian Goff -Brian McCallister -Brian Olsen -Brian Shumate -Brian Torres-Gil -Brian Trump -Brice Jaglin -Briehan Lombaard -Bruno Bigras -Bruno Binet -Bruno Gazzera -Bruno Renié -Bryan Bess -Bryan Boreham -Bryan Matsuo -Bryan Murphy -buddhamagnet -Burke Libbey -Byung Kang -Caleb Spare -Calen Pennington -Cameron Boehmer -Cameron Spear -Campbell Allen -Candid Dauth -Cao Weiwei -Carl Henrik Lunde -Carl Loa Odin -Carl X. Su -Carlos Alexandro Becker -Carlos Sanchez -Carol Fager-Higgins -Cary -Casey Bisson -Cedric Davies -Cezar Sa Espinola -Chad Swenson -Chance Zibolski -Chander G -Charles Chan -Charles Hooper -Charles Law -Charles Lindsay -Charles Merriam -Charles Sarrazin -Charles Smith -Charlie Lewis -Chase Bolt -ChaYoung You -Chen Chao -Chen Hanxiao -cheney90 -Chewey -Chia-liang Kao -chli -Cholerae Hu -Chris Alfonso -Chris Armstrong -Chris Dituri -Chris Fordham -Chris Khoo -Chris McKinnel -Chris Seto -Chris Snow -Chris St. Pierre -Chris Stivers -Chris Swan -Chris Wahl -Chris Weyl -chrismckinnel -Christian Berendt -Christian Böhme -Christian Persson -Christian Rotzoll -Christian Simon -Christian Stefanescu -ChristoperBiscardi -Christophe Mehay -Christophe Troestler -Christopher Currie -Christopher Jones -Christopher Latham -Christopher Rigor -Christy Perez -Chun Chen -Ciro S. Costa -Clayton Coleman -Clinton Kitson -Coenraad Loubser -Colin Dunklau -Colin Rice -Colin Walters -Collin Guarino -Colm Hally -companycy -Cory Forsyth -cressie176 -CrimsonGlory -Cristian Staretu -cristiano balducci -Cruceru Calin-Cristian -Cyril F -Daan van Berkel -Daehyeok Mun -Dafydd Crosby -dalanlan -Damian Smyth -Damien Nadé -Damien Nozay -Damjan Georgievski -Dan Anolik -Dan Buch -Dan Cotora -Dan Feldman -Dan Griffin -Dan Hirsch -Dan Keder -Dan Levy -Dan McPherson -Dan Stine -Dan Walsh -Dan Williams -Daniel Antlinger -Daniel Exner -Daniel Farrell -Daniel Garcia -Daniel Gasienica -Daniel Hiltgen -Daniel Menet -Daniel Mizyrycki -Daniel Nephin -Daniel Norberg -Daniel Nordberg -Daniel Robinson -Daniel S -Daniel Von Fange -Daniel X Moore -Daniel YC Lin -Daniel Zhang -Daniel, Dao Quang Minh -Danny Berger -Danny Yates -Darren Coxall -Darren Shepherd -Darren Stahl -Davanum Srinivas -Dave Barboza -Dave Henderson -Dave MacDonald -Dave Tucker -David Anderson -David Calavera -David Corking -David Cramer -David Currie -David Davis -David Dooling -David Gageot -David Gebler -David Lawrence -David Lechner -David M. Karr -David Mackey -David Mat -David Mcanulty -David Pelaez -David R. Jenni -David Röthlisberger -David Sheets -David Sissitka -David Trott -David Xia -David Young -Davide Ceretti -Dawn Chen -dbdd -dcylabs -decadent -deed02392 -Deng Guangxing -Deni Bertovic -Denis Gladkikh -Denis Ollier -Dennis Docter -Derek -Derek -Derek Ch -Derek McGowan -Deric Crago -Deshi Xiao -devmeyster -Devvyn Murphy -Dharmit Shah -Dieter Reuter -Dillon Dixon -Dima Stopel -Dimitri John Ledkov -Dimitris Rozakis -Dimitry Andric -Dinesh Subhraveti -Diogo Monica -DiuDiugirl -Djibril Koné -dkumor -Dmitri Logvinenko -Dmitri Shuralyov -Dmitry Demeshchuk -Dmitry Gusev -Dmitry Smirnov -Dmitry V. Krivenok -Dmitry Vorobev -Dolph Mathews -Dominik Finkbeiner -Dominik Honnef -Don Kirkby -Don Kjer -Don Spaulding -Donald Huang -Dong Chen -Donovan Jones -Doron Podoleanu -Doug Davis -Doug MacEachern -Doug Tangren -Dr Nic Williams -dragon788 -Dražen Lučanin -Drew Erny -Dustin Sallings -Ed Costello -Edmund Wagner -Eiichi Tsukata -Eike Herzbach -Eivin Giske Skaaren -Eivind Uggedal -Elan Ruusamäe -Elias Probst -Elijah Zupancic -eluck -Elvir Kuric -Emil Hernvall -Emily Maier -Emily Rose -Emir Ozer -Enguerran -Eohyung Lee -Eric Barch -Eric Hanchrow -Eric Lee -Eric Myhre -Eric Paris -Eric Rafaloff -Eric Rosenberg -Eric Sage -Eric Windisch -Eric Yang -Eric-Olivier Lamey -Erik Bray -Erik Dubbelboer -Erik Hollensbe -Erik Inge Bolsø -Erik Kristensen -Erik Weathers -Erno Hopearuoho -Erwin van der Koogh -Euan -Eugene Yakubovich -eugenkrizo -evalle -Evan Allrich -Evan Carmi -Evan Hazlett -Evan Krall -Evan Phoenix -Evan Wies -Everett Toews -Evgeny Vereshchagin -Ewa Czechowska -Eystein Måløy Stenberg -ezbercih -Fabiano Rosas -Fabio Falci -Fabio Rapposelli -Fabio Rehm -Fabrizio Regini -Fabrizio Soppelsa -Faiz Khan -falmp -Fangyuan Gao <21551127@zju.edu.cn> -Fareed Dudhia -Fathi Boudra -Federico Gimenez -Felix Geisendörfer -Felix Hupfeld -Felix Rabe -Felix Ruess -Felix Schindler -Ferenc Szabo -Fernando -Fero Volar -Ferran Rodenas -Filipe Brandenburger -Filipe Oliveira -fl0yd -Flavio Castelli -FLGMwt -Florian -Florian Klein -Florian Maier -Florian Weingarten -Florin Asavoaie -fonglh -fortinux -Francesc Campoy -Francis Chuang -Francisco Carriedo -Francisco Souza -Frank Groeneveld -Frank Herrmann -Frank Macreery -Frank Rosquin -Fred Lifton -Frederick F. Kautz IV -Frederik Loeffert -Frederik Nordahl Jul Sabroe -Freek Kalter -frosforever -fy2462 -Félix Baylac-Jacqué -Félix Cantournet -Gabe Rosenhouse -Gabor Nagy -Gabriel Monroy -GabrielNicolasAvellaneda -Galen Sampson -Gareth Rushgrove -Garrett Barboza -Gaurav -gautam, prasanna -GennadySpb -Geoffrey Bachelet -George MacRorie -George Xie -Georgi Hristozov -Gereon Frey -German DZ -Gert van Valkenhoef -Gianluca Borello -Gildas Cuisinier -gissehel -Giuseppe Mazzotta -Gleb Fotengauer-Malinovskiy -Gleb M Borisov -Glyn Normington -GoBella -Goffert van Gool -Gosuke Miyashita -Gou Rao -Govinda Fichtner -Grant Reaber -Graydon Hoare -Greg Fausak -Greg Thornton -grossws -grunny -gs11 -Guilhem Lettron -Guilherme Salgado -Guillaume Dufour -Guillaume J. Charmes -guoxiuyan -Gurjeet Singh -Guruprasad -gwx296173 -Günter Zöchbauer -Hans Kristian Flaatten -Hans Rødtang -Hao Shu Wei -Hao Zhang <21521210@zju.edu.cn> -Harald Albers -Harley Laue -Harold Cooper -Harry Zhang -He Simei -heartlock <21521209@zju.edu.cn> -Hector Castro -Henning Sprang -Hobofan -Hollie Teal -Hong Xu -hsinko <21551195@zju.edu.cn> -Hu Keping -Hu Tao -Huanzhong Zhang -Huayi Zhang -Hugo Duncan -Hugo Marisco <0x6875676f@gmail.com> -Hunter Blanks -huqun -Huu Nguyen -hyeongkyu.lee -hyp3rdino -Hyzhou <1187766782@qq.com> -Ian Babrou -Ian Bishop -Ian Bull -Ian Calvert -Ian Lee -Ian Main -Ian Truslove -Iavael -Icaro Seara -Igor Dolzhikov -Ilkka Laukkanen -Ilya Dmitrichenko -Ilya Gusev -ILYA Khlopotov -imre Fitos -inglesp -Ingo Gottwald -Isaac Dupree -Isabel Jimenez -Isao Jonas -Ivan Babrou -Ivan Fraixedes -Ivan Grcic -J Bruni -J. Nunn -Jack Danger Canty -Jacob Atzen -Jacob Edelman -Jake Champlin -Jake Moshenko -jakedt -James Allen -James Carey -James Carr -James DeFelice -James Harrison Fisher -James Kyburz -James Kyle -James Lal -James Mills -James Nugent -James Turnbull -Jamie Hannaford -Jamshid Afshar -Jan Keromnes -Jan Koprowski -Jan Pazdziora -Jan Toebes -Jan-Gerd Tenberge -Jan-Jaap Driessen -Jana Radhakrishnan -Jannick Fahlbusch -Januar Wayong -Jared Biel -Jared Hocutt -Jaroslaw Zabiello -jaseg -Jasmine Hegman -Jason Divock -Jason Giedymin -Jason Green -Jason Hall -Jason Heiss -Jason Livesay -Jason McVetta -Jason Plum -Jason Shepherd -Jason Smith -Jason Sommer -Jason Stangroome -jaxgeller -Jay -Jay -Jay Kamat -Jean-Baptiste Barth -Jean-Baptiste Dalido -Jean-Paul Calderone -Jean-Tiare Le Bigot -Jeff Anderson -Jeff Johnston -Jeff Lindsay -Jeff Mickey -Jeff Minard -Jeff Nickoloff -Jeff Silberman -Jeff Welch -Jeffrey Bolle -Jeffrey Morgan -Jeffrey van Gogh -Jenny Gebske -Jeremy Grosser -Jeremy Price -Jeremy Qian -Jeremy Unruh -Jeroen Jacobs -Jesse Dearing -Jesse Dubay -Jessica Frazelle -Jezeniel Zapanta -jgeiger -Jhon Honce -Ji.Zhilong -Jian Zhang -jianbosun -Jilles Oldenbeuving -Jim Alateras -Jim Perrin -Jimmy Cuadra -Jimmy Puckett -jimmyxian -Jinsoo Park -Jiri Popelka -Jiří Župka -jjy -jmzwcn -Joao Fernandes -Joe Beda -Joe Doliner -Joe Ferguson -Joe Gordon -Joe Shaw -Joe Van Dyk -Joel Friedly -Joel Handwell -Joel Hansson -Joel Wurtz -Joey Geiger -Joey Gibson -Joffrey F -Johan Euphrosine -Johan Rydberg -Johanan Lieberman -Johannes 'fish' Ziemke -John Costa -John Feminella -John Gardiner Myers -John Gossman -John Howard (VM) -John OBrien III -John Starks -John Tims -John Warwick -John Willis -johnharris85 -Jon Wedaman -Jonas Pfenniger -Jonathan A. Sternberg -Jonathan Boulle -Jonathan Camp -Jonathan Dowland -Jonathan Lebon -Jonathan Lomas -Jonathan McCrohan -Jonathan Mueller -Jonathan Pares -Jonathan Rudenberg -Jonathan Stoppani -Joost Cassee -Jordan -Jordan Arentsen -Jordan Sissel -Jose Diaz-Gonzalez -Joseph Anthony Pasquale Holsten -Joseph Hager -Joseph Kern -Josh -Josh Bodah -Josh Chorlton -Josh Hawn -Josh Horwitz -Josh Poimboeuf -Josiah Kiehl -José Tomás Albornoz -JP -jrabbit -Julian Taylor -Julien Barbier -Julien Bisconti -Julien Bordellier -Julien Dubois -Julien Pervillé -Julio Montes -Jun-Ru Chang -Jussi Nummelin -Justas Brazauskas -Justin Cormack -Justin Force -Justin Plock -Justin Simonelis -Justin Terry -Justyn Temme -Jyrki Puttonen -Jérôme Petazzoni -Jörg Thalheim -Kai Blin -Kai Qiang Wu(Kennan) -Kamil Domański -kamjar gerami -Kanstantsin Shautsou -Kara Alexandra -Karan Lyons -Kareem Khazem -kargakis -Karl Grzeszczak -Karol Duleba -Katie McLaughlin -Kato Kazuyoshi -Katrina Owen -Kawsar Saiyeed -kayrus -Ke Xu -Keith Hudgins -Keli Hu -Ken Cochrane -Ken Herner -Ken ICHIKAWA -Kenfe-Mickaël Laventure -Kenjiro Nakayama -Kent Johnson -Kevin "qwazerty" Houdebert -Kevin Burke -Kevin Clark -Kevin J. Lynagh -Kevin Jing Qiu -Kevin Menard -Kevin P. Kucharczyk -Kevin Richardson -Kevin Shi -Kevin Wallace -Kevin Yap -kevinmeredith -Keyvan Fatehi -kies -Kim BKC Carlbacker -Kim Eik -Kimbro Staken -Kir Kolyshkin -Kiran Gangadharan -Kirill Kolyshkin -Kirill SIbirev -knappe -Kohei Tsuruta -Koichi Shiraishi -Konrad Kleine -Konstantin L -Konstantin Pelykh -Krasimir Georgiev -Kris-Mikael Krister -Kristian Haugene -Kristina Zabunova -krrg -Kun Zhang -Kunal Kushwaha -Kyle Conroy -Kyle Linden -kyu -Lachlan Coote -Lai Jiangshan -Lajos Papp -Lakshan Perera -Lalatendu Mohanty -lalyos -Lance Chen -Lance Kinley -Lars Butler -Lars Kellogg-Stedman -Lars R. Damerow -Laszlo Meszaros -Laurent Erignoux -Laurie Voss -Leandro Siqueira -Lee Chao <932819864@qq.com> -Lee, Meng-Han -leeplay -Lei Jitang -Len Weincier -Lennie -Leszek Kowalski -Levi Blackstone -Levi Gross -Lewis Marshall -Lewis Peckover -Liam Macgillavry -Liana Lo -Liang Mingqiang -Liang-Chi Hsieh -liaoqingwei -limsy -Lin Lu -LingFaKe -Linus Heckemann -Liran Tal -Liron Levin -Liu Bo -Liu Hua -lixiaobing10051267 -LIZAO LI -Lloyd Dewolf -Lokesh Mandvekar -longliqiang88 <394564827@qq.com> -Lorenz Leutgeb -Lorenzo Fontana -Louis Opter -Luca Marturana -Luca Orlandi -Luca-Bogdan Grigorescu -Lucas Chan -Lucas Chi -Luciano Mores -Luis Martínez de Bartolomé Izquierdo -Lukas Waslowski -lukaspustina -Lukasz Zajaczkowski -lukemarsden -Lynda O'Leary -Lénaïc Huard -Ma Shimiao -Mabin -Madhav Puri -Madhu Venugopal -Mageee <21521230.zju.edu.cn> -Mahesh Tiyyagura -malnick -Malte Janduda -manchoz -Manfred Touron -Manfred Zabarauskas -Mansi Nahar -mansinahar -Manuel Meurer -Manuel Woelker -mapk0y -Marc Abramowitz -Marc Kuo -Marc Tamsky -Marcelo Salazar -Marco Hennings -Marcus Farkas -Marcus Linke -Marcus Ramberg -Marek Goldmann -Marian Marinov -Marianna Tessel -Mario Loriedo -Marius Gundersen -Marius Sturm -Marius Voila -Mark Allen -Mark McGranaghan -Mark McKinstry -Mark West -Marko Mikulicic -Marko Tibold -Markus Fix -Martijn Dwars -Martijn van Oosterhout -Martin Honermeyer -Martin Kelly -Martin Mosegaard Amdisen -Martin Redmond -Mary Anthony -Masahito Zembutsu -Mason Malone -Mateusz Sulima -Mathias Monnerville -Mathieu Le Marec - Pasquet -Matt Apperson -Matt Bachmann -Matt Bentley -Matt Haggard -Matt Hoyle -Matt McCormick -Matt Moore -Matt Richardson -Matt Robenolt -Matthew Heon -Matthew Mayer -Matthew Mueller -Matthew Riley -Matthias Klumpp -Matthias Kühnle -Matthias Rampke -Matthieu Hauglustaine -mattymo -mattyw -Mauricio Garavaglia -mauriyouth -Max Shytikov -Maxim Fedchyshyn -Maxim Ivanov -Maxim Kulkin -Maxim Treskin -Maxime Petazzoni -Meaglith Ma -meejah -Megan Kostick -Mehul Kar -Mei ChunTao -Mengdi Gao -Mert Yazıcıoğlu -mgniu -Micah Zoltu -Michael A. Smith -Michael Bridgen -Michael Brown -Michael Chiang -Michael Crosby -Michael Currie -Michael Friis -Michael Gorsuch -Michael Grauer -Michael Holzheu -Michael Hudson-Doyle -Michael Huettermann -Michael Käufl -Michael Neale -Michael Prokop -Michael Scharf -Michael Stapelberg -Michael Steinert -Michael Thies -Michael West -Michal Fojtik -Michal Gebauer -Michal Jemala -Michal Minar -Michal Wieczorek -Michaël Pailloncy -Michał Czeraszkiewicz -Michiel@unhosted -Mickaël FORTUNATO -Miguel Angel Fernández -Miguel Morales -Mihai Borobocea -Mihuleacc Sergiu -Mike Brown -Mike Chelen -Mike Danese -Mike Dillon -Mike Dougherty -Mike Gaffney -Mike Goelzer -Mike Leone -Mike MacCana -Mike Naberezny -Mike Snitzer -mikelinjie <294893458@qq.com> -Mikhail Sobolev -Miloslav Trmač -mingqing -Mingzhen Feng -Misty Stanley-Jones -Mitch Capper -mlarcher -Mohammad Banikazemi -Mohammed Aaqib Ansari -Mohit Soni -Morgan Bauer -Morgante Pell -Morgy93 -Morten Siebuhr -Morton Fox -Moysés Borges -mqliang -Mrunal Patel -msabansal -mschurenko -muge -Mustafa Akın -Muthukumar R -Máximo Cuadros -Médi-Rémi Hashim -Nahum Shalman -Nakul Pathak -Nalin Dahyabhai -Nan Monnand Deng -Naoki Orii -Natalie Parker -Natanael Copa -Nate Brennand -Nate Eagleson -Nate Jones -Nathan Hsieh -Nathan Kleyn -Nathan LeClaire -Nathan McCauley -Nathan Williams -Neal McBurnett -Neil Peterson -Nelson Chen -Neyazul Haque -Nghia Tran -Niall O'Higgins -Nicholas E. Rabenau -nick -Nick DeCoursin -Nick Irvine -Nick Parker -Nick Payne -Nick Stenning -Nick Stinemates -Nicola Kabar -Nicolas Borboën -Nicolas De loof -Nicolas Dudebout -Nicolas Goy -Nicolas Kaiser -Nicolás Hock Isaza -Nigel Poulton -NikolaMandic -nikolas -Nirmal Mehta -Nishant Totla -NIWA Hideyuki -noducks -Nolan Darilek -nponeccop -Nuutti Kotivuori -nzwsch -O.S. Tezer -objectified -OddBloke -odk- -Oguz Bilgic -Oh Jinkyun -Ohad Schneider -ohmystack -Ole Reifschneider -Oliver Neal -Olivier Gambier -Olle Jonsson -Oriol Francès -orkaa -Oskar Niburski -Otto Kekäläinen -oyld -ozlerhakan -paetling -pandrew -panticz -Paolo G. Giarrusso -Pascal Borreli -Pascal Hartig -Patrick Böänziger -Patrick Devine -Patrick Hemmer -Patrick Stapleton -pattichen -Paul -paul -Paul Annesley -Paul Bellamy -Paul Bowsher -Paul Furtado -Paul Hammond -Paul Jimenez -Paul Lietar -Paul Liljenberg -Paul Morie -Paul Nasrat -Paul Weaver -Paulo Ribeiro -Pavel Lobashov -Pavel Pospisil -Pavel Sutyrin -Pavel Tikhomirov -Pavlos Ratis -Pavol Vargovcik -Peeyush Gupta -Peggy Li -Pei Su -Penghan Wang -perhapszzy@sina.com -pestophagous -Peter Bourgon -Peter Braden -Peter Choi -Peter Dave Hello -Peter Edge -Peter Ericson -Peter Esbensen -Peter Malmgren -Peter Salvatore -Peter Volpe -Peter Waller -Petr Švihlík -Phil -Phil Estes -Phil Spitler -Philip Monroe -Philipp Wahala -Philipp Weissensteiner -Phillip Alexander -pidster -Piergiuliano Bossi -Pierre -Pierre Carrier -Pierre Dal-Pra -Pierre Wacrenier -Pierre-Alain RIVIERE -Piotr Bogdan -pixelistik -Porjo -Poul Kjeldager Sørensen -Pradeep Chhetri -Prasanna Gautam -Prayag Verma -Przemek Hejman -pysqz -qg <1373319223@qq.com> -qhuang -Qiang Huang -qq690388648 <690388648@qq.com> -Quentin Brossard -Quentin Perez -Quentin Tayssier -r0n22 -Rafal Jeczalik -Rafe Colton -Raghavendra K T -Raghuram Devarakonda -Rajat Pandit -Rajdeep Dua -Ralf Sippl -Ralle -Ralph Bean -Ramkumar Ramachandra -Ramon Brooker -Ramon van Alteren -Ray Tsang -ReadmeCritic -Recursive Madman -Regan McCooey -Remi Rampin -Renato Riccieri Santos Zannon -resouer -rgstephens -Rhys Hiltner -Rich Moyse -Rich Seymour -Richard -Richard Burnison -Richard Harvey -Richard Mathie -Richard Metzler -Richard Scothern -Richo Healey -Rick Bradley -Rick van de Loo -Rick Wieman -Rik Nijessen -Riku Voipio -Riley Guerin -Ritesh H Shukla -Riyaz Faizullabhoy -Rob Vesse -Robert Bachmann -Robert Bittle -Robert Obryk -Robert Stern -Robert Terhaar -Robert Wallis -Roberto G. Hashioka -Robin Naundorf -Robin Schneider -Robin Speekenbrink -robpc -Rodolfo Carvalho -Rodrigo Vaz -Roel Van Nyen -Roger Peppe -Rohit Jnagal -Rohit Kadam -Roland Huß -Roland Kammerer -Roland Moriz -Roma Sokolov -Roman Strashkin -Ron Smits -Ron Williams -root -root -root -root -root -Rory Hunter -Rory McCune -Ross Boucher -Rovanion Luckey -Rozhnov Alexandr -rsmoorthy -Rudolph Gottesheim -Rui Lopes -Runshen Zhu -Ryan Anderson -Ryan Aslett -Ryan Belgrave -Ryan Detzel -Ryan Fowler -Ryan McLaughlin -Ryan O'Donnell -Ryan Seto -Ryan Thomas -Ryan Trauntvein -Ryan Wallner -RyanDeng -Rémy Greinhofer -s. rannou -s00318865 -Sabin Basyal -Sachin Joshi -Sagar Hani -Sainath Grandhi -sakeven -Sally O'Malley -Sam Abed -Sam Alba -Sam Bailey -Sam J Sharpe -Sam Neirinck -Sam Reis -Sam Rijs -Sambuddha Basu -Sami Wagiaalla -Samuel Andaya -Samuel Dion-Girardeau -Samuel Karp -Samuel PHAN -Sankar சங்கர் -Sanket Saurav -Santhosh Manohar -sapphiredev -Satnam Singh -satoru -Satoshi Amemiya -Satoshi Tagomori -scaleoutsean -Scott Bessler -Scott Collier -Scott Johnston -Scott Stamp -Scott Walls -sdreyesg -Sean Christopherson -Sean Cronin -Sean OMeara -Sean P. Kane -Sebastiaan van Steenis -Sebastiaan van Stijn -Senthil Kumar Selvaraj -Senthil Kumaran -SeongJae Park -Seongyeol Lim -Serge Hallyn -Sergey Alekseev -Sergey Evstifeev -Serhat Gülçiçek -Sevki Hasirci -Shane Canon -Shane da Silva -shaunol -Shawn Landden -Shawn Siefkas -shawnhe -Shekhar Gulati -Sheng Yang -Shengbo Song -Shev Yan -Shih-Yuan Lee -Shijiang Wei -Shishir Mahajan -Shoubhik Bose -Shourya Sarcar -shuai-z -Shukui Yang -Shuwei Hao -Sian Lerk Lau -sidharthamani -Silas Sewell -Simei He -Simon Eskildsen -Simon Leinen -Simon Taranto -Sindhu S -Sjoerd Langkemper -skaasten -Solganik Alexander -Solomon Hykes -Song Gao -Soshi Katsuta -Soulou -Spencer Brown -Spencer Smith -Sridatta Thatipamala -Sridhar Ratnakumar -Srini Brahmaroutu -srinsriv -Steeve Morin -Stefan Berger -Stefan J. Wernli -Stefan Praszalowicz -Stefan Scherer -Stefan Staudenmeyer -Stefan Weil -Stephen Crosby -Stephen Day -Stephen Drake -Stephen Rust -Steve Durrheimer -Steve Francia -Steve Koch -Steven Burgess -Steven Erenst -Steven Iveson -Steven Merrill -Steven Richards -Steven Taylor -Subhajit Ghosh -Sujith Haridasan -Suryakumar Sudar -Sven Dowideit -Swapnil Daingade -Sylvain Baubeau -Sylvain Bellemare -Sébastien -Sébastien Luttringer -Sébastien Stormacq -Tadej Janež -TAGOMORI Satoshi -tang0th -Tangi COLIN -Tatsuki Sugiura -Tatsushi Inagaki -Taylor Jones -tbonza -Ted M. Young -Tehmasp Chaudhri -Tejesh Mehta -terryding77 <550147740@qq.com> -tgic -Thatcher Peskens -theadactyl -Thell 'Bo' Fowler -Thermionix -Thijs Terlouw -Thomas Bikeev -Thomas Frössman -Thomas Gazagnaire -Thomas Grainger -Thomas Hansen -Thomas Leonard -Thomas LEVEIL -Thomas Orozco -Thomas Riccardi -Thomas Schroeter -Thomas Sjögren -Thomas Swift -Thomas Tanaka -Thomas Texier -Tianon Gravi -Tianyi Wang -Tibor Vass -Tiffany Jernigan -Tiffany Low -Tim Bosse -Tim Dettrick -Tim Düsterhus -Tim Hockin -Tim Ruffles -Tim Smith -Tim Terhorst -Tim Wang -Tim Waugh -Tim Wraight -timfeirg -Timothy Hobbs -tjwebb123 -tobe -Tobias Bieniek -Tobias Bradtke -Tobias Gesellchen -Tobias Klauser -Tobias Munk -Tobias Schmidt -Tobias Schwab -Todd Crane -Todd Lunter -Todd Whiteman -Toli Kuznets -Tom Barlow -Tom Denham -Tom Fotherby -Tom Howe -Tom Hulihan -Tom Maaswinkel -Tom X. Tobin -Tomas Tomecek -Tomasz Kopczynski -Tomasz Lipinski -Tomasz Nurkiewicz -Tommaso Visconti -Tomáš Hrčka -Tonis Tiigi -Tonny Xu -Tony Daws -Tony Miller -toogley -Torstein Husebø -tpng -tracylihui <793912329@qq.com> -Travis Cline -Travis Thieman -Trent Ogren -Trevor -Trevor Pounds -trishnaguha -Tristan Carel -Troy Denton -Tyler Brock -Tzu-Jung Lee -Tõnis Tiigi -Ulysse Carion -unknown -vagrant -Vaidas Jablonskis -Veres Lajos -vgeta -Victor Algaze -Victor Coisne -Victor Costan -Victor I. Wood -Victor Lyuboslavsky -Victor Marmol -Victor Palma -Victor Vieux -Victoria Bialas -Vijaya Kumar K -Viktor Stanchev -Viktor Vojnovski -VinayRaghavanKS -Vincent Batts -Vincent Bernat -Vincent Bernat -Vincent Demeester -Vincent Giersch -Vincent Mayers -Vincent Woo -Vinod Kulkarni -Vishal Doshi -Vishnu Kannan -Vitor Monteiro -Vivek Agarwal -Vivek Dasgupta -Vivek Goyal -Vladimir Bulyga -Vladimir Kirillov -Vladimir Pouzanov -Vladimir Rutsky -Vladimir Varankin -VladimirAus -Vojtech Vitek (V-Teq) -waitingkuo -Walter Leibbrandt -Walter Stanish -WANG Chao -Wang Xing -Ward Vandewege -WarheadsSE -Wayne Chang -Wei-Ting Kuo -weiyan -Weiyang Zhu -Wen Cheng Ma -Wendel Fleming -Wenkai Yin -Wenxuan Zhao -Wenyu You <21551128@zju.edu.cn> -Wes Morgan -Will Dietz -Will Rouesnel -Will Weaver -willhf -William Delanoue -William Henry -William Hubbs -William Riancho -William Thurston -WiseTrem -wlan0 -Wolfgang Powisch -wonderflow -Wonjun Kim -xamyzhao -Xianlu Bird -XiaoBing Jiang -Xiaoxu Chen -xiekeyang -Xinzi Zhou -Xiuming Chen -xlgao-zju -xuzhaokui -Yahya -YAMADA Tsuyoshi -Yan Feng -Yang Bai -yangshukui -Yanqiang Miao -Yasunori Mahata -Yestin Sun -Yi EungJun -Yibai Zhang -Yihang Ho -Ying Li -Yohei Ueda -Yong Tang -Yongzhi Pan -yorkie -Youcef YEKHLEF -Yuan Sun -yuchangchun -yuchengxia -yuexiao-wang -YuPengZTE -Yurii Rashkovskii -yuzou -Zac Dover -Zach Borboa -Zachary Jaffee -Zain Memon -Zaiste! -Zane DeGraffenried -Zefan Li -Zen Lin(Zhinan Lin) -Zhang Kun -Zhang Wei -Zhang Wentao -Zhenan Ye <21551168@zju.edu.cn> -zhouhao -Zhu Guihua -Zhuoyun Wei -Zilin Du -zimbatm -Ziming Dong -ZJUshuaizhou <21551191@zju.edu.cn> -zmarouf -Zoltan Tombol -zqh -Zuhayr Elahi -Zunayed Ali -Álex González -Álvaro Lázaro -Átila Camurça Alves -尹吉峰 -搏通 diff --git a/vendor/github.com/docker/docker/LICENSE b/vendor/github.com/docker/docker/LICENSE deleted file mode 100644 index 8f3fee62..00000000 --- a/vendor/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2016 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/docker/NOTICE b/vendor/github.com/docker/docker/NOTICE deleted file mode 100644 index 8a37c1c7..00000000 --- a/vendor/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2016 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/kr/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/docker/docker/api/types/auth.go b/vendor/github.com/docker/docker/api/types/auth.go deleted file mode 100644 index 056af6b8..00000000 --- a/vendor/github.com/docker/docker/api/types/auth.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -// AuthConfig contains authorization information for connecting to a Registry -type AuthConfig struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Auth string `json:"auth,omitempty"` - - // Email is an optional value associated with the username. - // This field is deprecated and will be removed in a later - // version of docker. - Email string `json:"email,omitempty"` - - ServerAddress string `json:"serveraddress,omitempty"` - - // IdentityToken is used to authenticate the user and get - // an access token for the registry. - IdentityToken string `json:"identitytoken,omitempty"` - - // RegistryToken is a bearer token to be sent to a registry - RegistryToken string `json:"registrytoken,omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/blkiodev/blkio.go b/vendor/github.com/docker/docker/api/types/blkiodev/blkio.go deleted file mode 100644 index 931ae10a..00000000 --- a/vendor/github.com/docker/docker/api/types/blkiodev/blkio.go +++ /dev/null @@ -1,23 +0,0 @@ -package blkiodev - -import "fmt" - -// WeightDevice is a structure that holds device:weight pair -type WeightDevice struct { - Path string - Weight uint16 -} - -func (w *WeightDevice) String() string { - return fmt.Sprintf("%s:%d", w.Path, w.Weight) -} - -// ThrottleDevice is a structure that holds device:rate_per_second pair -type ThrottleDevice struct { - Path string - Rate uint64 -} - -func (t *ThrottleDevice) String() string { - return fmt.Sprintf("%s:%d", t.Path, t.Rate) -} diff --git a/vendor/github.com/docker/docker/api/types/client.go b/vendor/github.com/docker/docker/api/types/client.go deleted file mode 100644 index 7900d64f..00000000 --- a/vendor/github.com/docker/docker/api/types/client.go +++ /dev/null @@ -1,378 +0,0 @@ -package types - -import ( - "bufio" - "io" - "net" - "os" - - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/go-units" -) - -// CheckpointCreateOptions holds parameters to create a checkpoint from a container -type CheckpointCreateOptions struct { - CheckpointID string - CheckpointDir string - Exit bool -} - -// CheckpointListOptions holds parameters to list checkpoints for a container -type CheckpointListOptions struct { - CheckpointDir string -} - -// CheckpointDeleteOptions holds parameters to delete a checkpoint from a container -type CheckpointDeleteOptions struct { - CheckpointID string - CheckpointDir string -} - -// ContainerAttachOptions holds parameters to attach to a container. -type ContainerAttachOptions struct { - Stream bool - Stdin bool - Stdout bool - Stderr bool - DetachKeys string - Logs bool -} - -// ContainerCommitOptions holds parameters to commit changes into a container. -type ContainerCommitOptions struct { - Reference string - Comment string - Author string - Changes []string - Pause bool - Config *container.Config -} - -// ContainerExecInspect holds information returned by exec inspect. -type ContainerExecInspect struct { - ExecID string - ContainerID string - Running bool - ExitCode int - Pid int -} - -// ContainerListOptions holds parameters to list containers with. -type ContainerListOptions struct { - Quiet bool - Size bool - All bool - Latest bool - Since string - Before string - Limit int - Filters filters.Args -} - -// ContainerLogsOptions holds parameters to filter logs with. -type ContainerLogsOptions struct { - ShowStdout bool - ShowStderr bool - Since string - Timestamps bool - Follow bool - Tail string - Details bool -} - -// ContainerRemoveOptions holds parameters to remove containers. -type ContainerRemoveOptions struct { - RemoveVolumes bool - RemoveLinks bool - Force bool -} - -// ContainerStartOptions holds parameters to start containers. -type ContainerStartOptions struct { - CheckpointID string - CheckpointDir string -} - -// CopyToContainerOptions holds information -// about files to copy into a container -type CopyToContainerOptions struct { - AllowOverwriteDirWithFile bool -} - -// EventsOptions holds parameters to filter events with. -type EventsOptions struct { - Since string - Until string - Filters filters.Args -} - -// NetworkListOptions holds parameters to filter the list of networks with. -type NetworkListOptions struct { - Filters filters.Args -} - -// HijackedResponse holds connection information for a hijacked request. -type HijackedResponse struct { - Conn net.Conn - Reader *bufio.Reader -} - -// Close closes the hijacked connection and reader. -func (h *HijackedResponse) Close() { - h.Conn.Close() -} - -// CloseWriter is an interface that implements structs -// that close input streams to prevent from writing. -type CloseWriter interface { - CloseWrite() error -} - -// CloseWrite closes a readWriter for writing. -func (h *HijackedResponse) CloseWrite() error { - if conn, ok := h.Conn.(CloseWriter); ok { - return conn.CloseWrite() - } - return nil -} - -// ImageBuildOptions holds the information -// necessary to build images. -type ImageBuildOptions struct { - Tags []string - SuppressOutput bool - RemoteContext string - NoCache bool - Remove bool - ForceRemove bool - PullParent bool - Isolation container.Isolation - CPUSetCPUs string - CPUSetMems string - CPUShares int64 - CPUQuota int64 - CPUPeriod int64 - Memory int64 - MemorySwap int64 - CgroupParent string - NetworkMode string - ShmSize int64 - Dockerfile string - Ulimits []*units.Ulimit - // See the parsing of buildArgs in api/server/router/build/build_routes.go - // for an explaination of why BuildArgs needs to use *string instead of - // just a string - BuildArgs map[string]*string - AuthConfigs map[string]AuthConfig - Context io.Reader - Labels map[string]string - // squash the resulting image's layers to the parent - // preserves the original image and creates a new one from the parent with all - // the changes applied to a single layer - Squash bool - // CacheFrom specifies images that are used for matching cache. Images - // specified here do not need to have a valid parent chain to match cache. - CacheFrom []string - SecurityOpt []string -} - -// ImageBuildResponse holds information -// returned by a server after building -// an image. -type ImageBuildResponse struct { - Body io.ReadCloser - OSType string -} - -// ImageCreateOptions holds information to create images. -type ImageCreateOptions struct { - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry -} - -// ImageImportSource holds source information for ImageImport -type ImageImportSource struct { - Source io.Reader // Source is the data to send to the server to create this image from (mutually exclusive with SourceName) - SourceName string // SourceName is the name of the image to pull (mutually exclusive with Source) -} - -// ImageImportOptions holds information to import images from the client host. -type ImageImportOptions struct { - Tag string // Tag is the name to tag this image with. This attribute is deprecated. - Message string // Message is the message to tag the image with - Changes []string // Changes are the raw changes to apply to this image -} - -// ImageListOptions holds parameters to filter the list of images with. -type ImageListOptions struct { - All bool - Filters filters.Args -} - -// ImageLoadResponse returns information to the client about a load process. -type ImageLoadResponse struct { - // Body must be closed to avoid a resource leak - Body io.ReadCloser - JSON bool -} - -// ImagePullOptions holds information to pull images. -type ImagePullOptions struct { - All bool - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry - PrivilegeFunc RequestPrivilegeFunc -} - -// RequestPrivilegeFunc is a function interface that -// clients can supply to retry operations after -// getting an authorization error. -// This function returns the registry authentication -// header value in base 64 format, or an error -// if the privilege request fails. -type RequestPrivilegeFunc func() (string, error) - -//ImagePushOptions holds information to push images. -type ImagePushOptions ImagePullOptions - -// ImageRemoveOptions holds parameters to remove images. -type ImageRemoveOptions struct { - Force bool - PruneChildren bool -} - -// ImageSearchOptions holds parameters to search images with. -type ImageSearchOptions struct { - RegistryAuth string - PrivilegeFunc RequestPrivilegeFunc - Filters filters.Args - Limit int -} - -// ResizeOptions holds parameters to resize a tty. -// It can be used to resize container ttys and -// exec process ttys too. -type ResizeOptions struct { - Height uint - Width uint -} - -// VersionResponse holds version information for the client and the server -type VersionResponse struct { - Client *Version - Server *Version -} - -// ServerOK returns true when the client could connect to the docker server -// and parse the information received. It returns false otherwise. -func (v VersionResponse) ServerOK() bool { - return v.Server != nil -} - -// NodeListOptions holds parameters to list nodes with. -type NodeListOptions struct { - Filters filters.Args -} - -// NodeRemoveOptions holds parameters to remove nodes with. -type NodeRemoveOptions struct { - Force bool -} - -// ServiceCreateOptions contains the options to use when creating a service. -type ServiceCreateOptions struct { - // EncodedRegistryAuth is the encoded registry authorization credentials to - // use when updating the service. - // - // This field follows the format of the X-Registry-Auth header. - EncodedRegistryAuth string -} - -// ServiceCreateResponse contains the information returned to a client -// on the creation of a new service. -type ServiceCreateResponse struct { - // ID is the ID of the created service. - ID string - // Warnings is a set of non-fatal warning messages to pass on to the user. - Warnings []string `json:",omitempty"` -} - -// Values for RegistryAuthFrom in ServiceUpdateOptions -const ( - RegistryAuthFromSpec = "spec" - RegistryAuthFromPreviousSpec = "previous-spec" -) - -// ServiceUpdateOptions contains the options to be used for updating services. -type ServiceUpdateOptions struct { - // EncodedRegistryAuth is the encoded registry authorization credentials to - // use when updating the service. - // - // This field follows the format of the X-Registry-Auth header. - EncodedRegistryAuth string - - // TODO(stevvooe): Consider moving the version parameter of ServiceUpdate - // into this field. While it does open API users up to racy writes, most - // users may not need that level of consistency in practice. - - // RegistryAuthFrom specifies where to find the registry authorization - // credentials if they are not given in EncodedRegistryAuth. Valid - // values are "spec" and "previous-spec". - RegistryAuthFrom string -} - -// ServiceListOptions holds parameters to list services with. -type ServiceListOptions struct { - Filters filters.Args -} - -// TaskListOptions holds parameters to list tasks with. -type TaskListOptions struct { - Filters filters.Args -} - -// PluginRemoveOptions holds parameters to remove plugins. -type PluginRemoveOptions struct { - Force bool -} - -// PluginEnableOptions holds parameters to enable plugins. -type PluginEnableOptions struct { - Timeout int -} - -// PluginDisableOptions holds parameters to disable plugins. -type PluginDisableOptions struct { - Force bool -} - -// PluginInstallOptions holds parameters to install a plugin. -type PluginInstallOptions struct { - Disabled bool - AcceptAllPermissions bool - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry - RemoteRef string // RemoteRef is the plugin name on the registry - PrivilegeFunc RequestPrivilegeFunc - AcceptPermissionsFunc func(PluginPrivileges) (bool, error) - Args []string -} - -// SecretRequestOption is a type for requesting secrets -type SecretRequestOption struct { - Source string - Target string - UID string - GID string - Mode os.FileMode -} - -// SwarmUnlockKeyResponse contains the response for Engine API: -// GET /swarm/unlockkey -type SwarmUnlockKeyResponse struct { - // UnlockKey is the unlock key in ASCII-armored format. - UnlockKey string -} - -// PluginCreateOptions hold all options to plugin create. -type PluginCreateOptions struct { - RepoName string -} diff --git a/vendor/github.com/docker/docker/api/types/configs.go b/vendor/github.com/docker/docker/api/types/configs.go deleted file mode 100644 index 20c19f21..00000000 --- a/vendor/github.com/docker/docker/api/types/configs.go +++ /dev/null @@ -1,69 +0,0 @@ -package types - -import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" -) - -// configs holds structs used for internal communication between the -// frontend (such as an http server) and the backend (such as the -// docker daemon). - -// ContainerCreateConfig is the parameter set to ContainerCreate() -type ContainerCreateConfig struct { - Name string - Config *container.Config - HostConfig *container.HostConfig - NetworkingConfig *network.NetworkingConfig - AdjustCPUShares bool -} - -// ContainerRmConfig holds arguments for the container remove -// operation. This struct is used to tell the backend what operations -// to perform. -type ContainerRmConfig struct { - ForceRemove, RemoveVolume, RemoveLink bool -} - -// ContainerCommitConfig contains build configs for commit operation, -// and is used when making a commit with the current state of the container. -type ContainerCommitConfig struct { - Pause bool - Repo string - Tag string - Author string - Comment string - // merge container config into commit config before commit - MergeConfigs bool - Config *container.Config -} - -// ExecConfig is a small subset of the Config struct that holds the configuration -// for the exec feature of docker. -type ExecConfig struct { - User string // User that will run the command - Privileged bool // Is the container in privileged mode - Tty bool // Attach standard streams to a tty. - AttachStdin bool // Attach the standard input, makes possible user interaction - AttachStderr bool // Attach the standard error - AttachStdout bool // Attach the standard output - Detach bool // Execute in detach mode - DetachKeys string // Escape keys for detach - Env []string // Environment variables - Cmd []string // Execution commands and args -} - -// PluginRmConfig holds arguments for plugin remove. -type PluginRmConfig struct { - ForceRemove bool -} - -// PluginEnableConfig holds arguments for plugin enable -type PluginEnableConfig struct { - Timeout int -} - -// PluginDisableConfig holds arguments for plugin disable. -type PluginDisableConfig struct { - ForceDisable bool -} diff --git a/vendor/github.com/docker/docker/api/types/container/config.go b/vendor/github.com/docker/docker/api/types/container/config.go deleted file mode 100644 index fc050e5d..00000000 --- a/vendor/github.com/docker/docker/api/types/container/config.go +++ /dev/null @@ -1,62 +0,0 @@ -package container - -import ( - "time" - - "github.com/docker/docker/api/types/strslice" - "github.com/docker/go-connections/nat" -) - -// HealthConfig holds configuration settings for the HEALTHCHECK feature. -type HealthConfig struct { - // Test is the test to perform to check that the container is healthy. - // An empty slice means to inherit the default. - // The options are: - // {} : inherit healthcheck - // {"NONE"} : disable healthcheck - // {"CMD", args...} : exec arguments directly - // {"CMD-SHELL", command} : run command with system's default shell - Test []string `json:",omitempty"` - - // Zero means to inherit. Durations are expressed as integer nanoseconds. - Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks. - Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung. - - // Retries is the number of consecutive failures needed to consider a container as unhealthy. - // Zero means inherit. - Retries int `json:",omitempty"` -} - -// Config contains the configuration data about a container. -// It should hold only portable information about the container. -// Here, "portable" means "independent from the host we are running on". -// Non-portable information *should* appear in HostConfig. -// All fields added to this struct must be marked `omitempty` to keep getting -// predictable hashes from the old `v1Compatibility` configuration. -type Config struct { - Hostname string // Hostname - Domainname string // Domainname - User string // User that will run the command(s) inside the container, also support user:group - AttachStdin bool // Attach the standard input, makes possible user interaction - AttachStdout bool // Attach the standard output - AttachStderr bool // Attach the standard error - ExposedPorts nat.PortSet `json:",omitempty"` // List of exposed ports - Tty bool // Attach standard streams to a tty, including stdin if it is not closed. - OpenStdin bool // Open stdin - StdinOnce bool // If true, close stdin after the 1 attached client disconnects. - Env []string // List of environment variable to set in the container - Cmd strslice.StrSlice // Command to run when starting the container - Healthcheck *HealthConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy - ArgsEscaped bool `json:",omitempty"` // True if command is already escaped (Windows specific) - Image string // Name of the image as it was passed by the operator (e.g. could be symbolic) - Volumes map[string]struct{} // List of volumes (mounts) used for the container - WorkingDir string // Current directory (PWD) in the command will be launched - Entrypoint strslice.StrSlice // Entrypoint to run when starting the container - NetworkDisabled bool `json:",omitempty"` // Is network disabled - MacAddress string `json:",omitempty"` // Mac Address of the container - OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile - Labels map[string]string // List of labels set to this container - StopSignal string `json:",omitempty"` // Signal to stop a container - StopTimeout *int `json:",omitempty"` // Timeout (in seconds) to stop a container - Shell strslice.StrSlice `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT -} diff --git a/vendor/github.com/docker/docker/api/types/container/container_create.go b/vendor/github.com/docker/docker/api/types/container/container_create.go deleted file mode 100644 index d028e3b1..00000000 --- a/vendor/github.com/docker/docker/api/types/container/container_create.go +++ /dev/null @@ -1,21 +0,0 @@ -package container - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -// ContainerCreateCreatedBody container create created body -// swagger:model ContainerCreateCreatedBody -type ContainerCreateCreatedBody struct { - - // The ID of the created container - // Required: true - ID string `json:"Id"` - - // Warnings encountered when creating the container - // Required: true - Warnings []string `json:"Warnings"` -} diff --git a/vendor/github.com/docker/docker/api/types/container/container_update.go b/vendor/github.com/docker/docker/api/types/container/container_update.go deleted file mode 100644 index 81ee12c6..00000000 --- a/vendor/github.com/docker/docker/api/types/container/container_update.go +++ /dev/null @@ -1,17 +0,0 @@ -package container - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -// ContainerUpdateOKBody container update o k body -// swagger:model ContainerUpdateOKBody -type ContainerUpdateOKBody struct { - - // warnings - // Required: true - Warnings []string `json:"Warnings"` -} diff --git a/vendor/github.com/docker/docker/api/types/container/container_wait.go b/vendor/github.com/docker/docker/api/types/container/container_wait.go deleted file mode 100644 index 16cf3353..00000000 --- a/vendor/github.com/docker/docker/api/types/container/container_wait.go +++ /dev/null @@ -1,17 +0,0 @@ -package container - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -// ContainerWaitOKBody container wait o k body -// swagger:model ContainerWaitOKBody -type ContainerWaitOKBody struct { - - // Exit code of the container - // Required: true - StatusCode int64 `json:"StatusCode"` -} diff --git a/vendor/github.com/docker/docker/api/types/container/host_config.go b/vendor/github.com/docker/docker/api/types/container/host_config.go deleted file mode 100644 index 0c82d625..00000000 --- a/vendor/github.com/docker/docker/api/types/container/host_config.go +++ /dev/null @@ -1,333 +0,0 @@ -package container - -import ( - "strings" - - "github.com/docker/docker/api/types/blkiodev" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/strslice" - "github.com/docker/go-connections/nat" - "github.com/docker/go-units" -) - -// NetworkMode represents the container network stack. -type NetworkMode string - -// Isolation represents the isolation technology of a container. The supported -// values are platform specific -type Isolation string - -// IsDefault indicates the default isolation technology of a container. On Linux this -// is the native driver. On Windows, this is a Windows Server Container. -func (i Isolation) IsDefault() bool { - return strings.ToLower(string(i)) == "default" || string(i) == "" -} - -// IpcMode represents the container ipc stack. -type IpcMode string - -// IsPrivate indicates whether the container uses its private ipc stack. -func (n IpcMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) -} - -// IsHost indicates whether the container uses the host's ipc stack. -func (n IpcMode) IsHost() bool { - return n == "host" -} - -// IsContainer indicates whether the container uses a container's ipc stack. -func (n IpcMode) IsContainer() bool { - parts := strings.SplitN(string(n), ":", 2) - return len(parts) > 1 && parts[0] == "container" -} - -// Valid indicates whether the ipc stack is valid. -func (n IpcMode) Valid() bool { - parts := strings.Split(string(n), ":") - switch mode := parts[0]; mode { - case "", "host": - case "container": - if len(parts) != 2 || parts[1] == "" { - return false - } - default: - return false - } - return true -} - -// Container returns the name of the container ipc stack is going to be used. -func (n IpcMode) Container() string { - parts := strings.SplitN(string(n), ":", 2) - if len(parts) > 1 { - return parts[1] - } - return "" -} - -// UsernsMode represents userns mode in the container. -type UsernsMode string - -// IsHost indicates whether the container uses the host's userns. -func (n UsernsMode) IsHost() bool { - return n == "host" -} - -// IsPrivate indicates whether the container uses the a private userns. -func (n UsernsMode) IsPrivate() bool { - return !(n.IsHost()) -} - -// Valid indicates whether the userns is valid. -func (n UsernsMode) Valid() bool { - parts := strings.Split(string(n), ":") - switch mode := parts[0]; mode { - case "", "host": - default: - return false - } - return true -} - -// CgroupSpec represents the cgroup to use for the container. -type CgroupSpec string - -// IsContainer indicates whether the container is using another container cgroup -func (c CgroupSpec) IsContainer() bool { - parts := strings.SplitN(string(c), ":", 2) - return len(parts) > 1 && parts[0] == "container" -} - -// Valid indicates whether the cgroup spec is valid. -func (c CgroupSpec) Valid() bool { - return c.IsContainer() || c == "" -} - -// Container returns the name of the container whose cgroup will be used. -func (c CgroupSpec) Container() string { - parts := strings.SplitN(string(c), ":", 2) - if len(parts) > 1 { - return parts[1] - } - return "" -} - -// UTSMode represents the UTS namespace of the container. -type UTSMode string - -// IsPrivate indicates whether the container uses its private UTS namespace. -func (n UTSMode) IsPrivate() bool { - return !(n.IsHost()) -} - -// IsHost indicates whether the container uses the host's UTS namespace. -func (n UTSMode) IsHost() bool { - return n == "host" -} - -// Valid indicates whether the UTS namespace is valid. -func (n UTSMode) Valid() bool { - parts := strings.Split(string(n), ":") - switch mode := parts[0]; mode { - case "", "host": - default: - return false - } - return true -} - -// PidMode represents the pid namespace of the container. -type PidMode string - -// IsPrivate indicates whether the container uses its own new pid namespace. -func (n PidMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) -} - -// IsHost indicates whether the container uses the host's pid namespace. -func (n PidMode) IsHost() bool { - return n == "host" -} - -// IsContainer indicates whether the container uses a container's pid namespace. -func (n PidMode) IsContainer() bool { - parts := strings.SplitN(string(n), ":", 2) - return len(parts) > 1 && parts[0] == "container" -} - -// Valid indicates whether the pid namespace is valid. -func (n PidMode) Valid() bool { - parts := strings.Split(string(n), ":") - switch mode := parts[0]; mode { - case "", "host": - case "container": - if len(parts) != 2 || parts[1] == "" { - return false - } - default: - return false - } - return true -} - -// Container returns the name of the container whose pid namespace is going to be used. -func (n PidMode) Container() string { - parts := strings.SplitN(string(n), ":", 2) - if len(parts) > 1 { - return parts[1] - } - return "" -} - -// DeviceMapping represents the device mapping between the host and the container. -type DeviceMapping struct { - PathOnHost string - PathInContainer string - CgroupPermissions string -} - -// RestartPolicy represents the restart policies of the container. -type RestartPolicy struct { - Name string - MaximumRetryCount int -} - -// IsNone indicates whether the container has the "no" restart policy. -// This means the container will not automatically restart when exiting. -func (rp *RestartPolicy) IsNone() bool { - return rp.Name == "no" || rp.Name == "" -} - -// IsAlways indicates whether the container has the "always" restart policy. -// This means the container will automatically restart regardless of the exit status. -func (rp *RestartPolicy) IsAlways() bool { - return rp.Name == "always" -} - -// IsOnFailure indicates whether the container has the "on-failure" restart policy. -// This means the container will automatically restart of exiting with a non-zero exit status. -func (rp *RestartPolicy) IsOnFailure() bool { - return rp.Name == "on-failure" -} - -// IsUnlessStopped indicates whether the container has the -// "unless-stopped" restart policy. This means the container will -// automatically restart unless user has put it to stopped state. -func (rp *RestartPolicy) IsUnlessStopped() bool { - return rp.Name == "unless-stopped" -} - -// IsSame compares two RestartPolicy to see if they are the same -func (rp *RestartPolicy) IsSame(tp *RestartPolicy) bool { - return rp.Name == tp.Name && rp.MaximumRetryCount == tp.MaximumRetryCount -} - -// LogConfig represents the logging configuration of the container. -type LogConfig struct { - Type string - Config map[string]string -} - -// Resources contains container's resources (cgroups config, ulimits...) -type Resources struct { - // Applicable to all platforms - CPUShares int64 `json:"CpuShares"` // CPU shares (relative weight vs. other containers) - Memory int64 // Memory limit (in bytes) - NanoCPUs int64 `json:"NanoCpus"` // CPU quota in units of 10-9 CPUs. - - // Applicable to UNIX platforms - CgroupParent string // Parent cgroup. - BlkioWeight uint16 // Block IO weight (relative weight vs. other containers) - BlkioWeightDevice []*blkiodev.WeightDevice - BlkioDeviceReadBps []*blkiodev.ThrottleDevice - BlkioDeviceWriteBps []*blkiodev.ThrottleDevice - BlkioDeviceReadIOps []*blkiodev.ThrottleDevice - BlkioDeviceWriteIOps []*blkiodev.ThrottleDevice - CPUPeriod int64 `json:"CpuPeriod"` // CPU CFS (Completely Fair Scheduler) period - CPUQuota int64 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota - CPURealtimePeriod int64 `json:"CpuRealtimePeriod"` // CPU real-time period - CPURealtimeRuntime int64 `json:"CpuRealtimeRuntime"` // CPU real-time runtime - CpusetCpus string // CpusetCpus 0-2, 0,1 - CpusetMems string // CpusetMems 0-2, 0,1 - Devices []DeviceMapping // List of devices to map inside the container - DiskQuota int64 // Disk limit (in bytes) - KernelMemory int64 // Kernel memory limit (in bytes) - MemoryReservation int64 // Memory soft limit (in bytes) - MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap - MemorySwappiness *int64 // Tuning container memory swappiness behaviour - OomKillDisable *bool // Whether to disable OOM Killer or not - PidsLimit int64 // Setting pids limit for a container - Ulimits []*units.Ulimit // List of ulimits to be set in the container - - // Applicable to Windows - CPUCount int64 `json:"CpuCount"` // CPU count - CPUPercent int64 `json:"CpuPercent"` // CPU percent - IOMaximumIOps uint64 // Maximum IOps for the container system drive - IOMaximumBandwidth uint64 // Maximum IO in bytes per second for the container system drive -} - -// UpdateConfig holds the mutable attributes of a Container. -// Those attributes can be updated at runtime. -type UpdateConfig struct { - // Contains container's resources (cgroups, ulimits) - Resources - RestartPolicy RestartPolicy -} - -// HostConfig the non-portable Config structure of a container. -// Here, "non-portable" means "dependent of the host we are running on". -// Portable information *should* appear in Config. -type HostConfig struct { - // Applicable to all platforms - Binds []string // List of volume bindings for this container - ContainerIDFile string // File (path) where the containerId is written - LogConfig LogConfig // Configuration of the logs for this container - NetworkMode NetworkMode // Network mode to use for the container - PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host - RestartPolicy RestartPolicy // Restart policy to be used for the container - AutoRemove bool // Automatically remove container when it exits - VolumeDriver string // Name of the volume driver used to mount volumes - VolumesFrom []string // List of volumes to take from other container - - // Applicable to UNIX platforms - CapAdd strslice.StrSlice // List of kernel capabilities to add to the container - CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container - DNS []string `json:"Dns"` // List of DNS server to lookup - DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for - DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for - ExtraHosts []string // List of extra hosts - GroupAdd []string // List of additional groups that the container process will run as - IpcMode IpcMode // IPC namespace to use for the container - Cgroup CgroupSpec // Cgroup to use for the container - Links []string // List of links (in the name:alias form) - OomScoreAdj int // Container preference for OOM-killing - PidMode PidMode // PID namespace to use for the container - Privileged bool // Is the container in privileged mode - PublishAllPorts bool // Should docker publish all exposed port for the container - ReadonlyRootfs bool // Is the container root filesystem in read-only - SecurityOpt []string // List of string values to customize labels for MLS systems, such as SELinux. - StorageOpt map[string]string `json:",omitempty"` // Storage driver options per container. - Tmpfs map[string]string `json:",omitempty"` // List of tmpfs (mounts) used for the container - UTSMode UTSMode // UTS namespace to use for the container - UsernsMode UsernsMode // The user namespace to use for the container - ShmSize int64 // Total shm memory usage - Sysctls map[string]string `json:",omitempty"` // List of Namespaced sysctls used for the container - Runtime string `json:",omitempty"` // Runtime to use with this container - - // Applicable to Windows - ConsoleSize [2]uint // Initial console size (height,width) - Isolation Isolation // Isolation technology of the container (eg default, hyperv) - - // Contains container's resources (cgroups, ulimits) - Resources - - // Mounts specs used by the container - Mounts []mount.Mount `json:",omitempty"` - - // Run a custom init inside the container, if null, use the daemon's configured settings - Init *bool `json:",omitempty"` - - // Custom init path - InitPath string `json:",omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go b/vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go deleted file mode 100644 index 9fb79bed..00000000 --- a/vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go +++ /dev/null @@ -1,81 +0,0 @@ -// +build !windows - -package container - -import "strings" - -// IsValid indicates if an isolation technology is valid -func (i Isolation) IsValid() bool { - return i.IsDefault() -} - -// IsPrivate indicates whether container uses its private network stack. -func (n NetworkMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) -} - -// IsDefault indicates whether container uses the default network stack. -func (n NetworkMode) IsDefault() bool { - return n == "default" -} - -// NetworkName returns the name of the network stack. -func (n NetworkMode) NetworkName() string { - if n.IsBridge() { - return "bridge" - } else if n.IsHost() { - return "host" - } else if n.IsContainer() { - return "container" - } else if n.IsNone() { - return "none" - } else if n.IsDefault() { - return "default" - } else if n.IsUserDefined() { - return n.UserDefined() - } - return "" -} - -// IsBridge indicates whether container uses the bridge network stack -func (n NetworkMode) IsBridge() bool { - return n == "bridge" -} - -// IsHost indicates whether container uses the host network stack. -func (n NetworkMode) IsHost() bool { - return n == "host" -} - -// IsContainer indicates whether container uses a container network stack. -func (n NetworkMode) IsContainer() bool { - parts := strings.SplitN(string(n), ":", 2) - return len(parts) > 1 && parts[0] == "container" -} - -// IsNone indicates whether container isn't using a network stack. -func (n NetworkMode) IsNone() bool { - return n == "none" -} - -// ConnectedContainer is the id of the container which network this container is connected to. -func (n NetworkMode) ConnectedContainer() string { - parts := strings.SplitN(string(n), ":", 2) - if len(parts) > 1 { - return parts[1] - } - return "" -} - -// IsUserDefined indicates user-created network -func (n NetworkMode) IsUserDefined() bool { - return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() -} - -//UserDefined indicates user-created network -func (n NetworkMode) UserDefined() string { - if n.IsUserDefined() { - return string(n) - } - return "" -} diff --git a/vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go b/vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go deleted file mode 100644 index 0ee332ba..00000000 --- a/vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go +++ /dev/null @@ -1,87 +0,0 @@ -package container - -import ( - "strings" -) - -// IsDefault indicates whether container uses the default network stack. -func (n NetworkMode) IsDefault() bool { - return n == "default" -} - -// IsNone indicates whether container isn't using a network stack. -func (n NetworkMode) IsNone() bool { - return n == "none" -} - -// IsContainer indicates whether container uses a container network stack. -// Returns false as windows doesn't support this mode -func (n NetworkMode) IsContainer() bool { - return false -} - -// IsBridge indicates whether container uses the bridge network stack -// in windows it is given the name NAT -func (n NetworkMode) IsBridge() bool { - return n == "nat" -} - -// IsHost indicates whether container uses the host network stack. -// returns false as this is not supported by windows -func (n NetworkMode) IsHost() bool { - return false -} - -// IsPrivate indicates whether container uses its private network stack. -func (n NetworkMode) IsPrivate() bool { - return !(n.IsHost() || n.IsContainer()) -} - -// ConnectedContainer is the id of the container which network this container is connected to. -// Returns blank string on windows -func (n NetworkMode) ConnectedContainer() string { - return "" -} - -// IsUserDefined indicates user-created network -func (n NetworkMode) IsUserDefined() bool { - return !n.IsDefault() && !n.IsNone() && !n.IsBridge() -} - -// IsHyperV indicates the use of a Hyper-V partition for isolation -func (i Isolation) IsHyperV() bool { - return strings.ToLower(string(i)) == "hyperv" -} - -// IsProcess indicates the use of process isolation -func (i Isolation) IsProcess() bool { - return strings.ToLower(string(i)) == "process" -} - -// IsValid indicates if an isolation technology is valid -func (i Isolation) IsValid() bool { - return i.IsDefault() || i.IsHyperV() || i.IsProcess() -} - -// NetworkName returns the name of the network stack. -func (n NetworkMode) NetworkName() string { - if n.IsDefault() { - return "default" - } else if n.IsBridge() { - return "nat" - } else if n.IsNone() { - return "none" - } else if n.IsUserDefined() { - return n.UserDefined() - } - - return "" -} - -//UserDefined indicates user-created network -func (n NetworkMode) UserDefined() string { - if n.IsUserDefined() { - return string(n) - } - return "" -} diff --git a/vendor/github.com/docker/docker/api/types/error_response.go b/vendor/github.com/docker/docker/api/types/error_response.go deleted file mode 100644 index dc942d9d..00000000 --- a/vendor/github.com/docker/docker/api/types/error_response.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// ErrorResponse Represents an error. -// swagger:model ErrorResponse -type ErrorResponse struct { - - // The error message. - // Required: true - Message string `json:"message"` -} diff --git a/vendor/github.com/docker/docker/api/types/events/events.go b/vendor/github.com/docker/docker/api/types/events/events.go deleted file mode 100644 index 7129a65a..00000000 --- a/vendor/github.com/docker/docker/api/types/events/events.go +++ /dev/null @@ -1,42 +0,0 @@ -package events - -const ( - // ContainerEventType is the event type that containers generate - ContainerEventType = "container" - // DaemonEventType is the event type that daemon generate - DaemonEventType = "daemon" - // ImageEventType is the event type that images generate - ImageEventType = "image" - // NetworkEventType is the event type that networks generate - NetworkEventType = "network" - // PluginEventType is the event type that plugins generate - PluginEventType = "plugin" - // VolumeEventType is the event type that volumes generate - VolumeEventType = "volume" -) - -// Actor describes something that generates events, -// like a container, or a network, or a volume. -// It has a defined name and a set or attributes. -// The container attributes are its labels, other actors -// can generate these attributes from other properties. -type Actor struct { - ID string - Attributes map[string]string -} - -// Message represents the information an event contains -type Message struct { - // Deprecated information from JSONMessage. - // With data only in container events. - Status string `json:"status,omitempty"` - ID string `json:"id,omitempty"` - From string `json:"from,omitempty"` - - Type string - Action string - Actor Actor - - Time int64 `json:"time,omitempty"` - TimeNano int64 `json:"timeNano,omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/filters/parse.go b/vendor/github.com/docker/docker/api/types/filters/parse.go deleted file mode 100644 index e01a41de..00000000 --- a/vendor/github.com/docker/docker/api/types/filters/parse.go +++ /dev/null @@ -1,310 +0,0 @@ -// Package filters provides helper function to parse and handle command line -// filter, used for example in docker ps or docker images commands. -package filters - -import ( - "encoding/json" - "errors" - "fmt" - "regexp" - "strings" - - "github.com/docker/docker/api/types/versions" -) - -// Args stores filter arguments as map key:{map key: bool}. -// It contains an aggregation of the map of arguments (which are in the form -// of -f 'key=value') based on the key, and stores values for the same key -// in a map with string keys and boolean values. -// e.g given -f 'label=label1=1' -f 'label=label2=2' -f 'image.name=ubuntu' -// the args will be {"image.name":{"ubuntu":true},"label":{"label1=1":true,"label2=2":true}} -type Args struct { - fields map[string]map[string]bool -} - -// NewArgs initializes a new Args struct. -func NewArgs() Args { - return Args{fields: map[string]map[string]bool{}} -} - -// ParseFlag parses the argument to the filter flag. Like -// -// `docker ps -f 'created=today' -f 'image.name=ubuntu*'` -// -// If prev map is provided, then it is appended to, and returned. By default a new -// map is created. -func ParseFlag(arg string, prev Args) (Args, error) { - filters := prev - if len(arg) == 0 { - return filters, nil - } - - if !strings.Contains(arg, "=") { - return filters, ErrBadFormat - } - - f := strings.SplitN(arg, "=", 2) - - name := strings.ToLower(strings.TrimSpace(f[0])) - value := strings.TrimSpace(f[1]) - - filters.Add(name, value) - - return filters, nil -} - -// ErrBadFormat is an error returned in case of bad format for a filter. -var ErrBadFormat = errors.New("bad format of filter (expected name=value)") - -// ToParam packs the Args into a string for easy transport from client to server. -func ToParam(a Args) (string, error) { - // this way we don't URL encode {}, just empty space - if a.Len() == 0 { - return "", nil - } - - buf, err := json.Marshal(a.fields) - if err != nil { - return "", err - } - return string(buf), nil -} - -// ToParamWithVersion packs the Args into a string for easy transport from client to server. -// The generated string will depend on the specified version (corresponding to the API version). -func ToParamWithVersion(version string, a Args) (string, error) { - // this way we don't URL encode {}, just empty space - if a.Len() == 0 { - return "", nil - } - - // for daemons older than v1.10, filter must be of the form map[string][]string - buf := []byte{} - err := errors.New("") - if version != "" && versions.LessThan(version, "1.22") { - buf, err = json.Marshal(convertArgsToSlice(a.fields)) - } else { - buf, err = json.Marshal(a.fields) - } - if err != nil { - return "", err - } - return string(buf), nil -} - -// FromParam unpacks the filter Args. -func FromParam(p string) (Args, error) { - if len(p) == 0 { - return NewArgs(), nil - } - - r := strings.NewReader(p) - d := json.NewDecoder(r) - - m := map[string]map[string]bool{} - if err := d.Decode(&m); err != nil { - r.Seek(0, 0) - - // Allow parsing old arguments in slice format. - // Because other libraries might be sending them in this format. - deprecated := map[string][]string{} - if deprecatedErr := d.Decode(&deprecated); deprecatedErr == nil { - m = deprecatedArgs(deprecated) - } else { - return NewArgs(), err - } - } - return Args{m}, nil -} - -// Get returns the list of values associates with a field. -// It returns a slice of strings to keep backwards compatibility with old code. -func (filters Args) Get(field string) []string { - values := filters.fields[field] - if values == nil { - return make([]string, 0) - } - slice := make([]string, 0, len(values)) - for key := range values { - slice = append(slice, key) - } - return slice -} - -// Add adds a new value to a filter field. -func (filters Args) Add(name, value string) { - if _, ok := filters.fields[name]; ok { - filters.fields[name][value] = true - } else { - filters.fields[name] = map[string]bool{value: true} - } -} - -// Del removes a value from a filter field. -func (filters Args) Del(name, value string) { - if _, ok := filters.fields[name]; ok { - delete(filters.fields[name], value) - if len(filters.fields[name]) == 0 { - delete(filters.fields, name) - } - } -} - -// Len returns the number of fields in the arguments. -func (filters Args) Len() int { - return len(filters.fields) -} - -// MatchKVList returns true if the values for the specified field matches the ones -// from the sources. -// e.g. given Args are {'label': {'label1=1','label2=1'}, 'image.name', {'ubuntu'}}, -// field is 'label' and sources are {'label1': '1', 'label2': '2'} -// it returns true. -func (filters Args) MatchKVList(field string, sources map[string]string) bool { - fieldValues := filters.fields[field] - - //do not filter if there is no filter set or cannot determine filter - if len(fieldValues) == 0 { - return true - } - - if len(sources) == 0 { - return false - } - - for name2match := range fieldValues { - testKV := strings.SplitN(name2match, "=", 2) - - v, ok := sources[testKV[0]] - if !ok { - return false - } - if len(testKV) == 2 && testKV[1] != v { - return false - } - } - - return true -} - -// Match returns true if the values for the specified field matches the source string -// e.g. given Args are {'label': {'label1=1','label2=1'}, 'image.name', {'ubuntu'}}, -// field is 'image.name' and source is 'ubuntu' -// it returns true. -func (filters Args) Match(field, source string) bool { - if filters.ExactMatch(field, source) { - return true - } - - fieldValues := filters.fields[field] - for name2match := range fieldValues { - match, err := regexp.MatchString(name2match, source) - if err != nil { - continue - } - if match { - return true - } - } - return false -} - -// ExactMatch returns true if the source matches exactly one of the filters. -func (filters Args) ExactMatch(field, source string) bool { - fieldValues, ok := filters.fields[field] - //do not filter if there is no filter set or cannot determine filter - if !ok || len(fieldValues) == 0 { - return true - } - - // try to match full name value to avoid O(N) regular expression matching - return fieldValues[source] -} - -// UniqueExactMatch returns true if there is only one filter and the source matches exactly this one. -func (filters Args) UniqueExactMatch(field, source string) bool { - fieldValues := filters.fields[field] - //do not filter if there is no filter set or cannot determine filter - if len(fieldValues) == 0 { - return true - } - if len(filters.fields[field]) != 1 { - return false - } - - // try to match full name value to avoid O(N) regular expression matching - return fieldValues[source] -} - -// FuzzyMatch returns true if the source matches exactly one of the filters, -// or the source has one of the filters as a prefix. -func (filters Args) FuzzyMatch(field, source string) bool { - if filters.ExactMatch(field, source) { - return true - } - - fieldValues := filters.fields[field] - for prefix := range fieldValues { - if strings.HasPrefix(source, prefix) { - return true - } - } - return false -} - -// Include returns true if the name of the field to filter is in the filters. -func (filters Args) Include(field string) bool { - _, ok := filters.fields[field] - return ok -} - -// Validate ensures that all the fields in the filter are valid. -// It returns an error as soon as it finds an invalid field. -func (filters Args) Validate(accepted map[string]bool) error { - for name := range filters.fields { - if !accepted[name] { - return fmt.Errorf("Invalid filter '%s'", name) - } - } - return nil -} - -// WalkValues iterates over the list of filtered values for a field. -// It stops the iteration if it finds an error and it returns that error. -func (filters Args) WalkValues(field string, op func(value string) error) error { - if _, ok := filters.fields[field]; !ok { - return nil - } - for v := range filters.fields[field] { - if err := op(v); err != nil { - return err - } - } - return nil -} - -func deprecatedArgs(d map[string][]string) map[string]map[string]bool { - m := map[string]map[string]bool{} - for k, v := range d { - values := map[string]bool{} - for _, vv := range v { - values[vv] = true - } - m[k] = values - } - return m -} - -func convertArgsToSlice(f map[string]map[string]bool) map[string][]string { - m := map[string][]string{} - for k, v := range f { - values := []string{} - for kk := range v { - if v[kk] { - values = append(values, kk) - } - } - m[k] = values - } - return m -} diff --git a/vendor/github.com/docker/docker/api/types/id_response.go b/vendor/github.com/docker/docker/api/types/id_response.go deleted file mode 100644 index 7592d2f8..00000000 --- a/vendor/github.com/docker/docker/api/types/id_response.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// IDResponse Response to an API call that returns just an Id -// swagger:model IdResponse -type IDResponse struct { - - // The id of the newly created object. - // Required: true - ID string `json:"Id"` -} diff --git a/vendor/github.com/docker/docker/api/types/image_summary.go b/vendor/github.com/docker/docker/api/types/image_summary.go deleted file mode 100644 index e145b3dc..00000000 --- a/vendor/github.com/docker/docker/api/types/image_summary.go +++ /dev/null @@ -1,49 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// ImageSummary image summary -// swagger:model ImageSummary -type ImageSummary struct { - - // containers - // Required: true - Containers int64 `json:"Containers"` - - // created - // Required: true - Created int64 `json:"Created"` - - // Id - // Required: true - ID string `json:"Id"` - - // labels - // Required: true - Labels map[string]string `json:"Labels"` - - // parent Id - // Required: true - ParentID string `json:"ParentId"` - - // repo digests - // Required: true - RepoDigests []string `json:"RepoDigests"` - - // repo tags - // Required: true - RepoTags []string `json:"RepoTags"` - - // shared size - // Required: true - SharedSize int64 `json:"SharedSize"` - - // size - // Required: true - Size int64 `json:"Size"` - - // virtual size - // Required: true - VirtualSize int64 `json:"VirtualSize"` -} diff --git a/vendor/github.com/docker/docker/api/types/mount/mount.go b/vendor/github.com/docker/docker/api/types/mount/mount.go deleted file mode 100644 index 31f2365b..00000000 --- a/vendor/github.com/docker/docker/api/types/mount/mount.go +++ /dev/null @@ -1,113 +0,0 @@ -package mount - -import ( - "os" -) - -// Type represents the type of a mount. -type Type string - -// Type constants -const ( - // TypeBind is the type for mounting host dir - TypeBind Type = "bind" - // TypeVolume is the type for remote storage volumes - TypeVolume Type = "volume" - // TypeTmpfs is the type for mounting tmpfs - TypeTmpfs Type = "tmpfs" -) - -// Mount represents a mount (volume). -type Mount struct { - Type Type `json:",omitempty"` - // Source specifies the name of the mount. Depending on mount type, this - // may be a volume name or a host path, or even ignored. - // Source is not supported for tmpfs (must be an empty value) - Source string `json:",omitempty"` - Target string `json:",omitempty"` - ReadOnly bool `json:",omitempty"` - - BindOptions *BindOptions `json:",omitempty"` - VolumeOptions *VolumeOptions `json:",omitempty"` - TmpfsOptions *TmpfsOptions `json:",omitempty"` -} - -// Propagation represents the propagation of a mount. -type Propagation string - -const ( - // PropagationRPrivate RPRIVATE - PropagationRPrivate Propagation = "rprivate" - // PropagationPrivate PRIVATE - PropagationPrivate Propagation = "private" - // PropagationRShared RSHARED - PropagationRShared Propagation = "rshared" - // PropagationShared SHARED - PropagationShared Propagation = "shared" - // PropagationRSlave RSLAVE - PropagationRSlave Propagation = "rslave" - // PropagationSlave SLAVE - PropagationSlave Propagation = "slave" -) - -// Propagations is the list of all valid mount propagations -var Propagations = []Propagation{ - PropagationRPrivate, - PropagationPrivate, - PropagationRShared, - PropagationShared, - PropagationRSlave, - PropagationSlave, -} - -// BindOptions defines options specific to mounts of type "bind". -type BindOptions struct { - Propagation Propagation `json:",omitempty"` -} - -// VolumeOptions represents the options for a mount of type volume. -type VolumeOptions struct { - NoCopy bool `json:",omitempty"` - Labels map[string]string `json:",omitempty"` - DriverConfig *Driver `json:",omitempty"` -} - -// Driver represents a volume driver. -type Driver struct { - Name string `json:",omitempty"` - Options map[string]string `json:",omitempty"` -} - -// TmpfsOptions defines options specific to mounts of type "tmpfs". -type TmpfsOptions struct { - // Size sets the size of the tmpfs, in bytes. - // - // This will be converted to an operating system specific value - // depending on the host. For example, on linux, it will be convered to - // use a 'k', 'm' or 'g' syntax. BSD, though not widely supported with - // docker, uses a straight byte value. - // - // Percentages are not supported. - SizeBytes int64 `json:",omitempty"` - // Mode of the tmpfs upon creation - Mode os.FileMode `json:",omitempty"` - - // TODO(stevvooe): There are several more tmpfs flags, specified in the - // daemon, that are accepted. Only the most basic are added for now. - // - // From docker/docker/pkg/mount/flags.go: - // - // var validFlags = map[string]bool{ - // "": true, - // "size": true, X - // "mode": true, X - // "uid": true, - // "gid": true, - // "nr_inodes": true, - // "nr_blocks": true, - // "mpol": true, - // } - // - // Some of these may be straightforward to add, but others, such as - // uid/gid have implications in a clustered system. -} diff --git a/vendor/github.com/docker/docker/api/types/network/network.go b/vendor/github.com/docker/docker/api/types/network/network.go deleted file mode 100644 index 832b3edb..00000000 --- a/vendor/github.com/docker/docker/api/types/network/network.go +++ /dev/null @@ -1,59 +0,0 @@ -package network - -// Address represents an IP address -type Address struct { - Addr string - PrefixLen int -} - -// IPAM represents IP Address Management -type IPAM struct { - Driver string - Options map[string]string //Per network IPAM driver options - Config []IPAMConfig -} - -// IPAMConfig represents IPAM configurations -type IPAMConfig struct { - Subnet string `json:",omitempty"` - IPRange string `json:",omitempty"` - Gateway string `json:",omitempty"` - AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"` -} - -// EndpointIPAMConfig represents IPAM configurations for the endpoint -type EndpointIPAMConfig struct { - IPv4Address string `json:",omitempty"` - IPv6Address string `json:",omitempty"` - LinkLocalIPs []string `json:",omitempty"` -} - -// PeerInfo represents one peer of a overlay network -type PeerInfo struct { - Name string - IP string -} - -// EndpointSettings stores the network endpoint details -type EndpointSettings struct { - // Configurations - IPAMConfig *EndpointIPAMConfig - Links []string - Aliases []string - // Operational data - NetworkID string - EndpointID string - Gateway string - IPAddress string - IPPrefixLen int - IPv6Gateway string - GlobalIPv6Address string - GlobalIPv6PrefixLen int - MacAddress string -} - -// NetworkingConfig represents the container's networking configuration for each of its interfaces -// Carries the networking configs specified in the `docker run` and `docker network connect` commands -type NetworkingConfig struct { - EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network -} diff --git a/vendor/github.com/docker/docker/api/types/plugin.go b/vendor/github.com/docker/docker/api/types/plugin.go deleted file mode 100644 index 6cc7a23b..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin.go +++ /dev/null @@ -1,189 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Plugin A plugin for the Engine API -// swagger:model Plugin -type Plugin struct { - - // config - // Required: true - Config PluginConfig `json:"Config"` - - // True when the plugin is running. False when the plugin is not running, only installed. - // Required: true - Enabled bool `json:"Enabled"` - - // Id - ID string `json:"Id,omitempty"` - - // name - // Required: true - Name string `json:"Name"` - - // plugin remote reference used to push/pull the plugin - PluginReference string `json:"PluginReference,omitempty"` - - // settings - // Required: true - Settings PluginSettings `json:"Settings"` -} - -// PluginConfig The config of a plugin. -// swagger:model PluginConfig -type PluginConfig struct { - - // args - // Required: true - Args PluginConfigArgs `json:"Args"` - - // description - // Required: true - Description string `json:"Description"` - - // documentation - // Required: true - Documentation string `json:"Documentation"` - - // entrypoint - // Required: true - Entrypoint []string `json:"Entrypoint"` - - // env - // Required: true - Env []PluginEnv `json:"Env"` - - // interface - // Required: true - Interface PluginConfigInterface `json:"Interface"` - - // linux - // Required: true - Linux PluginConfigLinux `json:"Linux"` - - // mounts - // Required: true - Mounts []PluginMount `json:"Mounts"` - - // network - // Required: true - Network PluginConfigNetwork `json:"Network"` - - // propagated mount - // Required: true - PropagatedMount string `json:"PropagatedMount"` - - // user - User PluginConfigUser `json:"User,omitempty"` - - // work dir - // Required: true - WorkDir string `json:"WorkDir"` - - // rootfs - Rootfs *PluginConfigRootfs `json:"rootfs,omitempty"` -} - -// PluginConfigArgs plugin config args -// swagger:model PluginConfigArgs -type PluginConfigArgs struct { - - // description - // Required: true - Description string `json:"Description"` - - // name - // Required: true - Name string `json:"Name"` - - // settable - // Required: true - Settable []string `json:"Settable"` - - // value - // Required: true - Value []string `json:"Value"` -} - -// PluginConfigInterface The interface between Docker and the plugin -// swagger:model PluginConfigInterface -type PluginConfigInterface struct { - - // socket - // Required: true - Socket string `json:"Socket"` - - // types - // Required: true - Types []PluginInterfaceType `json:"Types"` -} - -// PluginConfigLinux plugin config linux -// swagger:model PluginConfigLinux -type PluginConfigLinux struct { - - // allow all devices - // Required: true - AllowAllDevices bool `json:"AllowAllDevices"` - - // capabilities - // Required: true - Capabilities []string `json:"Capabilities"` - - // devices - // Required: true - Devices []PluginDevice `json:"Devices"` -} - -// PluginConfigNetwork plugin config network -// swagger:model PluginConfigNetwork -type PluginConfigNetwork struct { - - // type - // Required: true - Type string `json:"Type"` -} - -// PluginConfigRootfs plugin config rootfs -// swagger:model PluginConfigRootfs -type PluginConfigRootfs struct { - - // diff ids - DiffIds []string `json:"diff_ids"` - - // type - Type string `json:"type,omitempty"` -} - -// PluginConfigUser plugin config user -// swagger:model PluginConfigUser -type PluginConfigUser struct { - - // g ID - GID uint32 `json:"GID,omitempty"` - - // UID - UID uint32 `json:"UID,omitempty"` -} - -// PluginSettings Settings that can be modified by users. -// swagger:model PluginSettings -type PluginSettings struct { - - // args - // Required: true - Args []string `json:"Args"` - - // devices - // Required: true - Devices []PluginDevice `json:"Devices"` - - // env - // Required: true - Env []string `json:"Env"` - - // mounts - // Required: true - Mounts []PluginMount `json:"Mounts"` -} diff --git a/vendor/github.com/docker/docker/api/types/plugin_device.go b/vendor/github.com/docker/docker/api/types/plugin_device.go deleted file mode 100644 index 56990106..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin_device.go +++ /dev/null @@ -1,25 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// PluginDevice plugin device -// swagger:model PluginDevice -type PluginDevice struct { - - // description - // Required: true - Description string `json:"Description"` - - // name - // Required: true - Name string `json:"Name"` - - // path - // Required: true - Path *string `json:"Path"` - - // settable - // Required: true - Settable []string `json:"Settable"` -} diff --git a/vendor/github.com/docker/docker/api/types/plugin_env.go b/vendor/github.com/docker/docker/api/types/plugin_env.go deleted file mode 100644 index 32962dc2..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin_env.go +++ /dev/null @@ -1,25 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// PluginEnv plugin env -// swagger:model PluginEnv -type PluginEnv struct { - - // description - // Required: true - Description string `json:"Description"` - - // name - // Required: true - Name string `json:"Name"` - - // settable - // Required: true - Settable []string `json:"Settable"` - - // value - // Required: true - Value *string `json:"Value"` -} diff --git a/vendor/github.com/docker/docker/api/types/plugin_interface_type.go b/vendor/github.com/docker/docker/api/types/plugin_interface_type.go deleted file mode 100644 index c82f204e..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin_interface_type.go +++ /dev/null @@ -1,21 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// PluginInterfaceType plugin interface type -// swagger:model PluginInterfaceType -type PluginInterfaceType struct { - - // capability - // Required: true - Capability string `json:"Capability"` - - // prefix - // Required: true - Prefix string `json:"Prefix"` - - // version - // Required: true - Version string `json:"Version"` -} diff --git a/vendor/github.com/docker/docker/api/types/plugin_mount.go b/vendor/github.com/docker/docker/api/types/plugin_mount.go deleted file mode 100644 index 5c031cf8..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin_mount.go +++ /dev/null @@ -1,37 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// PluginMount plugin mount -// swagger:model PluginMount -type PluginMount struct { - - // description - // Required: true - Description string `json:"Description"` - - // destination - // Required: true - Destination string `json:"Destination"` - - // name - // Required: true - Name string `json:"Name"` - - // options - // Required: true - Options []string `json:"Options"` - - // settable - // Required: true - Settable []string `json:"Settable"` - - // source - // Required: true - Source *string `json:"Source"` - - // type - // Required: true - Type string `json:"Type"` -} diff --git a/vendor/github.com/docker/docker/api/types/plugin_responses.go b/vendor/github.com/docker/docker/api/types/plugin_responses.go deleted file mode 100644 index d6f75531..00000000 --- a/vendor/github.com/docker/docker/api/types/plugin_responses.go +++ /dev/null @@ -1,64 +0,0 @@ -package types - -import ( - "encoding/json" - "fmt" -) - -// PluginsListResponse contains the response for the Engine API -type PluginsListResponse []*Plugin - -const ( - authzDriver = "AuthzDriver" - graphDriver = "GraphDriver" - ipamDriver = "IpamDriver" - networkDriver = "NetworkDriver" - volumeDriver = "VolumeDriver" -) - -// UnmarshalJSON implements json.Unmarshaler for PluginInterfaceType -func (t *PluginInterfaceType) UnmarshalJSON(p []byte) error { - versionIndex := len(p) - prefixIndex := 0 - if len(p) < 2 || p[0] != '"' || p[len(p)-1] != '"' { - return fmt.Errorf("%q is not a plugin interface type", p) - } - p = p[1 : len(p)-1] -loop: - for i, b := range p { - switch b { - case '.': - prefixIndex = i - case '/': - versionIndex = i - break loop - } - } - t.Prefix = string(p[:prefixIndex]) - t.Capability = string(p[prefixIndex+1 : versionIndex]) - if versionIndex < len(p) { - t.Version = string(p[versionIndex+1:]) - } - return nil -} - -// MarshalJSON implements json.Marshaler for PluginInterfaceType -func (t *PluginInterfaceType) MarshalJSON() ([]byte, error) { - return json.Marshal(t.String()) -} - -// String implements fmt.Stringer for PluginInterfaceType -func (t PluginInterfaceType) String() string { - return fmt.Sprintf("%s.%s/%s", t.Prefix, t.Capability, t.Version) -} - -// PluginPrivilege describes a permission the user has to accept -// upon installing a plugin. -type PluginPrivilege struct { - Name string - Description string - Value []string -} - -// PluginPrivileges is a list of PluginPrivilege -type PluginPrivileges []PluginPrivilege diff --git a/vendor/github.com/docker/docker/api/types/port.go b/vendor/github.com/docker/docker/api/types/port.go deleted file mode 100644 index ad52d46d..00000000 --- a/vendor/github.com/docker/docker/api/types/port.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Port An open port on a container -// swagger:model Port -type Port struct { - - // IP - IP string `json:"IP,omitempty"` - - // Port on the container - // Required: true - PrivatePort uint16 `json:"PrivatePort"` - - // Port exposed on the host - PublicPort uint16 `json:"PublicPort,omitempty"` - - // type - // Required: true - Type string `json:"Type"` -} diff --git a/vendor/github.com/docker/docker/api/types/reference/image_reference.go b/vendor/github.com/docker/docker/api/types/reference/image_reference.go deleted file mode 100644 index be9cf8eb..00000000 --- a/vendor/github.com/docker/docker/api/types/reference/image_reference.go +++ /dev/null @@ -1,34 +0,0 @@ -package reference - -import ( - distreference "github.com/docker/distribution/reference" -) - -// Parse parses the given references and returns the repository and -// tag (if present) from it. If there is an error during parsing, it will -// return an error. -func Parse(ref string) (string, string, error) { - distributionRef, err := distreference.ParseNamed(ref) - if err != nil { - return "", "", err - } - - tag := GetTagFromNamedRef(distributionRef) - return distributionRef.Name(), tag, nil -} - -// GetTagFromNamedRef returns a tag from the specified reference. -// This function is necessary as long as the docker "server" api makes the distinction between repository -// and tags. -func GetTagFromNamedRef(ref distreference.Named) string { - var tag string - switch x := ref.(type) { - case distreference.Digested: - tag = x.Digest().String() - case distreference.NamedTagged: - tag = x.Tag() - default: - tag = "latest" - } - return tag -} diff --git a/vendor/github.com/docker/docker/api/types/registry/authenticate.go b/vendor/github.com/docker/docker/api/types/registry/authenticate.go deleted file mode 100644 index 5e37d19b..00000000 --- a/vendor/github.com/docker/docker/api/types/registry/authenticate.go +++ /dev/null @@ -1,21 +0,0 @@ -package registry - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -// AuthenticateOKBody authenticate o k body -// swagger:model AuthenticateOKBody -type AuthenticateOKBody struct { - - // An opaque token used to authenticate a user after a successful login - // Required: true - IdentityToken string `json:"IdentityToken"` - - // The status of the authentication - // Required: true - Status string `json:"Status"` -} diff --git a/vendor/github.com/docker/docker/api/types/registry/registry.go b/vendor/github.com/docker/docker/api/types/registry/registry.go deleted file mode 100644 index 28fafab9..00000000 --- a/vendor/github.com/docker/docker/api/types/registry/registry.go +++ /dev/null @@ -1,104 +0,0 @@ -package registry - -import ( - "encoding/json" - "net" -) - -// ServiceConfig stores daemon registry services configuration. -type ServiceConfig struct { - InsecureRegistryCIDRs []*NetIPNet `json:"InsecureRegistryCIDRs"` - IndexConfigs map[string]*IndexInfo `json:"IndexConfigs"` - Mirrors []string -} - -// NetIPNet is the net.IPNet type, which can be marshalled and -// unmarshalled to JSON -type NetIPNet net.IPNet - -// String returns the CIDR notation of ipnet -func (ipnet *NetIPNet) String() string { - return (*net.IPNet)(ipnet).String() -} - -// MarshalJSON returns the JSON representation of the IPNet -func (ipnet *NetIPNet) MarshalJSON() ([]byte, error) { - return json.Marshal((*net.IPNet)(ipnet).String()) -} - -// UnmarshalJSON sets the IPNet from a byte array of JSON -func (ipnet *NetIPNet) UnmarshalJSON(b []byte) (err error) { - var ipnetStr string - if err = json.Unmarshal(b, &ipnetStr); err == nil { - var cidr *net.IPNet - if _, cidr, err = net.ParseCIDR(ipnetStr); err == nil { - *ipnet = NetIPNet(*cidr) - } - } - return -} - -// IndexInfo contains information about a registry -// -// RepositoryInfo Examples: -// { -// "Index" : { -// "Name" : "docker.io", -// "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"], -// "Secure" : true, -// "Official" : true, -// }, -// "RemoteName" : "library/debian", -// "LocalName" : "debian", -// "CanonicalName" : "docker.io/debian" -// "Official" : true, -// } -// -// { -// "Index" : { -// "Name" : "127.0.0.1:5000", -// "Mirrors" : [], -// "Secure" : false, -// "Official" : false, -// }, -// "RemoteName" : "user/repo", -// "LocalName" : "127.0.0.1:5000/user/repo", -// "CanonicalName" : "127.0.0.1:5000/user/repo", -// "Official" : false, -// } -type IndexInfo struct { - // Name is the name of the registry, such as "docker.io" - Name string - // Mirrors is a list of mirrors, expressed as URIs - Mirrors []string - // Secure is set to false if the registry is part of the list of - // insecure registries. Insecure registries accept HTTP and/or accept - // HTTPS with certificates from unknown CAs. - Secure bool - // Official indicates whether this is an official registry - Official bool -} - -// SearchResult describes a search result returned from a registry -type SearchResult struct { - // StarCount indicates the number of stars this repository has - StarCount int `json:"star_count"` - // IsOfficial is true if the result is from an official repository. - IsOfficial bool `json:"is_official"` - // Name is the name of the repository - Name string `json:"name"` - // IsAutomated indicates whether the result is automated - IsAutomated bool `json:"is_automated"` - // Description is a textual description of the repository - Description string `json:"description"` -} - -// SearchResults lists a collection search results returned from a registry -type SearchResults struct { - // Query contains the query string that generated the search results - Query string `json:"query"` - // NumResults indicates the number of results the query returned - NumResults int `json:"num_results"` - // Results is a slice containing the actual results for the search - Results []SearchResult `json:"results"` -} diff --git a/vendor/github.com/docker/docker/api/types/seccomp.go b/vendor/github.com/docker/docker/api/types/seccomp.go deleted file mode 100644 index 4f02ef36..00000000 --- a/vendor/github.com/docker/docker/api/types/seccomp.go +++ /dev/null @@ -1,93 +0,0 @@ -package types - -// Seccomp represents the config for a seccomp profile for syscall restriction. -type Seccomp struct { - DefaultAction Action `json:"defaultAction"` - // Architectures is kept to maintain backward compatibility with the old - // seccomp profile. - Architectures []Arch `json:"architectures,omitempty"` - ArchMap []Architecture `json:"archMap,omitempty"` - Syscalls []*Syscall `json:"syscalls"` -} - -// Architecture is used to represent an specific architecture -// and its sub-architectures -type Architecture struct { - Arch Arch `json:"architecture"` - SubArches []Arch `json:"subArchitectures"` -} - -// Arch used for architectures -type Arch string - -// Additional architectures permitted to be used for system calls -// By default only the native architecture of the kernel is permitted -const ( - ArchX86 Arch = "SCMP_ARCH_X86" - ArchX86_64 Arch = "SCMP_ARCH_X86_64" - ArchX32 Arch = "SCMP_ARCH_X32" - ArchARM Arch = "SCMP_ARCH_ARM" - ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" - ArchMIPS Arch = "SCMP_ARCH_MIPS" - ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" - ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" - ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" - ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" - ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" - ArchPPC Arch = "SCMP_ARCH_PPC" - ArchPPC64 Arch = "SCMP_ARCH_PPC64" - ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" - ArchS390 Arch = "SCMP_ARCH_S390" - ArchS390X Arch = "SCMP_ARCH_S390X" -) - -// Action taken upon Seccomp rule match -type Action string - -// Define actions for Seccomp rules -const ( - ActKill Action = "SCMP_ACT_KILL" - ActTrap Action = "SCMP_ACT_TRAP" - ActErrno Action = "SCMP_ACT_ERRNO" - ActTrace Action = "SCMP_ACT_TRACE" - ActAllow Action = "SCMP_ACT_ALLOW" -) - -// Operator used to match syscall arguments in Seccomp -type Operator string - -// Define operators for syscall arguments in Seccomp -const ( - OpNotEqual Operator = "SCMP_CMP_NE" - OpLessThan Operator = "SCMP_CMP_LT" - OpLessEqual Operator = "SCMP_CMP_LE" - OpEqualTo Operator = "SCMP_CMP_EQ" - OpGreaterEqual Operator = "SCMP_CMP_GE" - OpGreaterThan Operator = "SCMP_CMP_GT" - OpMaskedEqual Operator = "SCMP_CMP_MASKED_EQ" -) - -// Arg used for matching specific syscall arguments in Seccomp -type Arg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"valueTwo"` - Op Operator `json:"op"` -} - -// Filter is used to conditionally apply Seccomp rules -type Filter struct { - Caps []string `json:"caps,omitempty"` - Arches []string `json:"arches,omitempty"` -} - -// Syscall is used to match a group of syscalls in Seccomp -type Syscall struct { - Name string `json:"name,omitempty"` - Names []string `json:"names,omitempty"` - Action Action `json:"action"` - Args []*Arg `json:"args"` - Comment string `json:"comment"` - Includes Filter `json:"includes"` - Excludes Filter `json:"excludes"` -} diff --git a/vendor/github.com/docker/docker/api/types/service_update_response.go b/vendor/github.com/docker/docker/api/types/service_update_response.go deleted file mode 100644 index 74ea64b1..00000000 --- a/vendor/github.com/docker/docker/api/types/service_update_response.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// ServiceUpdateResponse service update response -// swagger:model ServiceUpdateResponse -type ServiceUpdateResponse struct { - - // Optional warning messages - Warnings []string `json:"Warnings"` -} diff --git a/vendor/github.com/docker/docker/api/types/stats.go b/vendor/github.com/docker/docker/api/types/stats.go deleted file mode 100644 index 9bf1928b..00000000 --- a/vendor/github.com/docker/docker/api/types/stats.go +++ /dev/null @@ -1,178 +0,0 @@ -// Package types is used for API stability in the types and response to the -// consumers of the API stats endpoint. -package types - -import "time" - -// ThrottlingData stores CPU throttling stats of one running container. -// Not used on Windows. -type ThrottlingData struct { - // Number of periods with throttling active - Periods uint64 `json:"periods"` - // Number of periods when the container hits its throttling limit. - ThrottledPeriods uint64 `json:"throttled_periods"` - // Aggregate time the container was throttled for in nanoseconds. - ThrottledTime uint64 `json:"throttled_time"` -} - -// CPUUsage stores All CPU stats aggregated since container inception. -type CPUUsage struct { - // Total CPU time consumed. - // Units: nanoseconds (Linux) - // Units: 100's of nanoseconds (Windows) - TotalUsage uint64 `json:"total_usage"` - - // Total CPU time consumed per core (Linux). Not used on Windows. - // Units: nanoseconds. - PercpuUsage []uint64 `json:"percpu_usage,omitempty"` - - // Time spent by tasks of the cgroup in kernel mode (Linux). - // Time spent by all container processes in kernel mode (Windows). - // Units: nanoseconds (Linux). - // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers. - UsageInKernelmode uint64 `json:"usage_in_kernelmode"` - - // Time spent by tasks of the cgroup in user mode (Linux). - // Time spent by all container processes in user mode (Windows). - // Units: nanoseconds (Linux). - // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers - UsageInUsermode uint64 `json:"usage_in_usermode"` -} - -// CPUStats aggregates and wraps all CPU related info of container -type CPUStats struct { - // CPU Usage. Linux and Windows. - CPUUsage CPUUsage `json:"cpu_usage"` - - // System Usage. Linux only. - SystemUsage uint64 `json:"system_cpu_usage,omitempty"` - - // Throttling Data. Linux only. - ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` -} - -// MemoryStats aggregates all memory stats since container inception on Linux. -// Windows returns stats for commit and private working set only. -type MemoryStats struct { - // Linux Memory Stats - - // current res_counter usage for memory - Usage uint64 `json:"usage,omitempty"` - // maximum usage ever recorded. - MaxUsage uint64 `json:"max_usage,omitempty"` - // TODO(vishh): Export these as stronger types. - // all the stats exported via memory.stat. - Stats map[string]uint64 `json:"stats,omitempty"` - // number of times memory usage hits limits. - Failcnt uint64 `json:"failcnt,omitempty"` - Limit uint64 `json:"limit,omitempty"` - - // Windows Memory Stats - // See https://technet.microsoft.com/en-us/magazine/ff382715.aspx - - // committed bytes - Commit uint64 `json:"commitbytes,omitempty"` - // peak committed bytes - CommitPeak uint64 `json:"commitpeakbytes,omitempty"` - // private working set - PrivateWorkingSet uint64 `json:"privateworkingset,omitempty"` -} - -// BlkioStatEntry is one small entity to store a piece of Blkio stats -// Not used on Windows. -type BlkioStatEntry struct { - Major uint64 `json:"major"` - Minor uint64 `json:"minor"` - Op string `json:"op"` - Value uint64 `json:"value"` -} - -// BlkioStats stores All IO service stats for data read and write. -// This is a Linux specific structure as the differences between expressing -// block I/O on Windows and Linux are sufficiently significant to make -// little sense attempting to morph into a combined structure. -type BlkioStats struct { - // number of bytes transferred to and from the block device - IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive"` - IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recursive"` - IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive"` - IoServiceTimeRecursive []BlkioStatEntry `json:"io_service_time_recursive"` - IoWaitTimeRecursive []BlkioStatEntry `json:"io_wait_time_recursive"` - IoMergedRecursive []BlkioStatEntry `json:"io_merged_recursive"` - IoTimeRecursive []BlkioStatEntry `json:"io_time_recursive"` - SectorsRecursive []BlkioStatEntry `json:"sectors_recursive"` -} - -// StorageStats is the disk I/O stats for read/write on Windows. -type StorageStats struct { - ReadCountNormalized uint64 `json:"read_count_normalized,omitempty"` - ReadSizeBytes uint64 `json:"read_size_bytes,omitempty"` - WriteCountNormalized uint64 `json:"write_count_normalized,omitempty"` - WriteSizeBytes uint64 `json:"write_size_bytes,omitempty"` -} - -// NetworkStats aggregates the network stats of one container -type NetworkStats struct { - // Bytes received. Windows and Linux. - RxBytes uint64 `json:"rx_bytes"` - // Packets received. Windows and Linux. - RxPackets uint64 `json:"rx_packets"` - // Received errors. Not used on Windows. Note that we dont `omitempty` this - // field as it is expected in the >=v1.21 API stats structure. - RxErrors uint64 `json:"rx_errors"` - // Incoming packets dropped. Windows and Linux. - RxDropped uint64 `json:"rx_dropped"` - // Bytes sent. Windows and Linux. - TxBytes uint64 `json:"tx_bytes"` - // Packets sent. Windows and Linux. - TxPackets uint64 `json:"tx_packets"` - // Sent errors. Not used on Windows. Note that we dont `omitempty` this - // field as it is expected in the >=v1.21 API stats structure. - TxErrors uint64 `json:"tx_errors"` - // Outgoing packets dropped. Windows and Linux. - TxDropped uint64 `json:"tx_dropped"` - // Endpoint ID. Not used on Linux. - EndpointID string `json:"endpoint_id,omitempty"` - // Instance ID. Not used on Linux. - InstanceID string `json:"instance_id,omitempty"` -} - -// PidsStats contains the stats of a container's pids -type PidsStats struct { - // Current is the number of pids in the cgroup - Current uint64 `json:"current,omitempty"` - // Limit is the hard limit on the number of pids in the cgroup. - // A "Limit" of 0 means that there is no limit. - Limit uint64 `json:"limit,omitempty"` -} - -// Stats is Ultimate struct aggregating all types of stats of one container -type Stats struct { - // Common stats - Read time.Time `json:"read"` - PreRead time.Time `json:"preread"` - - // Linux specific stats, not populated on Windows. - PidsStats PidsStats `json:"pids_stats,omitempty"` - BlkioStats BlkioStats `json:"blkio_stats,omitempty"` - - // Windows specific stats, not populated on Linux. - NumProcs uint32 `json:"num_procs"` - StorageStats StorageStats `json:"storage_stats,omitempty"` - - // Shared stats - CPUStats CPUStats `json:"cpu_stats,omitempty"` - PreCPUStats CPUStats `json:"precpu_stats,omitempty"` // "Pre"="Previous" - MemoryStats MemoryStats `json:"memory_stats,omitempty"` -} - -// StatsJSON is newly used Networks -type StatsJSON struct { - Stats - - Name string `json:"name,omitempty"` - ID string `json:"id,omitempty"` - - // Networks request version >=1.21 - Networks map[string]NetworkStats `json:"networks,omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/strslice/strslice.go b/vendor/github.com/docker/docker/api/types/strslice/strslice.go deleted file mode 100644 index bad493fb..00000000 --- a/vendor/github.com/docker/docker/api/types/strslice/strslice.go +++ /dev/null @@ -1,30 +0,0 @@ -package strslice - -import "encoding/json" - -// StrSlice represents a string or an array of strings. -// We need to override the json decoder to accept both options. -type StrSlice []string - -// UnmarshalJSON decodes the byte slice whether it's a string or an array of -// strings. This method is needed to implement json.Unmarshaler. -func (e *StrSlice) UnmarshalJSON(b []byte) error { - if len(b) == 0 { - // With no input, we preserve the existing value by returning nil and - // leaving the target alone. This allows defining default values for - // the type. - return nil - } - - p := make([]string, 0, 1) - if err := json.Unmarshal(b, &p); err != nil { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - p = append(p, s) - } - - *e = p - return nil -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/common.go b/vendor/github.com/docker/docker/api/types/swarm/common.go deleted file mode 100644 index 64a648ba..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/common.go +++ /dev/null @@ -1,27 +0,0 @@ -package swarm - -import "time" - -// Version represents the internal object version. -type Version struct { - Index uint64 `json:",omitempty"` -} - -// Meta is a base object inherited by most of the other once. -type Meta struct { - Version Version `json:",omitempty"` - CreatedAt time.Time `json:",omitempty"` - UpdatedAt time.Time `json:",omitempty"` -} - -// Annotations represents how to describe an object. -type Annotations struct { - Name string `json:",omitempty"` - Labels map[string]string `json:",omitempty"` -} - -// Driver represents a driver (network, logging). -type Driver struct { - Name string `json:",omitempty"` - Options map[string]string `json:",omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/container.go b/vendor/github.com/docker/docker/api/types/swarm/container.go deleted file mode 100644 index 4ab476cc..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/container.go +++ /dev/null @@ -1,46 +0,0 @@ -package swarm - -import ( - "time" - - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/mount" -) - -// DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) -// Detailed documentation is available in: -// http://man7.org/linux/man-pages/man5/resolv.conf.5.html -// `nameserver`, `search`, `options` have been supported. -// TODO: `domain` is not supported yet. -type DNSConfig struct { - // Nameservers specifies the IP addresses of the name servers - Nameservers []string `json:",omitempty"` - // Search specifies the search list for host-name lookup - Search []string `json:",omitempty"` - // Options allows certain internal resolver variables to be modified - Options []string `json:",omitempty"` -} - -// ContainerSpec represents the spec of a container. -type ContainerSpec struct { - Image string `json:",omitempty"` - Labels map[string]string `json:",omitempty"` - Command []string `json:",omitempty"` - Args []string `json:",omitempty"` - Hostname string `json:",omitempty"` - Env []string `json:",omitempty"` - Dir string `json:",omitempty"` - User string `json:",omitempty"` - Groups []string `json:",omitempty"` - TTY bool `json:",omitempty"` - OpenStdin bool `json:",omitempty"` - Mounts []mount.Mount `json:",omitempty"` - StopGracePeriod *time.Duration `json:",omitempty"` - Healthcheck *container.HealthConfig `json:",omitempty"` - // The format of extra hosts on swarmkit is specified in: - // http://man7.org/linux/man-pages/man5/hosts.5.html - // IP_address canonical_hostname [aliases...] - Hosts []string `json:",omitempty"` - DNSConfig *DNSConfig `json:",omitempty"` - Secrets []*SecretReference `json:",omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/network.go b/vendor/github.com/docker/docker/api/types/swarm/network.go deleted file mode 100644 index 5a5e11bd..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/network.go +++ /dev/null @@ -1,111 +0,0 @@ -package swarm - -// Endpoint represents an endpoint. -type Endpoint struct { - Spec EndpointSpec `json:",omitempty"` - Ports []PortConfig `json:",omitempty"` - VirtualIPs []EndpointVirtualIP `json:",omitempty"` -} - -// EndpointSpec represents the spec of an endpoint. -type EndpointSpec struct { - Mode ResolutionMode `json:",omitempty"` - Ports []PortConfig `json:",omitempty"` -} - -// ResolutionMode represents a resolution mode. -type ResolutionMode string - -const ( - // ResolutionModeVIP VIP - ResolutionModeVIP ResolutionMode = "vip" - // ResolutionModeDNSRR DNSRR - ResolutionModeDNSRR ResolutionMode = "dnsrr" -) - -// PortConfig represents the config of a port. -type PortConfig struct { - Name string `json:",omitempty"` - Protocol PortConfigProtocol `json:",omitempty"` - // TargetPort is the port inside the container - TargetPort uint32 `json:",omitempty"` - // PublishedPort is the port on the swarm hosts - PublishedPort uint32 `json:",omitempty"` - // PublishMode is the mode in which port is published - PublishMode PortConfigPublishMode `json:",omitempty"` -} - -// PortConfigPublishMode represents the mode in which the port is to -// be published. -type PortConfigPublishMode string - -const ( - // PortConfigPublishModeIngress is used for ports published - // for ingress load balancing using routing mesh. - PortConfigPublishModeIngress PortConfigPublishMode = "ingress" - // PortConfigPublishModeHost is used for ports published - // for direct host level access on the host where the task is running. - PortConfigPublishModeHost PortConfigPublishMode = "host" -) - -// PortConfigProtocol represents the protocol of a port. -type PortConfigProtocol string - -const ( - // TODO(stevvooe): These should be used generally, not just for PortConfig. - - // PortConfigProtocolTCP TCP - PortConfigProtocolTCP PortConfigProtocol = "tcp" - // PortConfigProtocolUDP UDP - PortConfigProtocolUDP PortConfigProtocol = "udp" -) - -// EndpointVirtualIP represents the virtual ip of a port. -type EndpointVirtualIP struct { - NetworkID string `json:",omitempty"` - Addr string `json:",omitempty"` -} - -// Network represents a network. -type Network struct { - ID string - Meta - Spec NetworkSpec `json:",omitempty"` - DriverState Driver `json:",omitempty"` - IPAMOptions *IPAMOptions `json:",omitempty"` -} - -// NetworkSpec represents the spec of a network. -type NetworkSpec struct { - Annotations - DriverConfiguration *Driver `json:",omitempty"` - IPv6Enabled bool `json:",omitempty"` - Internal bool `json:",omitempty"` - Attachable bool `json:",omitempty"` - IPAMOptions *IPAMOptions `json:",omitempty"` -} - -// NetworkAttachmentConfig represents the configuration of a network attachment. -type NetworkAttachmentConfig struct { - Target string `json:",omitempty"` - Aliases []string `json:",omitempty"` -} - -// NetworkAttachment represents a network attachment. -type NetworkAttachment struct { - Network Network `json:",omitempty"` - Addresses []string `json:",omitempty"` -} - -// IPAMOptions represents ipam options. -type IPAMOptions struct { - Driver Driver `json:",omitempty"` - Configs []IPAMConfig `json:",omitempty"` -} - -// IPAMConfig represents ipam configuration. -type IPAMConfig struct { - Subnet string `json:",omitempty"` - Range string `json:",omitempty"` - Gateway string `json:",omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/node.go b/vendor/github.com/docker/docker/api/types/swarm/node.go deleted file mode 100644 index 379e17a7..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/node.go +++ /dev/null @@ -1,114 +0,0 @@ -package swarm - -// Node represents a node. -type Node struct { - ID string - Meta - // Spec defines the desired state of the node as specified by the user. - // The system will honor this and will *never* modify it. - Spec NodeSpec `json:",omitempty"` - // Description encapsulates the properties of the Node as reported by the - // agent. - Description NodeDescription `json:",omitempty"` - // Status provides the current status of the node, as seen by the manager. - Status NodeStatus `json:",omitempty"` - // ManagerStatus provides the current status of the node's manager - // component, if the node is a manager. - ManagerStatus *ManagerStatus `json:",omitempty"` -} - -// NodeSpec represents the spec of a node. -type NodeSpec struct { - Annotations - Role NodeRole `json:",omitempty"` - Availability NodeAvailability `json:",omitempty"` -} - -// NodeRole represents the role of a node. -type NodeRole string - -const ( - // NodeRoleWorker WORKER - NodeRoleWorker NodeRole = "worker" - // NodeRoleManager MANAGER - NodeRoleManager NodeRole = "manager" -) - -// NodeAvailability represents the availability of a node. -type NodeAvailability string - -const ( - // NodeAvailabilityActive ACTIVE - NodeAvailabilityActive NodeAvailability = "active" - // NodeAvailabilityPause PAUSE - NodeAvailabilityPause NodeAvailability = "pause" - // NodeAvailabilityDrain DRAIN - NodeAvailabilityDrain NodeAvailability = "drain" -) - -// NodeDescription represents the description of a node. -type NodeDescription struct { - Hostname string `json:",omitempty"` - Platform Platform `json:",omitempty"` - Resources Resources `json:",omitempty"` - Engine EngineDescription `json:",omitempty"` -} - -// Platform represents the platform (Arch/OS). -type Platform struct { - Architecture string `json:",omitempty"` - OS string `json:",omitempty"` -} - -// EngineDescription represents the description of an engine. -type EngineDescription struct { - EngineVersion string `json:",omitempty"` - Labels map[string]string `json:",omitempty"` - Plugins []PluginDescription `json:",omitempty"` -} - -// PluginDescription represents the description of an engine plugin. -type PluginDescription struct { - Type string `json:",omitempty"` - Name string `json:",omitempty"` -} - -// NodeStatus represents the status of a node. -type NodeStatus struct { - State NodeState `json:",omitempty"` - Message string `json:",omitempty"` - Addr string `json:",omitempty"` -} - -// Reachability represents the reachability of a node. -type Reachability string - -const ( - // ReachabilityUnknown UNKNOWN - ReachabilityUnknown Reachability = "unknown" - // ReachabilityUnreachable UNREACHABLE - ReachabilityUnreachable Reachability = "unreachable" - // ReachabilityReachable REACHABLE - ReachabilityReachable Reachability = "reachable" -) - -// ManagerStatus represents the status of a manager. -type ManagerStatus struct { - Leader bool `json:",omitempty"` - Reachability Reachability `json:",omitempty"` - Addr string `json:",omitempty"` -} - -// NodeState represents the state of a node. -type NodeState string - -const ( - // NodeStateUnknown UNKNOWN - NodeStateUnknown NodeState = "unknown" - // NodeStateDown DOWN - NodeStateDown NodeState = "down" - // NodeStateReady READY - NodeStateReady NodeState = "ready" - // NodeStateDisconnected DISCONNECTED - NodeStateDisconnected NodeState = "disconnected" -) diff --git a/vendor/github.com/docker/docker/api/types/swarm/secret.go b/vendor/github.com/docker/docker/api/types/swarm/secret.go deleted file mode 100644 index fdb23888..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/secret.go +++ /dev/null @@ -1,31 +0,0 @@ -package swarm - -import "os" - -// Secret represents a secret. -type Secret struct { - ID string - Meta - Spec SecretSpec -} - -// SecretSpec represents a secret specification from a secret in swarm -type SecretSpec struct { - Annotations - Data []byte `json:",omitempty"` -} - -// SecretReferenceFileTarget is a file target in a secret reference -type SecretReferenceFileTarget struct { - Name string - UID string - GID string - Mode os.FileMode -} - -// SecretReference is a reference to a secret in swarm -type SecretReference struct { - File *SecretReferenceFileTarget - SecretID string - SecretName string -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/service.go b/vendor/github.com/docker/docker/api/types/swarm/service.go deleted file mode 100644 index 2cf2642c..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/service.go +++ /dev/null @@ -1,105 +0,0 @@ -package swarm - -import "time" - -// Service represents a service. -type Service struct { - ID string - Meta - Spec ServiceSpec `json:",omitempty"` - PreviousSpec *ServiceSpec `json:",omitempty"` - Endpoint Endpoint `json:",omitempty"` - UpdateStatus UpdateStatus `json:",omitempty"` -} - -// ServiceSpec represents the spec of a service. -type ServiceSpec struct { - Annotations - - // TaskTemplate defines how the service should construct new tasks when - // orchestrating this service. - TaskTemplate TaskSpec `json:",omitempty"` - Mode ServiceMode `json:",omitempty"` - UpdateConfig *UpdateConfig `json:",omitempty"` - - // Networks field in ServiceSpec is deprecated. The - // same field in TaskSpec should be used instead. - // This field will be removed in a future release. - Networks []NetworkAttachmentConfig `json:",omitempty"` - EndpointSpec *EndpointSpec `json:",omitempty"` -} - -// ServiceMode represents the mode of a service. -type ServiceMode struct { - Replicated *ReplicatedService `json:",omitempty"` - Global *GlobalService `json:",omitempty"` -} - -// UpdateState is the state of a service update. -type UpdateState string - -const ( - // UpdateStateUpdating is the updating state. - UpdateStateUpdating UpdateState = "updating" - // UpdateStatePaused is the paused state. - UpdateStatePaused UpdateState = "paused" - // UpdateStateCompleted is the completed state. - UpdateStateCompleted UpdateState = "completed" -) - -// UpdateStatus reports the status of a service update. -type UpdateStatus struct { - State UpdateState `json:",omitempty"` - StartedAt time.Time `json:",omitempty"` - CompletedAt time.Time `json:",omitempty"` - Message string `json:",omitempty"` -} - -// ReplicatedService is a kind of ServiceMode. -type ReplicatedService struct { - Replicas *uint64 `json:",omitempty"` -} - -// GlobalService is a kind of ServiceMode. -type GlobalService struct{} - -const ( - // UpdateFailureActionPause PAUSE - UpdateFailureActionPause = "pause" - // UpdateFailureActionContinue CONTINUE - UpdateFailureActionContinue = "continue" -) - -// UpdateConfig represents the update configuration. -type UpdateConfig struct { - // Maximum number of tasks to be updated in one iteration. - // 0 means unlimited parallelism. - Parallelism uint64 - - // Amount of time between updates. - Delay time.Duration `json:",omitempty"` - - // FailureAction is the action to take when an update failures. - FailureAction string `json:",omitempty"` - - // Monitor indicates how long to monitor a task for failure after it is - // created. If the task fails by ending up in one of the states - // REJECTED, COMPLETED, or FAILED, within Monitor from its creation, - // this counts as a failure. If it fails after Monitor, it does not - // count as a failure. If Monitor is unspecified, a default value will - // be used. - Monitor time.Duration `json:",omitempty"` - - // MaxFailureRatio is the fraction of tasks that may fail during - // an update before the failure action is invoked. Any task created by - // the current update which ends up in one of the states REJECTED, - // COMPLETED or FAILED within Monitor from its creation counts as a - // failure. The number of failures is divided by the number of tasks - // being updated, and if this fraction is greater than - // MaxFailureRatio, the failure action is invoked. - // - // If the failure action is CONTINUE, there is no effect. - // If the failure action is PAUSE, no more tasks will be updated until - // another update is started. - MaxFailureRatio float32 -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/swarm.go b/vendor/github.com/docker/docker/api/types/swarm/swarm.go deleted file mode 100644 index 0b422196..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/swarm.go +++ /dev/null @@ -1,197 +0,0 @@ -package swarm - -import "time" - -// ClusterInfo represents info about the cluster for outputing in "info" -// it contains the same information as "Swarm", but without the JoinTokens -type ClusterInfo struct { - ID string - Meta - Spec Spec -} - -// Swarm represents a swarm. -type Swarm struct { - ClusterInfo - JoinTokens JoinTokens -} - -// JoinTokens contains the tokens workers and managers need to join the swarm. -type JoinTokens struct { - // Worker is the join token workers may use to join the swarm. - Worker string - // Manager is the join token managers may use to join the swarm. - Manager string -} - -// Spec represents the spec of a swarm. -type Spec struct { - Annotations - - Orchestration OrchestrationConfig `json:",omitempty"` - Raft RaftConfig `json:",omitempty"` - Dispatcher DispatcherConfig `json:",omitempty"` - CAConfig CAConfig `json:",omitempty"` - TaskDefaults TaskDefaults `json:",omitempty"` - EncryptionConfig EncryptionConfig `json:",omitempty"` -} - -// OrchestrationConfig represents orchestration configuration. -type OrchestrationConfig struct { - // TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or - // node. If negative, never remove completed or failed tasks. - TaskHistoryRetentionLimit *int64 `json:",omitempty"` -} - -// TaskDefaults parameterizes cluster-level task creation with default values. -type TaskDefaults struct { - // LogDriver selects the log driver to use for tasks created in the - // orchestrator if unspecified by a service. - // - // Updating this value will only have an affect on new tasks. Old tasks - // will continue use their previously configured log driver until - // recreated. - LogDriver *Driver `json:",omitempty"` -} - -// EncryptionConfig controls at-rest encryption of data and keys. -type EncryptionConfig struct { - // AutoLockManagers specifies whether or not managers TLS keys and raft data - // should be encrypted at rest in such a way that they must be unlocked - // before the manager node starts up again. - AutoLockManagers bool -} - -// RaftConfig represents raft configuration. -type RaftConfig struct { - // SnapshotInterval is the number of log entries between snapshots. - SnapshotInterval uint64 `json:",omitempty"` - - // KeepOldSnapshots is the number of snapshots to keep beyond the - // current snapshot. - KeepOldSnapshots *uint64 `json:",omitempty"` - - // LogEntriesForSlowFollowers is the number of log entries to keep - // around to sync up slow followers after a snapshot is created. - LogEntriesForSlowFollowers uint64 `json:",omitempty"` - - // ElectionTick is the number of ticks that a follower will wait for a message - // from the leader before becoming a candidate and starting an election. - // ElectionTick must be greater than HeartbeatTick. - // - // A tick currently defaults to one second, so these translate directly to - // seconds currently, but this is NOT guaranteed. - ElectionTick int - - // HeartbeatTick is the number of ticks between heartbeats. Every - // HeartbeatTick ticks, the leader will send a heartbeat to the - // followers. - // - // A tick currently defaults to one second, so these translate directly to - // seconds currently, but this is NOT guaranteed. - HeartbeatTick int -} - -// DispatcherConfig represents dispatcher configuration. -type DispatcherConfig struct { - // HeartbeatPeriod defines how often agent should send heartbeats to - // dispatcher. - HeartbeatPeriod time.Duration `json:",omitempty"` -} - -// CAConfig represents CA configuration. -type CAConfig struct { - // NodeCertExpiry is the duration certificates should be issued for - NodeCertExpiry time.Duration `json:",omitempty"` - - // ExternalCAs is a list of CAs to which a manager node will make - // certificate signing requests for node certificates. - ExternalCAs []*ExternalCA `json:",omitempty"` -} - -// ExternalCAProtocol represents type of external CA. -type ExternalCAProtocol string - -// ExternalCAProtocolCFSSL CFSSL -const ExternalCAProtocolCFSSL ExternalCAProtocol = "cfssl" - -// ExternalCA defines external CA to be used by the cluster. -type ExternalCA struct { - // Protocol is the protocol used by this external CA. - Protocol ExternalCAProtocol - - // URL is the URL where the external CA can be reached. - URL string - - // Options is a set of additional key/value pairs whose interpretation - // depends on the specified CA type. - Options map[string]string `json:",omitempty"` -} - -// InitRequest is the request used to init a swarm. -type InitRequest struct { - ListenAddr string - AdvertiseAddr string - ForceNewCluster bool - Spec Spec - AutoLockManagers bool -} - -// JoinRequest is the request used to join a swarm. -type JoinRequest struct { - ListenAddr string - AdvertiseAddr string - RemoteAddrs []string - JoinToken string // accept by secret -} - -// UnlockRequest is the request used to unlock a swarm. -type UnlockRequest struct { - // UnlockKey is the unlock key in ASCII-armored format. - UnlockKey string -} - -// LocalNodeState represents the state of the local node. -type LocalNodeState string - -const ( - // LocalNodeStateInactive INACTIVE - LocalNodeStateInactive LocalNodeState = "inactive" - // LocalNodeStatePending PENDING - LocalNodeStatePending LocalNodeState = "pending" - // LocalNodeStateActive ACTIVE - LocalNodeStateActive LocalNodeState = "active" - // LocalNodeStateError ERROR - LocalNodeStateError LocalNodeState = "error" - // LocalNodeStateLocked LOCKED - LocalNodeStateLocked LocalNodeState = "locked" -) - -// Info represents generic information about swarm. -type Info struct { - NodeID string - NodeAddr string - - LocalNodeState LocalNodeState - ControlAvailable bool - Error string - - RemoteManagers []Peer - Nodes int - Managers int - - Cluster ClusterInfo -} - -// Peer represents a peer. -type Peer struct { - NodeID string - Addr string -} - -// UpdateFlags contains flags for SwarmUpdate. -type UpdateFlags struct { - RotateWorkerToken bool - RotateManagerToken bool - RotateManagerUnlockKey bool -} diff --git a/vendor/github.com/docker/docker/api/types/swarm/task.go b/vendor/github.com/docker/docker/api/types/swarm/task.go deleted file mode 100644 index ace12cc8..00000000 --- a/vendor/github.com/docker/docker/api/types/swarm/task.go +++ /dev/null @@ -1,128 +0,0 @@ -package swarm - -import "time" - -// TaskState represents the state of a task. -type TaskState string - -const ( - // TaskStateNew NEW - TaskStateNew TaskState = "new" - // TaskStateAllocated ALLOCATED - TaskStateAllocated TaskState = "allocated" - // TaskStatePending PENDING - TaskStatePending TaskState = "pending" - // TaskStateAssigned ASSIGNED - TaskStateAssigned TaskState = "assigned" - // TaskStateAccepted ACCEPTED - TaskStateAccepted TaskState = "accepted" - // TaskStatePreparing PREPARING - TaskStatePreparing TaskState = "preparing" - // TaskStateReady READY - TaskStateReady TaskState = "ready" - // TaskStateStarting STARTING - TaskStateStarting TaskState = "starting" - // TaskStateRunning RUNNING - TaskStateRunning TaskState = "running" - // TaskStateComplete COMPLETE - TaskStateComplete TaskState = "complete" - // TaskStateShutdown SHUTDOWN - TaskStateShutdown TaskState = "shutdown" - // TaskStateFailed FAILED - TaskStateFailed TaskState = "failed" - // TaskStateRejected REJECTED - TaskStateRejected TaskState = "rejected" -) - -// Task represents a task. -type Task struct { - ID string - Meta - Annotations - - Spec TaskSpec `json:",omitempty"` - ServiceID string `json:",omitempty"` - Slot int `json:",omitempty"` - NodeID string `json:",omitempty"` - Status TaskStatus `json:",omitempty"` - DesiredState TaskState `json:",omitempty"` - NetworksAttachments []NetworkAttachment `json:",omitempty"` -} - -// TaskSpec represents the spec of a task. -type TaskSpec struct { - ContainerSpec ContainerSpec `json:",omitempty"` - Resources *ResourceRequirements `json:",omitempty"` - RestartPolicy *RestartPolicy `json:",omitempty"` - Placement *Placement `json:",omitempty"` - Networks []NetworkAttachmentConfig `json:",omitempty"` - - // LogDriver specifies the LogDriver to use for tasks created from this - // spec. If not present, the one on cluster default on swarm.Spec will be - // used, finally falling back to the engine default if not specified. - LogDriver *Driver `json:",omitempty"` - - // ForceUpdate is a counter that triggers an update even if no relevant - // parameters have been changed. - ForceUpdate uint64 -} - -// Resources represents resources (CPU/Memory). -type Resources struct { - NanoCPUs int64 `json:",omitempty"` - MemoryBytes int64 `json:",omitempty"` -} - -// ResourceRequirements represents resources requirements. -type ResourceRequirements struct { - Limits *Resources `json:",omitempty"` - Reservations *Resources `json:",omitempty"` -} - -// Placement represents orchestration parameters. -type Placement struct { - Constraints []string `json:",omitempty"` -} - -// RestartPolicy represents the restart policy. -type RestartPolicy struct { - Condition RestartPolicyCondition `json:",omitempty"` - Delay *time.Duration `json:",omitempty"` - MaxAttempts *uint64 `json:",omitempty"` - Window *time.Duration `json:",omitempty"` -} - -// RestartPolicyCondition represents when to restart. -type RestartPolicyCondition string - -const ( - // RestartPolicyConditionNone NONE - RestartPolicyConditionNone RestartPolicyCondition = "none" - // RestartPolicyConditionOnFailure ON_FAILURE - RestartPolicyConditionOnFailure RestartPolicyCondition = "on-failure" - // RestartPolicyConditionAny ANY - RestartPolicyConditionAny RestartPolicyCondition = "any" -) - -// TaskStatus represents the status of a task. -type TaskStatus struct { - Timestamp time.Time `json:",omitempty"` - State TaskState `json:",omitempty"` - Message string `json:",omitempty"` - Err string `json:",omitempty"` - ContainerStatus ContainerStatus `json:",omitempty"` - PortStatus PortStatus `json:",omitempty"` -} - -// ContainerStatus represents the status of a container. -type ContainerStatus struct { - ContainerID string `json:",omitempty"` - PID int `json:",omitempty"` - ExitCode int `json:",omitempty"` -} - -// PortStatus represents the port status of a task's host ports whose -// service has published host ports -type PortStatus struct { - Ports []PortConfig `json:",omitempty"` -} diff --git a/vendor/github.com/docker/docker/api/types/time/duration_convert.go b/vendor/github.com/docker/docker/api/types/time/duration_convert.go deleted file mode 100644 index 63e1eec1..00000000 --- a/vendor/github.com/docker/docker/api/types/time/duration_convert.go +++ /dev/null @@ -1,12 +0,0 @@ -package time - -import ( - "strconv" - "time" -) - -// DurationToSecondsString converts the specified duration to the number -// seconds it represents, formatted as a string. -func DurationToSecondsString(duration time.Duration) string { - return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64) -} diff --git a/vendor/github.com/docker/docker/api/types/time/timestamp.go b/vendor/github.com/docker/docker/api/types/time/timestamp.go deleted file mode 100644 index d3695ba7..00000000 --- a/vendor/github.com/docker/docker/api/types/time/timestamp.go +++ /dev/null @@ -1,124 +0,0 @@ -package time - -import ( - "fmt" - "math" - "strconv" - "strings" - "time" -) - -// These are additional predefined layouts for use in Time.Format and Time.Parse -// with --since and --until parameters for `docker logs` and `docker events` -const ( - rFC3339Local = "2006-01-02T15:04:05" // RFC3339 with local timezone - rFC3339NanoLocal = "2006-01-02T15:04:05.999999999" // RFC3339Nano with local timezone - dateWithZone = "2006-01-02Z07:00" // RFC3339 with time at 00:00:00 - dateLocal = "2006-01-02" // RFC3339 with local timezone and time at 00:00:00 -) - -// GetTimestamp tries to parse given string as golang duration, -// then RFC3339 time and finally as a Unix timestamp. If -// any of these were successful, it returns a Unix timestamp -// as string otherwise returns the given value back. -// In case of duration input, the returned timestamp is computed -// as the given reference time minus the amount of the duration. -func GetTimestamp(value string, reference time.Time) (string, error) { - if d, err := time.ParseDuration(value); value != "0" && err == nil { - return strconv.FormatInt(reference.Add(-d).Unix(), 10), nil - } - - var format string - var parseInLocation bool - - // if the string has a Z or a + or three dashes use parse otherwise use parseinlocation - parseInLocation = !(strings.ContainsAny(value, "zZ+") || strings.Count(value, "-") == 3) - - if strings.Contains(value, ".") { - if parseInLocation { - format = rFC3339NanoLocal - } else { - format = time.RFC3339Nano - } - } else if strings.Contains(value, "T") { - // we want the number of colons in the T portion of the timestamp - tcolons := strings.Count(value, ":") - // if parseInLocation is off and we have a +/- zone offset (not Z) then - // there will be an extra colon in the input for the tz offset subtract that - // colon from the tcolons count - if !parseInLocation && !strings.ContainsAny(value, "zZ") && tcolons > 0 { - tcolons-- - } - if parseInLocation { - switch tcolons { - case 0: - format = "2006-01-02T15" - case 1: - format = "2006-01-02T15:04" - default: - format = rFC3339Local - } - } else { - switch tcolons { - case 0: - format = "2006-01-02T15Z07:00" - case 1: - format = "2006-01-02T15:04Z07:00" - default: - format = time.RFC3339 - } - } - } else if parseInLocation { - format = dateLocal - } else { - format = dateWithZone - } - - var t time.Time - var err error - - if parseInLocation { - t, err = time.ParseInLocation(format, value, time.FixedZone(reference.Zone())) - } else { - t, err = time.Parse(format, value) - } - - if err != nil { - // if there is a `-` then its an RFC3339 like timestamp otherwise assume unixtimestamp - if strings.Contains(value, "-") { - return "", err // was probably an RFC3339 like timestamp but the parser failed with an error - } - return value, nil // unixtimestamp in and out case (meaning: the value passed at the command line is already in the right format for passing to the server) - } - - return fmt.Sprintf("%d.%09d", t.Unix(), int64(t.Nanosecond())), nil -} - -// ParseTimestamps returns seconds and nanoseconds from a timestamp that has the -// format "%d.%09d", time.Unix(), int64(time.Nanosecond())) -// if the incoming nanosecond portion is longer or shorter than 9 digits it is -// converted to nanoseconds. The expectation is that the seconds and -// seconds will be used to create a time variable. For example: -// seconds, nanoseconds, err := ParseTimestamp("1136073600.000000001",0) -// if err == nil since := time.Unix(seconds, nanoseconds) -// returns seconds as def(aultSeconds) if value == "" -func ParseTimestamps(value string, def int64) (int64, int64, error) { - if value == "" { - return def, 0, nil - } - sa := strings.SplitN(value, ".", 2) - s, err := strconv.ParseInt(sa[0], 10, 64) - if err != nil { - return s, 0, err - } - if len(sa) != 2 { - return s, 0, nil - } - n, err := strconv.ParseInt(sa[1], 10, 64) - if err != nil { - return s, n, err - } - // should already be in nanoseconds but just in case convert n to nanoseonds - n = int64(float64(n) * math.Pow(float64(10), float64(9-len(sa[1])))) - return s, n, nil -} diff --git a/vendor/github.com/docker/docker/api/types/types.go b/vendor/github.com/docker/docker/api/types/types.go deleted file mode 100644 index a82c3e88..00000000 --- a/vendor/github.com/docker/docker/api/types/types.go +++ /dev/null @@ -1,549 +0,0 @@ -package types - -import ( - "errors" - "fmt" - "io" - "os" - "strings" - "time" - - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/mount" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - "github.com/docker/go-connections/nat" -) - -// ContainerChange contains response of Engine API: -// GET "/containers/{name:.*}/changes" -type ContainerChange struct { - Kind int - Path string -} - -// ImageHistory contains response of Engine API: -// GET "/images/{name:.*}/history" -type ImageHistory struct { - ID string `json:"Id"` - Created int64 - CreatedBy string - Tags []string - Size int64 - Comment string -} - -// ImageDelete contains response of Engine API: -// DELETE "/images/{name:.*}" -type ImageDelete struct { - Untagged string `json:",omitempty"` - Deleted string `json:",omitempty"` -} - -// GraphDriverData returns Image's graph driver config info -// when calling inspect command -type GraphDriverData struct { - Name string - Data map[string]string -} - -// RootFS returns Image's RootFS description including the layer IDs. -type RootFS struct { - Type string - Layers []string `json:",omitempty"` - BaseLayer string `json:",omitempty"` -} - -// ImageInspect contains response of Engine API: -// GET "/images/{name:.*}/json" -type ImageInspect struct { - ID string `json:"Id"` - RepoTags []string - RepoDigests []string - Parent string - Comment string - Created string - Container string - ContainerConfig *container.Config - DockerVersion string - Author string - Config *container.Config - Architecture string - Os string - OsVersion string `json:",omitempty"` - Size int64 - VirtualSize int64 - GraphDriver GraphDriverData - RootFS RootFS -} - -// Container contains response of Engine API: -// GET "/containers/json" -type Container struct { - ID string `json:"Id"` - Names []string - Image string - ImageID string - Command string - Created int64 - Ports []Port - SizeRw int64 `json:",omitempty"` - SizeRootFs int64 `json:",omitempty"` - Labels map[string]string - State string - Status string - HostConfig struct { - NetworkMode string `json:",omitempty"` - } - NetworkSettings *SummaryNetworkSettings - Mounts []MountPoint -} - -// CopyConfig contains request body of Engine API: -// POST "/containers/"+containerID+"/copy" -type CopyConfig struct { - Resource string -} - -// ContainerPathStat is used to encode the header from -// GET "/containers/{name:.*}/archive" -// "Name" is the file or directory name. -type ContainerPathStat struct { - Name string `json:"name"` - Size int64 `json:"size"` - Mode os.FileMode `json:"mode"` - Mtime time.Time `json:"mtime"` - LinkTarget string `json:"linkTarget"` -} - -// ContainerStats contains response of Engine API: -// GET "/stats" -type ContainerStats struct { - Body io.ReadCloser `json:"body"` - OSType string `json:"ostype"` -} - -// ContainerProcessList contains response of Engine API: -// GET "/containers/{name:.*}/top" -type ContainerProcessList struct { - Processes [][]string - Titles []string -} - -// Ping contains response of Engine API: -// GET "/_ping" -type Ping struct { - APIVersion string - Experimental bool -} - -// Version contains response of Engine API: -// GET "/version" -type Version struct { - Version string - APIVersion string `json:"ApiVersion"` - MinAPIVersion string `json:"MinAPIVersion,omitempty"` - GitCommit string - GoVersion string - Os string - Arch string - KernelVersion string `json:",omitempty"` - Experimental bool `json:",omitempty"` - BuildTime string `json:",omitempty"` -} - -// Commit records a external tool actual commit id version along the -// one expect by dockerd as set at build time -type Commit struct { - ID string - Expected string -} - -// Info contains response of Engine API: -// GET "/info" -type Info struct { - ID string - Containers int - ContainersRunning int - ContainersPaused int - ContainersStopped int - Images int - Driver string - DriverStatus [][2]string - SystemStatus [][2]string - Plugins PluginsInfo - MemoryLimit bool - SwapLimit bool - KernelMemory bool - CPUCfsPeriod bool `json:"CpuCfsPeriod"` - CPUCfsQuota bool `json:"CpuCfsQuota"` - CPUShares bool - CPUSet bool - IPv4Forwarding bool - BridgeNfIptables bool - BridgeNfIP6tables bool `json:"BridgeNfIp6tables"` - Debug bool - NFd int - OomKillDisable bool - NGoroutines int - SystemTime string - LoggingDriver string - CgroupDriver string - NEventsListener int - KernelVersion string - OperatingSystem string - OSType string - Architecture string - IndexServerAddress string - RegistryConfig *registry.ServiceConfig - NCPU int - MemTotal int64 - DockerRootDir string - HTTPProxy string `json:"HttpProxy"` - HTTPSProxy string `json:"HttpsProxy"` - NoProxy string - Name string - Labels []string - ExperimentalBuild bool - ServerVersion string - ClusterStore string - ClusterAdvertise string - Runtimes map[string]Runtime - DefaultRuntime string - Swarm swarm.Info - // LiveRestoreEnabled determines whether containers should be kept - // running when the daemon is shutdown or upon daemon start if - // running containers are detected - LiveRestoreEnabled bool - Isolation container.Isolation - InitBinary string - ContainerdCommit Commit - RuncCommit Commit - InitCommit Commit - SecurityOptions []string -} - -// KeyValue holds a key/value pair -type KeyValue struct { - Key, Value string -} - -// SecurityOpt contains the name and options of a security option -type SecurityOpt struct { - Name string - Options []KeyValue -} - -// DecodeSecurityOptions decodes a security options string slice to a type safe -// SecurityOpt -func DecodeSecurityOptions(opts []string) ([]SecurityOpt, error) { - so := []SecurityOpt{} - for _, opt := range opts { - // support output from a < 1.13 docker daemon - if !strings.Contains(opt, "=") { - so = append(so, SecurityOpt{Name: opt}) - continue - } - secopt := SecurityOpt{} - split := strings.Split(opt, ",") - for _, s := range split { - kv := strings.SplitN(s, "=", 2) - if len(kv) != 2 { - return nil, fmt.Errorf("invalid security option %q", s) - } - if kv[0] == "" || kv[1] == "" { - return nil, errors.New("invalid empty security option") - } - if kv[0] == "name" { - secopt.Name = kv[1] - continue - } - secopt.Options = append(secopt.Options, KeyValue{Key: kv[0], Value: kv[1]}) - } - so = append(so, secopt) - } - return so, nil -} - -// PluginsInfo is a temp struct holding Plugins name -// registered with docker daemon. It is used by Info struct -type PluginsInfo struct { - // List of Volume plugins registered - Volume []string - // List of Network plugins registered - Network []string - // List of Authorization plugins registered - Authorization []string -} - -// ExecStartCheck is a temp struct used by execStart -// Config fields is part of ExecConfig in runconfig package -type ExecStartCheck struct { - // ExecStart will first check if it's detached - Detach bool - // Check if there's a tty - Tty bool -} - -// HealthcheckResult stores information about a single run of a healthcheck probe -type HealthcheckResult struct { - Start time.Time // Start is the time this check started - End time.Time // End is the time this check ended - ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe - Output string // Output from last check -} - -// Health states -const ( - NoHealthcheck = "none" // Indicates there is no healthcheck - Starting = "starting" // Starting indicates that the container is not yet ready - Healthy = "healthy" // Healthy indicates that the container is running correctly - Unhealthy = "unhealthy" // Unhealthy indicates that the container has a problem -) - -// Health stores information about the container's healthcheck results -type Health struct { - Status string // Status is one of Starting, Healthy or Unhealthy - FailingStreak int // FailingStreak is the number of consecutive failures - Log []*HealthcheckResult // Log contains the last few results (oldest first) -} - -// ContainerState stores container's running state -// it's part of ContainerJSONBase and will return by "inspect" command -type ContainerState struct { - Status string - Running bool - Paused bool - Restarting bool - OOMKilled bool - Dead bool - Pid int - ExitCode int - Error string - StartedAt string - FinishedAt string - Health *Health `json:",omitempty"` -} - -// ContainerNode stores information about the node that a container -// is running on. It's only available in Docker Swarm -type ContainerNode struct { - ID string - IPAddress string `json:"IP"` - Addr string - Name string - Cpus int - Memory int64 - Labels map[string]string -} - -// ContainerJSONBase contains response of Engine API: -// GET "/containers/{name:.*}/json" -type ContainerJSONBase struct { - ID string `json:"Id"` - Created string - Path string - Args []string - State *ContainerState - Image string - ResolvConfPath string - HostnamePath string - HostsPath string - LogPath string - Node *ContainerNode `json:",omitempty"` - Name string - RestartCount int - Driver string - MountLabel string - ProcessLabel string - AppArmorProfile string - ExecIDs []string - HostConfig *container.HostConfig - GraphDriver GraphDriverData - SizeRw *int64 `json:",omitempty"` - SizeRootFs *int64 `json:",omitempty"` -} - -// ContainerJSON is newly used struct along with MountPoint -type ContainerJSON struct { - *ContainerJSONBase - Mounts []MountPoint - Config *container.Config - NetworkSettings *NetworkSettings -} - -// NetworkSettings exposes the network settings in the api -type NetworkSettings struct { - NetworkSettingsBase - DefaultNetworkSettings - Networks map[string]*network.EndpointSettings -} - -// SummaryNetworkSettings provides a summary of container's networks -// in /containers/json -type SummaryNetworkSettings struct { - Networks map[string]*network.EndpointSettings -} - -// NetworkSettingsBase holds basic information about networks -type NetworkSettingsBase struct { - Bridge string // Bridge is the Bridge name the network uses(e.g. `docker0`) - SandboxID string // SandboxID uniquely represents a container's network stack - HairpinMode bool // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface - LinkLocalIPv6Address string // LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix - LinkLocalIPv6PrefixLen int // LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address - Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port - SandboxKey string // SandboxKey identifies the sandbox - SecondaryIPAddresses []network.Address - SecondaryIPv6Addresses []network.Address -} - -// DefaultNetworkSettings holds network information -// during the 2 release deprecation period. -// It will be removed in Docker 1.11. -type DefaultNetworkSettings struct { - EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox - Gateway string // Gateway holds the gateway address for the network - GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address - GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address - IPAddress string // IPAddress holds the IPv4 address for the network - IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address - IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6 - MacAddress string // MacAddress holds the MAC address for the network -} - -// MountPoint represents a mount point configuration inside the container. -// This is used for reporting the mountpoints in use by a container. -type MountPoint struct { - Type mount.Type `json:",omitempty"` - Name string `json:",omitempty"` - Source string - Destination string - Driver string `json:",omitempty"` - Mode string - RW bool - Propagation mount.Propagation -} - -// NetworkResource is the body of the "get network" http response message -type NetworkResource struct { - Name string // Name is the requested name of the network - ID string `json:"Id"` // ID uniquely identifies a network on a single machine - Created time.Time // Created is the time the network created - Scope string // Scope describes the level at which the network exists (e.g. `global` for cluster-wide or `local` for machine level) - Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`) - EnableIPv6 bool // EnableIPv6 represents whether to enable IPv6 - IPAM network.IPAM // IPAM is the network's IP Address Management - Internal bool // Internal represents if the network is used internal only - Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode. - Containers map[string]EndpointResource // Containers contains endpoints belonging to the network - Options map[string]string // Options holds the network specific options to use for when creating the network - Labels map[string]string // Labels holds metadata specific to the network being created - Peers []network.PeerInfo `json:",omitempty"` // List of peer nodes for an overlay network -} - -// EndpointResource contains network resources allocated and used for a container in a network -type EndpointResource struct { - Name string - EndpointID string - MacAddress string - IPv4Address string - IPv6Address string -} - -// NetworkCreate is the expected body of the "create network" http request message -type NetworkCreate struct { - CheckDuplicate bool - Driver string - EnableIPv6 bool - IPAM *network.IPAM - Internal bool - Attachable bool - Options map[string]string - Labels map[string]string -} - -// NetworkCreateRequest is the request message sent to the server for network create call. -type NetworkCreateRequest struct { - NetworkCreate - Name string -} - -// NetworkCreateResponse is the response message sent by the server for network create call -type NetworkCreateResponse struct { - ID string `json:"Id"` - Warning string -} - -// NetworkConnect represents the data to be used to connect a container to the network -type NetworkConnect struct { - Container string - EndpointConfig *network.EndpointSettings `json:",omitempty"` -} - -// NetworkDisconnect represents the data to be used to disconnect a container from the network -type NetworkDisconnect struct { - Container string - Force bool -} - -// Checkpoint represents the details of a checkpoint -type Checkpoint struct { - Name string // Name is the name of the checkpoint -} - -// Runtime describes an OCI runtime -type Runtime struct { - Path string `json:"path"` - Args []string `json:"runtimeArgs,omitempty"` -} - -// DiskUsage contains response of Engine API: -// GET "/system/df" -type DiskUsage struct { - LayersSize int64 - Images []*ImageSummary - Containers []*Container - Volumes []*Volume -} - -// ContainersPruneReport contains the response for Engine API: -// POST "/containers/prune" -type ContainersPruneReport struct { - ContainersDeleted []string - SpaceReclaimed uint64 -} - -// VolumesPruneReport contains the response for Engine API: -// POST "/volumes/prune" -type VolumesPruneReport struct { - VolumesDeleted []string - SpaceReclaimed uint64 -} - -// ImagesPruneReport contains the response for Engine API: -// POST "/images/prune" -type ImagesPruneReport struct { - ImagesDeleted []ImageDelete - SpaceReclaimed uint64 -} - -// NetworksPruneReport contains the response for Engine API: -// POST "/networks/prune" -type NetworksPruneReport struct { - NetworksDeleted []string -} - -// SecretCreateResponse contains the information returned to a client -// on the creation of a new secret. -type SecretCreateResponse struct { - // ID is the id of the created secret. - ID string -} - -// SecretListOptions holds parameters to list secrets -type SecretListOptions struct { - Filters filters.Args -} diff --git a/vendor/github.com/docker/docker/api/types/versions/README.md b/vendor/github.com/docker/docker/api/types/versions/README.md deleted file mode 100644 index cdac50a5..00000000 --- a/vendor/github.com/docker/docker/api/types/versions/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Legacy API type versions - -This package includes types for legacy API versions. The stable version of the API types live in `api/types/*.go`. - -Consider moving a type here when you need to keep backwards compatibility in the API. This legacy types are organized by the latest API version they appear in. For instance, types in the `v1p19` package are valid for API versions below or equal `1.19`. Types in the `v1p20` package are valid for the API version `1.20`, since the versions below that will use the legacy types in `v1p19`. - -### Package name conventions - -The package name convention is to use `v` as a prefix for the version number and `p`(patch) as a separator. We use this nomenclature due to a few restrictions in the Go package name convention: - -1. We cannot use `.` because it's interpreted by the language, think of `v1.20.CallFunction`. -2. We cannot use `_` because golint complains about it. The code is actually valid, but it looks probably more weird: `v1_20.CallFunction`. - -For instance, if you want to modify a type that was available in the version `1.21` of the API but it will have different fields in the version `1.22`, you want to create a new package under `api/types/versions/v1p21`. diff --git a/vendor/github.com/docker/docker/api/types/versions/compare.go b/vendor/github.com/docker/docker/api/types/versions/compare.go deleted file mode 100644 index 611d4fed..00000000 --- a/vendor/github.com/docker/docker/api/types/versions/compare.go +++ /dev/null @@ -1,62 +0,0 @@ -package versions - -import ( - "strconv" - "strings" -) - -// compare compares two version strings -// returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise. -func compare(v1, v2 string) int { - var ( - currTab = strings.Split(v1, ".") - otherTab = strings.Split(v2, ".") - ) - - max := len(currTab) - if len(otherTab) > max { - max = len(otherTab) - } - for i := 0; i < max; i++ { - var currInt, otherInt int - - if len(currTab) > i { - currInt, _ = strconv.Atoi(currTab[i]) - } - if len(otherTab) > i { - otherInt, _ = strconv.Atoi(otherTab[i]) - } - if currInt > otherInt { - return 1 - } - if otherInt > currInt { - return -1 - } - } - return 0 -} - -// LessThan checks if a version is less than another -func LessThan(v, other string) bool { - return compare(v, other) == -1 -} - -// LessThanOrEqualTo checks if a version is less than or equal to another -func LessThanOrEqualTo(v, other string) bool { - return compare(v, other) <= 0 -} - -// GreaterThan checks if a version is greater than another -func GreaterThan(v, other string) bool { - return compare(v, other) == 1 -} - -// GreaterThanOrEqualTo checks if a version is greater than or equal to another -func GreaterThanOrEqualTo(v, other string) bool { - return compare(v, other) >= 0 -} - -// Equal checks if a version is equal to another -func Equal(v, other string) bool { - return compare(v, other) == 0 -} diff --git a/vendor/github.com/docker/docker/api/types/volume.go b/vendor/github.com/docker/docker/api/types/volume.go deleted file mode 100644 index da4f8ebd..00000000 --- a/vendor/github.com/docker/docker/api/types/volume.go +++ /dev/null @@ -1,58 +0,0 @@ -package types - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// Volume volume -// swagger:model Volume -type Volume struct { - - // Name of the volume driver used by the volume. - // Required: true - Driver string `json:"Driver"` - - // User-defined key/value metadata. - // Required: true - Labels map[string]string `json:"Labels"` - - // Mount path of the volume on the host. - // Required: true - Mountpoint string `json:"Mountpoint"` - - // Name of the volume. - // Required: true - Name string `json:"Name"` - - // The driver specific options used when creating the volume. - // Required: true - Options map[string]string `json:"Options"` - - // The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. - // Required: true - Scope string `json:"Scope"` - - // Low-level details about the volume, provided by the volume driver. - // Details are returned as a map with key/value pairs: - // `{"key":"value","key2":"value2"}`. - // - // The `Status` field is optional, and is omitted if the volume driver - // does not support this feature. - // - Status map[string]interface{} `json:"Status,omitempty"` - - // usage data - UsageData *VolumeUsageData `json:"UsageData,omitempty"` -} - -// VolumeUsageData volume usage data -// swagger:model VolumeUsageData -type VolumeUsageData struct { - - // The number of containers referencing this volume. - // Required: true - RefCount int64 `json:"RefCount"` - - // The disk space used by the volume (local driver only) - // Required: true - Size int64 `json:"Size"` -} diff --git a/vendor/github.com/docker/docker/api/types/volume/volumes_create.go b/vendor/github.com/docker/docker/api/types/volume/volumes_create.go deleted file mode 100644 index 679c1600..00000000 --- a/vendor/github.com/docker/docker/api/types/volume/volumes_create.go +++ /dev/null @@ -1,29 +0,0 @@ -package volume - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -// VolumesCreateBody volumes create body -// swagger:model VolumesCreateBody -type VolumesCreateBody struct { - - // Name of the volume driver to use. - // Required: true - Driver string `json:"Driver"` - - // A mapping of driver options and values. These options are passed directly to the driver and are driver specific. - // Required: true - DriverOpts map[string]string `json:"DriverOpts"` - - // User-defined key/value metadata. - // Required: true - Labels map[string]string `json:"Labels"` - - // The new volume's name. If not specified, Docker generates a name. - // Required: true - Name string `json:"Name"` -} diff --git a/vendor/github.com/docker/docker/api/types/volume/volumes_list.go b/vendor/github.com/docker/docker/api/types/volume/volumes_list.go deleted file mode 100644 index 7770bcb8..00000000 --- a/vendor/github.com/docker/docker/api/types/volume/volumes_list.go +++ /dev/null @@ -1,23 +0,0 @@ -package volume - -// ---------------------------------------------------------------------------- -// DO NOT EDIT THIS FILE -// This file was generated by `swagger generate operation` -// -// See hack/swagger-gen.sh -// ---------------------------------------------------------------------------- - -import "github.com/docker/docker/api/types" - -// VolumesListOKBody volumes list o k body -// swagger:model VolumesListOKBody -type VolumesListOKBody struct { - - // List of volumes - // Required: true - Volumes []*types.Volume `json:"Volumes"` - - // Warnings that occurred when fetching the list of volumes - // Required: true - Warnings []string `json:"Warnings"` -} diff --git a/vendor/github.com/docker/docker/client/README.md b/vendor/github.com/docker/docker/client/README.md deleted file mode 100644 index 059dfb3c..00000000 --- a/vendor/github.com/docker/docker/client/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Go client for the Docker Engine API - -The `docker` command uses this package to communicate with the daemon. It can also be used by your own Go applications to do anything the command-line interface does – running containers, pulling images, managing swarms, etc. - -For example, to list running containers (the equivalent of `docker ps`): - -```go -package main - -import ( - "context" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" -) - -func main() { - cli, err := client.NewEnvClient() - if err != nil { - panic(err) - } - - containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{}) - if err != nil { - panic(err) - } - - for _, container := range containers { - fmt.Printf("%s %s\n", container.ID[:10], container.Image) - } -} -``` - -[Full documentation is available on GoDoc.](https://godoc.org/github.com/docker/docker/client) diff --git a/vendor/github.com/docker/docker/client/checkpoint_create.go b/vendor/github.com/docker/docker/client/checkpoint_create.go deleted file mode 100644 index 0effe498..00000000 --- a/vendor/github.com/docker/docker/client/checkpoint_create.go +++ /dev/null @@ -1,13 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// CheckpointCreate creates a checkpoint from the given container with the given name -func (cli *Client) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error { - resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/checkpoint_delete.go b/vendor/github.com/docker/docker/client/checkpoint_delete.go deleted file mode 100644 index e6e75588..00000000 --- a/vendor/github.com/docker/docker/client/checkpoint_delete.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// CheckpointDelete deletes the checkpoint with the given name from the given container -func (cli *Client) CheckpointDelete(ctx context.Context, containerID string, options types.CheckpointDeleteOptions) error { - query := url.Values{} - if options.CheckpointDir != "" { - query.Set("dir", options.CheckpointDir) - } - - resp, err := cli.delete(ctx, "/containers/"+containerID+"/checkpoints/"+options.CheckpointID, query, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/checkpoint_list.go b/vendor/github.com/docker/docker/client/checkpoint_list.go deleted file mode 100644 index 8eb720a6..00000000 --- a/vendor/github.com/docker/docker/client/checkpoint_list.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// CheckpointList returns the volumes configured in the docker host. -func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) { - var checkpoints []types.Checkpoint - - query := url.Values{} - if options.CheckpointDir != "" { - query.Set("dir", options.CheckpointDir) - } - - resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil) - if err != nil { - return checkpoints, err - } - - err = json.NewDecoder(resp.body).Decode(&checkpoints) - ensureReaderClosed(resp) - return checkpoints, err -} diff --git a/vendor/github.com/docker/docker/client/client.go b/vendor/github.com/docker/docker/client/client.go deleted file mode 100644 index a9bdab6b..00000000 --- a/vendor/github.com/docker/docker/client/client.go +++ /dev/null @@ -1,246 +0,0 @@ -/* -Package client is a Go client for the Docker Engine API. - -The "docker" command uses this package to communicate with the daemon. It can also -be used by your own Go applications to do anything the command-line interface does -– running containers, pulling images, managing swarms, etc. - -For more information about the Engine API, see the documentation: -https://docs.docker.com/engine/reference/api/ - -Usage - -You use the library by creating a client object and calling methods on it. The -client can be created either from environment variables with NewEnvClient, or -configured manually with NewClient. - -For example, to list running containers (the equivalent of "docker ps"): - - package main - - import ( - "context" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" - ) - - func main() { - cli, err := client.NewEnvClient() - if err != nil { - panic(err) - } - - containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{}) - if err != nil { - panic(err) - } - - for _, container := range containers { - fmt.Printf("%s %s\n", container.ID[:10], container.Image) - } - } - -*/ -package client - -import ( - "fmt" - "net/http" - "net/url" - "os" - "path/filepath" - "strings" - - "github.com/docker/go-connections/sockets" - "github.com/docker/go-connections/tlsconfig" -) - -// DefaultVersion is the version of the current stable API -const DefaultVersion string = "1.25" - -// Client is the API client that performs all operations -// against a docker server. -type Client struct { - // scheme sets the scheme for the client - scheme string - // host holds the server address to connect to - host string - // proto holds the client protocol i.e. unix. - proto string - // addr holds the client address. - addr string - // basePath holds the path to prepend to the requests. - basePath string - // client used to send and receive http requests. - client *http.Client - // version of the server to talk to. - version string - // custom http headers configured by users. - customHTTPHeaders map[string]string - // manualOverride is set to true when the version was set by users. - manualOverride bool -} - -// NewEnvClient initializes a new API client based on environment variables. -// Use DOCKER_HOST to set the url to the docker server. -// Use DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. -// Use DOCKER_CERT_PATH to load the tls certificates from. -// Use DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. -func NewEnvClient() (*Client, error) { - var client *http.Client - if dockerCertPath := os.Getenv("DOCKER_CERT_PATH"); dockerCertPath != "" { - options := tlsconfig.Options{ - CAFile: filepath.Join(dockerCertPath, "ca.pem"), - CertFile: filepath.Join(dockerCertPath, "cert.pem"), - KeyFile: filepath.Join(dockerCertPath, "key.pem"), - InsecureSkipVerify: os.Getenv("DOCKER_TLS_VERIFY") == "", - } - tlsc, err := tlsconfig.Client(options) - if err != nil { - return nil, err - } - - client = &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: tlsc, - }, - } - } - - host := os.Getenv("DOCKER_HOST") - if host == "" { - host = DefaultDockerHost - } - version := os.Getenv("DOCKER_API_VERSION") - if version == "" { - version = DefaultVersion - } - - cli, err := NewClient(host, version, client, nil) - if err != nil { - return cli, err - } - if os.Getenv("DOCKER_API_VERSION") != "" { - cli.manualOverride = true - } - return cli, nil -} - -// NewClient initializes a new API client for the given host and API version. -// It uses the given http client as transport. -// It also initializes the custom http headers to add to each request. -// -// It won't send any version information if the version number is empty. It is -// highly recommended that you set a version or your client may break if the -// server is upgraded. -func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error) { - proto, addr, basePath, err := ParseHost(host) - if err != nil { - return nil, err - } - - if client != nil { - if _, ok := client.Transport.(*http.Transport); !ok { - return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", client.Transport) - } - } else { - transport := new(http.Transport) - sockets.ConfigureTransport(transport, proto, addr) - client = &http.Client{ - Transport: transport, - } - } - - scheme := "http" - tlsConfig := resolveTLSConfig(client.Transport) - if tlsConfig != nil { - // TODO(stevvooe): This isn't really the right way to write clients in Go. - // `NewClient` should probably only take an `*http.Client` and work from there. - // Unfortunately, the model of having a host-ish/url-thingy as the connection - // string has us confusing protocol and transport layers. We continue doing - // this to avoid breaking existing clients but this should be addressed. - scheme = "https" - } - - return &Client{ - scheme: scheme, - host: host, - proto: proto, - addr: addr, - basePath: basePath, - client: client, - version: version, - customHTTPHeaders: httpHeaders, - }, nil -} - -// Close ensures that transport.Client is closed -// especially needed while using NewClient with *http.Client = nil -// for example -// client.NewClient("unix:///var/run/docker.sock", nil, "v1.18", map[string]string{"User-Agent": "engine-api-cli-1.0"}) -func (cli *Client) Close() error { - - if t, ok := cli.client.Transport.(*http.Transport); ok { - t.CloseIdleConnections() - } - - return nil -} - -// getAPIPath returns the versioned request path to call the api. -// It appends the query parameters to the path if they are not empty. -func (cli *Client) getAPIPath(p string, query url.Values) string { - var apiPath string - if cli.version != "" { - v := strings.TrimPrefix(cli.version, "v") - apiPath = fmt.Sprintf("%s/v%s%s", cli.basePath, v, p) - } else { - apiPath = fmt.Sprintf("%s%s", cli.basePath, p) - } - - u := &url.URL{ - Path: apiPath, - } - if len(query) > 0 { - u.RawQuery = query.Encode() - } - return u.String() -} - -// ClientVersion returns the version string associated with this -// instance of the Client. Note that this value can be changed -// via the DOCKER_API_VERSION env var. -func (cli *Client) ClientVersion() string { - return cli.version -} - -// UpdateClientVersion updates the version string associated with this -// instance of the Client. -func (cli *Client) UpdateClientVersion(v string) { - if !cli.manualOverride { - cli.version = v - } - -} - -// ParseHost verifies that the given host strings is valid. -func ParseHost(host string) (string, string, string, error) { - protoAddrParts := strings.SplitN(host, "://", 2) - if len(protoAddrParts) == 1 { - return "", "", "", fmt.Errorf("unable to parse docker host `%s`", host) - } - - var basePath string - proto, addr := protoAddrParts[0], protoAddrParts[1] - if proto == "tcp" { - parsed, err := url.Parse("tcp://" + addr) - if err != nil { - return "", "", "", err - } - addr = parsed.Host - basePath = parsed.Path - } - return proto, addr, basePath, nil -} diff --git a/vendor/github.com/docker/docker/client/client_unix.go b/vendor/github.com/docker/docker/client/client_unix.go deleted file mode 100644 index 89de892c..00000000 --- a/vendor/github.com/docker/docker/client/client_unix.go +++ /dev/null @@ -1,6 +0,0 @@ -// +build linux freebsd solaris openbsd darwin - -package client - -// DefaultDockerHost defines os specific default if DOCKER_HOST is unset -const DefaultDockerHost = "unix:///var/run/docker.sock" diff --git a/vendor/github.com/docker/docker/client/client_windows.go b/vendor/github.com/docker/docker/client/client_windows.go deleted file mode 100644 index 07c0c7a7..00000000 --- a/vendor/github.com/docker/docker/client/client_windows.go +++ /dev/null @@ -1,4 +0,0 @@ -package client - -// DefaultDockerHost defines os specific default if DOCKER_HOST is unset -const DefaultDockerHost = "npipe:////./pipe/docker_engine" diff --git a/vendor/github.com/docker/docker/client/container_attach.go b/vendor/github.com/docker/docker/client/container_attach.go deleted file mode 100644 index eea46821..00000000 --- a/vendor/github.com/docker/docker/client/container_attach.go +++ /dev/null @@ -1,37 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerAttach attaches a connection to a container in the server. -// It returns a types.HijackedConnection with the hijacked connection -// and the a reader to get output. It's up to the called to close -// the hijacked connection by calling types.HijackedResponse.Close. -func (cli *Client) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) { - query := url.Values{} - if options.Stream { - query.Set("stream", "1") - } - if options.Stdin { - query.Set("stdin", "1") - } - if options.Stdout { - query.Set("stdout", "1") - } - if options.Stderr { - query.Set("stderr", "1") - } - if options.DetachKeys != "" { - query.Set("detachKeys", options.DetachKeys) - } - if options.Logs { - query.Set("logs", "1") - } - - headers := map[string][]string{"Content-Type": {"text/plain"}} - return cli.postHijacked(ctx, "/containers/"+container+"/attach", query, nil, headers) -} diff --git a/vendor/github.com/docker/docker/client/container_commit.go b/vendor/github.com/docker/docker/client/container_commit.go deleted file mode 100644 index c766d62e..00000000 --- a/vendor/github.com/docker/docker/client/container_commit.go +++ /dev/null @@ -1,53 +0,0 @@ -package client - -import ( - "encoding/json" - "errors" - "net/url" - - distreference "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/reference" - "golang.org/x/net/context" -) - -// ContainerCommit applies changes into a container and creates a new tagged image. -func (cli *Client) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) { - var repository, tag string - if options.Reference != "" { - distributionRef, err := distreference.ParseNamed(options.Reference) - if err != nil { - return types.IDResponse{}, err - } - - if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical { - return types.IDResponse{}, errors.New("refusing to create a tag with a digest reference") - } - - tag = reference.GetTagFromNamedRef(distributionRef) - repository = distributionRef.Name() - } - - query := url.Values{} - query.Set("container", container) - query.Set("repo", repository) - query.Set("tag", tag) - query.Set("comment", options.Comment) - query.Set("author", options.Author) - for _, change := range options.Changes { - query.Add("changes", change) - } - if options.Pause != true { - query.Set("pause", "0") - } - - var response types.IDResponse - resp, err := cli.post(ctx, "/commit", query, options.Config, nil) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/container_copy.go b/vendor/github.com/docker/docker/client/container_copy.go deleted file mode 100644 index 8380eeab..00000000 --- a/vendor/github.com/docker/docker/client/container_copy.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path/filepath" - "strings" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" -) - -// ContainerStatPath returns Stat information about a path inside the container filesystem. -func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error) { - query := url.Values{} - query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API. - - urlStr := fmt.Sprintf("/containers/%s/archive", containerID) - response, err := cli.head(ctx, urlStr, query, nil) - if err != nil { - return types.ContainerPathStat{}, err - } - defer ensureReaderClosed(response) - return getContainerPathStatFromHeader(response.header) -} - -// CopyToContainer copies content into the container filesystem. -func (cli *Client) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error { - query := url.Values{} - query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API. - // Do not allow for an existing directory to be overwritten by a non-directory and vice versa. - if !options.AllowOverwriteDirWithFile { - query.Set("noOverwriteDirNonDir", "true") - } - - apiPath := fmt.Sprintf("/containers/%s/archive", container) - - response, err := cli.putRaw(ctx, apiPath, query, content, nil) - if err != nil { - return err - } - defer ensureReaderClosed(response) - - if response.statusCode != http.StatusOK { - return fmt.Errorf("unexpected status code from daemon: %d", response.statusCode) - } - - return nil -} - -// CopyFromContainer gets the content from the container and returns it as a Reader -// to manipulate it in the host. It's up to the caller to close the reader. -func (cli *Client) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) { - query := make(url.Values, 1) - query.Set("path", filepath.ToSlash(srcPath)) // Normalize the paths used in the API. - - apiPath := fmt.Sprintf("/containers/%s/archive", container) - response, err := cli.get(ctx, apiPath, query, nil) - if err != nil { - return nil, types.ContainerPathStat{}, err - } - - if response.statusCode != http.StatusOK { - return nil, types.ContainerPathStat{}, fmt.Errorf("unexpected status code from daemon: %d", response.statusCode) - } - - // In order to get the copy behavior right, we need to know information - // about both the source and the destination. The response headers include - // stat info about the source that we can use in deciding exactly how to - // copy it locally. Along with the stat info about the local destination, - // we have everything we need to handle the multiple possibilities there - // can be when copying a file/dir from one location to another file/dir. - stat, err := getContainerPathStatFromHeader(response.header) - if err != nil { - return nil, stat, fmt.Errorf("unable to get resource stat from response: %s", err) - } - return response.body, stat, err -} - -func getContainerPathStatFromHeader(header http.Header) (types.ContainerPathStat, error) { - var stat types.ContainerPathStat - - encodedStat := header.Get("X-Docker-Container-Path-Stat") - statDecoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(encodedStat)) - - err := json.NewDecoder(statDecoder).Decode(&stat) - if err != nil { - err = fmt.Errorf("unable to decode container path stat header: %s", err) - } - - return stat, err -} diff --git a/vendor/github.com/docker/docker/client/container_create.go b/vendor/github.com/docker/docker/client/container_create.go deleted file mode 100644 index 9f627aaf..00000000 --- a/vendor/github.com/docker/docker/client/container_create.go +++ /dev/null @@ -1,50 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - "strings" - - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/network" - "golang.org/x/net/context" -) - -type configWrapper struct { - *container.Config - HostConfig *container.HostConfig - NetworkingConfig *network.NetworkingConfig -} - -// ContainerCreate creates a new container based in the given configuration. -// It can be associated with a name, but it's not mandatory. -func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) { - var response container.ContainerCreateCreatedBody - - if err := cli.NewVersionError("1.25", "stop timeout"); config != nil && config.StopTimeout != nil && err != nil { - return response, err - } - - query := url.Values{} - if containerName != "" { - query.Set("name", containerName) - } - - body := configWrapper{ - Config: config, - HostConfig: hostConfig, - NetworkingConfig: networkingConfig, - } - - serverResp, err := cli.post(ctx, "/containers/create", query, body, nil) - if err != nil { - if serverResp.statusCode == 404 && strings.Contains(err.Error(), "No such image") { - return response, imageNotFoundError{config.Image} - } - return response, err - } - - err = json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/container_diff.go b/vendor/github.com/docker/docker/client/container_diff.go deleted file mode 100644 index 1e3e554f..00000000 --- a/vendor/github.com/docker/docker/client/container_diff.go +++ /dev/null @@ -1,23 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerDiff shows differences in a container filesystem since it was started. -func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) { - var changes []types.ContainerChange - - serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil) - if err != nil { - return changes, err - } - - err = json.NewDecoder(serverResp.body).Decode(&changes) - ensureReaderClosed(serverResp) - return changes, err -} diff --git a/vendor/github.com/docker/docker/client/container_exec.go b/vendor/github.com/docker/docker/client/container_exec.go deleted file mode 100644 index 0665c54f..00000000 --- a/vendor/github.com/docker/docker/client/container_exec.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerExecCreate creates a new exec configuration to run an exec process. -func (cli *Client) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) { - var response types.IDResponse - - if err := cli.NewVersionError("1.25", "env"); len(config.Env) != 0 && err != nil { - return response, err - } - - resp, err := cli.post(ctx, "/containers/"+container+"/exec", nil, config, nil) - if err != nil { - return response, err - } - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} - -// ContainerExecStart starts an exec process already created in the docker host. -func (cli *Client) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error { - resp, err := cli.post(ctx, "/exec/"+execID+"/start", nil, config, nil) - ensureReaderClosed(resp) - return err -} - -// ContainerExecAttach attaches a connection to an exec process in the server. -// It returns a types.HijackedConnection with the hijacked connection -// and the a reader to get output. It's up to the called to close -// the hijacked connection by calling types.HijackedResponse.Close. -func (cli *Client) ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error) { - headers := map[string][]string{"Content-Type": {"application/json"}} - return cli.postHijacked(ctx, "/exec/"+execID+"/start", nil, config, headers) -} - -// ContainerExecInspect returns information about a specific exec process on the docker host. -func (cli *Client) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) { - var response types.ContainerExecInspect - resp, err := cli.get(ctx, "/exec/"+execID+"/json", nil, nil) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/container_export.go b/vendor/github.com/docker/docker/client/container_export.go deleted file mode 100644 index 52194f3d..00000000 --- a/vendor/github.com/docker/docker/client/container_export.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -import ( - "io" - "net/url" - - "golang.org/x/net/context" -) - -// ContainerExport retrieves the raw contents of a container -// and returns them as an io.ReadCloser. It's up to the caller -// to close the stream. -func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) { - serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil) - if err != nil { - return nil, err - } - - return serverResp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/container_inspect.go b/vendor/github.com/docker/docker/client/container_inspect.go deleted file mode 100644 index 17f18097..00000000 --- a/vendor/github.com/docker/docker/client/container_inspect.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerInspect returns the container information. -func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) { - serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", nil, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return types.ContainerJSON{}, containerNotFoundError{containerID} - } - return types.ContainerJSON{}, err - } - - var response types.ContainerJSON - err = json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} - -// ContainerInspectWithRaw returns the container information and its raw representation. -func (cli *Client) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) { - query := url.Values{} - if getSize { - query.Set("size", "1") - } - serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", query, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return types.ContainerJSON{}, nil, containerNotFoundError{containerID} - } - return types.ContainerJSON{}, nil, err - } - defer ensureReaderClosed(serverResp) - - body, err := ioutil.ReadAll(serverResp.body) - if err != nil { - return types.ContainerJSON{}, nil, err - } - - var response types.ContainerJSON - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&response) - return response, body, err -} diff --git a/vendor/github.com/docker/docker/client/container_kill.go b/vendor/github.com/docker/docker/client/container_kill.go deleted file mode 100644 index 29f80c73..00000000 --- a/vendor/github.com/docker/docker/client/container_kill.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import ( - "net/url" - - "golang.org/x/net/context" -) - -// ContainerKill terminates the container process but does not remove the container from the docker host. -func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { - query := url.Values{} - query.Set("signal", signal) - - resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_list.go b/vendor/github.com/docker/docker/client/container_list.go deleted file mode 100644 index 43989121..00000000 --- a/vendor/github.com/docker/docker/client/container_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - "strconv" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// ContainerList returns the list of containers in the docker host. -func (cli *Client) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) { - query := url.Values{} - - if options.All { - query.Set("all", "1") - } - - if options.Limit != -1 { - query.Set("limit", strconv.Itoa(options.Limit)) - } - - if options.Since != "" { - query.Set("since", options.Since) - } - - if options.Before != "" { - query.Set("before", options.Before) - } - - if options.Size { - query.Set("size", "1") - } - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) - - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - - resp, err := cli.get(ctx, "/containers/json", query, nil) - if err != nil { - return nil, err - } - - var containers []types.Container - err = json.NewDecoder(resp.body).Decode(&containers) - ensureReaderClosed(resp) - return containers, err -} diff --git a/vendor/github.com/docker/docker/client/container_logs.go b/vendor/github.com/docker/docker/client/container_logs.go deleted file mode 100644 index 69056b63..00000000 --- a/vendor/github.com/docker/docker/client/container_logs.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -import ( - "io" - "net/url" - "time" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - timetypes "github.com/docker/docker/api/types/time" -) - -// ContainerLogs returns the logs generated by a container in an io.ReadCloser. -// It's up to the caller to close the stream. -func (cli *Client) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) { - query := url.Values{} - if options.ShowStdout { - query.Set("stdout", "1") - } - - if options.ShowStderr { - query.Set("stderr", "1") - } - - if options.Since != "" { - ts, err := timetypes.GetTimestamp(options.Since, time.Now()) - if err != nil { - return nil, err - } - query.Set("since", ts) - } - - if options.Timestamps { - query.Set("timestamps", "1") - } - - if options.Details { - query.Set("details", "1") - } - - if options.Follow { - query.Set("follow", "1") - } - query.Set("tail", options.Tail) - - resp, err := cli.get(ctx, "/containers/"+container+"/logs", query, nil) - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/container_pause.go b/vendor/github.com/docker/docker/client/container_pause.go deleted file mode 100644 index 412067a7..00000000 --- a/vendor/github.com/docker/docker/client/container_pause.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import "golang.org/x/net/context" - -// ContainerPause pauses the main process of a given container without terminating it. -func (cli *Client) ContainerPause(ctx context.Context, containerID string) error { - resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_prune.go b/vendor/github.com/docker/docker/client/container_prune.go deleted file mode 100644 index b5821708..00000000 --- a/vendor/github.com/docker/docker/client/container_prune.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// ContainersPrune requests the daemon to delete unused data -func (cli *Client) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) { - var report types.ContainersPruneReport - - if err := cli.NewVersionError("1.25", "container prune"); err != nil { - return report, err - } - - query, err := getFiltersQuery(pruneFilters) - if err != nil { - return report, err - } - - serverResp, err := cli.post(ctx, "/containers/prune", query, nil, nil) - if err != nil { - return report, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { - return report, fmt.Errorf("Error retrieving disk usage: %v", err) - } - - return report, nil -} diff --git a/vendor/github.com/docker/docker/client/container_remove.go b/vendor/github.com/docker/docker/client/container_remove.go deleted file mode 100644 index 3a79590c..00000000 --- a/vendor/github.com/docker/docker/client/container_remove.go +++ /dev/null @@ -1,27 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerRemove kills and removes a container from the docker host. -func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error { - query := url.Values{} - if options.RemoveVolumes { - query.Set("v", "1") - } - if options.RemoveLinks { - query.Set("link", "1") - } - - if options.Force { - query.Set("force", "1") - } - - resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_rename.go b/vendor/github.com/docker/docker/client/container_rename.go deleted file mode 100644 index 0e718da7..00000000 --- a/vendor/github.com/docker/docker/client/container_rename.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "net/url" - - "golang.org/x/net/context" -) - -// ContainerRename changes the name of a given container. -func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error { - query := url.Values{} - query.Set("name", newContainerName) - resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_resize.go b/vendor/github.com/docker/docker/client/container_resize.go deleted file mode 100644 index 66c3cc19..00000000 --- a/vendor/github.com/docker/docker/client/container_resize.go +++ /dev/null @@ -1,29 +0,0 @@ -package client - -import ( - "net/url" - "strconv" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerResize changes the size of the tty for a container. -func (cli *Client) ContainerResize(ctx context.Context, containerID string, options types.ResizeOptions) error { - return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width) -} - -// ContainerExecResize changes the size of the tty for an exec process running inside a container. -func (cli *Client) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { - return cli.resize(ctx, "/exec/"+execID, options.Height, options.Width) -} - -func (cli *Client) resize(ctx context.Context, basePath string, height, width uint) error { - query := url.Values{} - query.Set("h", strconv.Itoa(int(height))) - query.Set("w", strconv.Itoa(int(width))) - - resp, err := cli.post(ctx, basePath+"/resize", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_restart.go b/vendor/github.com/docker/docker/client/container_restart.go deleted file mode 100644 index 74d7455f..00000000 --- a/vendor/github.com/docker/docker/client/container_restart.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "net/url" - "time" - - timetypes "github.com/docker/docker/api/types/time" - "golang.org/x/net/context" -) - -// ContainerRestart stops and starts a container again. -// It makes the daemon to wait for the container to be up again for -// a specific amount of time, given the timeout. -func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error { - query := url.Values{} - if timeout != nil { - query.Set("t", timetypes.DurationToSecondsString(*timeout)) - } - resp, err := cli.post(ctx, "/containers/"+containerID+"/restart", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_start.go b/vendor/github.com/docker/docker/client/container_start.go deleted file mode 100644 index b1f08de4..00000000 --- a/vendor/github.com/docker/docker/client/container_start.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -import ( - "net/url" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" -) - -// ContainerStart sends a request to the docker daemon to start a container. -func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { - query := url.Values{} - if len(options.CheckpointID) != 0 { - query.Set("checkpoint", options.CheckpointID) - } - if len(options.CheckpointDir) != 0 { - query.Set("checkpoint-dir", options.CheckpointDir) - } - - resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_stats.go b/vendor/github.com/docker/docker/client/container_stats.go deleted file mode 100644 index 4758c66e..00000000 --- a/vendor/github.com/docker/docker/client/container_stats.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerStats returns near realtime stats for a given container. -// It's up to the caller to close the io.ReadCloser returned. -func (cli *Client) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error) { - query := url.Values{} - query.Set("stream", "0") - if stream { - query.Set("stream", "1") - } - - resp, err := cli.get(ctx, "/containers/"+containerID+"/stats", query, nil) - if err != nil { - return types.ContainerStats{}, err - } - - osType := getDockerOS(resp.header.Get("Server")) - return types.ContainerStats{Body: resp.body, OSType: osType}, err -} diff --git a/vendor/github.com/docker/docker/client/container_stop.go b/vendor/github.com/docker/docker/client/container_stop.go deleted file mode 100644 index b5418ae8..00000000 --- a/vendor/github.com/docker/docker/client/container_stop.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "net/url" - "time" - - timetypes "github.com/docker/docker/api/types/time" - "golang.org/x/net/context" -) - -// ContainerStop stops a container without terminating the process. -// The process is blocked until the container stops or the timeout expires. -func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error { - query := url.Values{} - if timeout != nil { - query.Set("t", timetypes.DurationToSecondsString(*timeout)) - } - resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_top.go b/vendor/github.com/docker/docker/client/container_top.go deleted file mode 100644 index 4e7270ea..00000000 --- a/vendor/github.com/docker/docker/client/container_top.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - "strings" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ContainerTop shows process information from within a container. -func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (types.ContainerProcessList, error) { - var response types.ContainerProcessList - query := url.Values{} - if len(arguments) > 0 { - query.Set("ps_args", strings.Join(arguments, " ")) - } - - resp, err := cli.get(ctx, "/containers/"+containerID+"/top", query, nil) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/container_unpause.go b/vendor/github.com/docker/docker/client/container_unpause.go deleted file mode 100644 index 5c762112..00000000 --- a/vendor/github.com/docker/docker/client/container_unpause.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import "golang.org/x/net/context" - -// ContainerUnpause resumes the process execution within a container -func (cli *Client) ContainerUnpause(ctx context.Context, containerID string) error { - resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/container_update.go b/vendor/github.com/docker/docker/client/container_update.go deleted file mode 100644 index 5082f22d..00000000 --- a/vendor/github.com/docker/docker/client/container_update.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types/container" - "golang.org/x/net/context" -) - -// ContainerUpdate updates resources of a container -func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { - var response container.ContainerUpdateOKBody - serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil) - if err != nil { - return response, err - } - - err = json.NewDecoder(serverResp.body).Decode(&response) - - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/container_wait.go b/vendor/github.com/docker/docker/client/container_wait.go deleted file mode 100644 index 93212c70..00000000 --- a/vendor/github.com/docker/docker/client/container_wait.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "encoding/json" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types/container" -) - -// ContainerWait pauses execution until a container exits. -// It returns the API status code as response of its readiness. -func (cli *Client) ContainerWait(ctx context.Context, containerID string) (int64, error) { - resp, err := cli.post(ctx, "/containers/"+containerID+"/wait", nil, nil, nil) - if err != nil { - return -1, err - } - defer ensureReaderClosed(resp) - - var res container.ContainerWaitOKBody - if err := json.NewDecoder(resp.body).Decode(&res); err != nil { - return -1, err - } - - return res.StatusCode, nil -} diff --git a/vendor/github.com/docker/docker/client/disk_usage.go b/vendor/github.com/docker/docker/client/disk_usage.go deleted file mode 100644 index 03c80b39..00000000 --- a/vendor/github.com/docker/docker/client/disk_usage.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// DiskUsage requests the current data usage from the daemon -func (cli *Client) DiskUsage(ctx context.Context) (types.DiskUsage, error) { - var du types.DiskUsage - - serverResp, err := cli.get(ctx, "/system/df", nil, nil) - if err != nil { - return du, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&du); err != nil { - return du, fmt.Errorf("Error retrieving disk usage: %v", err) - } - - return du, nil -} diff --git a/vendor/github.com/docker/docker/client/errors.go b/vendor/github.com/docker/docker/client/errors.go deleted file mode 100644 index bf6923f1..00000000 --- a/vendor/github.com/docker/docker/client/errors.go +++ /dev/null @@ -1,278 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/docker/docker/api/types/versions" - "github.com/pkg/errors" -) - -// errConnectionFailed implements an error returned when connection failed. -type errConnectionFailed struct { - host string -} - -// Error returns a string representation of an errConnectionFailed -func (err errConnectionFailed) Error() string { - if err.host == "" { - return "Cannot connect to the Docker daemon. Is the docker daemon running on this host?" - } - return fmt.Sprintf("Cannot connect to the Docker daemon at %s. Is the docker daemon running?", err.host) -} - -// IsErrConnectionFailed returns true if the error is caused by connection failed. -func IsErrConnectionFailed(err error) bool { - _, ok := errors.Cause(err).(errConnectionFailed) - return ok -} - -// ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed. -func ErrorConnectionFailed(host string) error { - return errConnectionFailed{host: host} -} - -type notFound interface { - error - NotFound() bool // Is the error a NotFound error -} - -// IsErrNotFound returns true if the error is caused with an -// object (image, container, network, volume, …) is not found in the docker host. -func IsErrNotFound(err error) bool { - te, ok := err.(notFound) - return ok && te.NotFound() -} - -// imageNotFoundError implements an error returned when an image is not in the docker host. -type imageNotFoundError struct { - imageID string -} - -// NotFound indicates that this error type is of NotFound -func (e imageNotFoundError) NotFound() bool { - return true -} - -// Error returns a string representation of an imageNotFoundError -func (e imageNotFoundError) Error() string { - return fmt.Sprintf("Error: No such image: %s", e.imageID) -} - -// IsErrImageNotFound returns true if the error is caused -// when an image is not found in the docker host. -func IsErrImageNotFound(err error) bool { - return IsErrNotFound(err) -} - -// containerNotFoundError implements an error returned when a container is not in the docker host. -type containerNotFoundError struct { - containerID string -} - -// NotFound indicates that this error type is of NotFound -func (e containerNotFoundError) NotFound() bool { - return true -} - -// Error returns a string representation of a containerNotFoundError -func (e containerNotFoundError) Error() string { - return fmt.Sprintf("Error: No such container: %s", e.containerID) -} - -// IsErrContainerNotFound returns true if the error is caused -// when a container is not found in the docker host. -func IsErrContainerNotFound(err error) bool { - return IsErrNotFound(err) -} - -// networkNotFoundError implements an error returned when a network is not in the docker host. -type networkNotFoundError struct { - networkID string -} - -// NotFound indicates that this error type is of NotFound -func (e networkNotFoundError) NotFound() bool { - return true -} - -// Error returns a string representation of a networkNotFoundError -func (e networkNotFoundError) Error() string { - return fmt.Sprintf("Error: No such network: %s", e.networkID) -} - -// IsErrNetworkNotFound returns true if the error is caused -// when a network is not found in the docker host. -func IsErrNetworkNotFound(err error) bool { - return IsErrNotFound(err) -} - -// volumeNotFoundError implements an error returned when a volume is not in the docker host. -type volumeNotFoundError struct { - volumeID string -} - -// NotFound indicates that this error type is of NotFound -func (e volumeNotFoundError) NotFound() bool { - return true -} - -// Error returns a string representation of a volumeNotFoundError -func (e volumeNotFoundError) Error() string { - return fmt.Sprintf("Error: No such volume: %s", e.volumeID) -} - -// IsErrVolumeNotFound returns true if the error is caused -// when a volume is not found in the docker host. -func IsErrVolumeNotFound(err error) bool { - return IsErrNotFound(err) -} - -// unauthorizedError represents an authorization error in a remote registry. -type unauthorizedError struct { - cause error -} - -// Error returns a string representation of an unauthorizedError -func (u unauthorizedError) Error() string { - return u.cause.Error() -} - -// IsErrUnauthorized returns true if the error is caused -// when a remote registry authentication fails -func IsErrUnauthorized(err error) bool { - _, ok := err.(unauthorizedError) - return ok -} - -// nodeNotFoundError implements an error returned when a node is not found. -type nodeNotFoundError struct { - nodeID string -} - -// Error returns a string representation of a nodeNotFoundError -func (e nodeNotFoundError) Error() string { - return fmt.Sprintf("Error: No such node: %s", e.nodeID) -} - -// NotFound indicates that this error type is of NotFound -func (e nodeNotFoundError) NotFound() bool { - return true -} - -// IsErrNodeNotFound returns true if the error is caused -// when a node is not found. -func IsErrNodeNotFound(err error) bool { - _, ok := err.(nodeNotFoundError) - return ok -} - -// serviceNotFoundError implements an error returned when a service is not found. -type serviceNotFoundError struct { - serviceID string -} - -// Error returns a string representation of a serviceNotFoundError -func (e serviceNotFoundError) Error() string { - return fmt.Sprintf("Error: No such service: %s", e.serviceID) -} - -// NotFound indicates that this error type is of NotFound -func (e serviceNotFoundError) NotFound() bool { - return true -} - -// IsErrServiceNotFound returns true if the error is caused -// when a service is not found. -func IsErrServiceNotFound(err error) bool { - _, ok := err.(serviceNotFoundError) - return ok -} - -// taskNotFoundError implements an error returned when a task is not found. -type taskNotFoundError struct { - taskID string -} - -// Error returns a string representation of a taskNotFoundError -func (e taskNotFoundError) Error() string { - return fmt.Sprintf("Error: No such task: %s", e.taskID) -} - -// NotFound indicates that this error type is of NotFound -func (e taskNotFoundError) NotFound() bool { - return true -} - -// IsErrTaskNotFound returns true if the error is caused -// when a task is not found. -func IsErrTaskNotFound(err error) bool { - _, ok := err.(taskNotFoundError) - return ok -} - -type pluginPermissionDenied struct { - name string -} - -func (e pluginPermissionDenied) Error() string { - return "Permission denied while installing plugin " + e.name -} - -// IsErrPluginPermissionDenied returns true if the error is caused -// when a user denies a plugin's permissions -func IsErrPluginPermissionDenied(err error) bool { - _, ok := err.(pluginPermissionDenied) - return ok -} - -// NewVersionError returns an error if the APIVersion required -// if less than the current supported version -func (cli *Client) NewVersionError(APIrequired, feature string) error { - if versions.LessThan(cli.version, APIrequired) { - return fmt.Errorf("%q requires API version %s, but the Docker server is version %s", feature, APIrequired, cli.version) - } - return nil -} - -// secretNotFoundError implements an error returned when a secret is not found. -type secretNotFoundError struct { - name string -} - -// Error returns a string representation of a secretNotFoundError -func (e secretNotFoundError) Error() string { - return fmt.Sprintf("Error: no such secret: %s", e.name) -} - -// NoFound indicates that this error type is of NotFound -func (e secretNotFoundError) NotFound() bool { - return true -} - -// IsErrSecretNotFound returns true if the error is caused -// when a secret is not found. -func IsErrSecretNotFound(err error) bool { - _, ok := err.(secretNotFoundError) - return ok -} - -// pluginNotFoundError implements an error returned when a plugin is not in the docker host. -type pluginNotFoundError struct { - name string -} - -// NotFound indicates that this error type is of NotFound -func (e pluginNotFoundError) NotFound() bool { - return true -} - -// Error returns a string representation of a pluginNotFoundError -func (e pluginNotFoundError) Error() string { - return fmt.Sprintf("Error: No such plugin: %s", e.name) -} - -// IsErrPluginNotFound returns true if the error is caused -// when a plugin is not found in the docker host. -func IsErrPluginNotFound(err error) bool { - return IsErrNotFound(err) -} diff --git a/vendor/github.com/docker/docker/client/events.go b/vendor/github.com/docker/docker/client/events.go deleted file mode 100644 index af47aefa..00000000 --- a/vendor/github.com/docker/docker/client/events.go +++ /dev/null @@ -1,102 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - "time" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - timetypes "github.com/docker/docker/api/types/time" -) - -// Events returns a stream of events in the daemon. It's up to the caller to close the stream -// by cancelling the context. Once the stream has been completely read an io.EOF error will -// be sent over the error channel. If an error is sent all processing will be stopped. It's up -// to the caller to reopen the stream in the event of an error by reinvoking this method. -func (cli *Client) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) { - - messages := make(chan events.Message) - errs := make(chan error, 1) - - started := make(chan struct{}) - go func() { - defer close(errs) - - query, err := buildEventsQueryParams(cli.version, options) - if err != nil { - close(started) - errs <- err - return - } - - resp, err := cli.get(ctx, "/events", query, nil) - if err != nil { - close(started) - errs <- err - return - } - defer resp.body.Close() - - decoder := json.NewDecoder(resp.body) - - close(started) - for { - select { - case <-ctx.Done(): - errs <- ctx.Err() - return - default: - var event events.Message - if err := decoder.Decode(&event); err != nil { - errs <- err - return - } - - select { - case messages <- event: - case <-ctx.Done(): - errs <- ctx.Err() - return - } - } - } - }() - <-started - - return messages, errs -} - -func buildEventsQueryParams(cliVersion string, options types.EventsOptions) (url.Values, error) { - query := url.Values{} - ref := time.Now() - - if options.Since != "" { - ts, err := timetypes.GetTimestamp(options.Since, ref) - if err != nil { - return nil, err - } - query.Set("since", ts) - } - - if options.Until != "" { - ts, err := timetypes.GetTimestamp(options.Until, ref) - if err != nil { - return nil, err - } - query.Set("until", ts) - } - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParamWithVersion(cliVersion, options.Filters) - if err != nil { - return nil, err - } - query.Set("filters", filterJSON) - } - - return query, nil -} diff --git a/vendor/github.com/docker/docker/client/hijack.go b/vendor/github.com/docker/docker/client/hijack.go deleted file mode 100644 index 74c53f52..00000000 --- a/vendor/github.com/docker/docker/client/hijack.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -import ( - "crypto/tls" - "errors" - "fmt" - "net" - "net/http" - "net/http/httputil" - "net/url" - "strings" - "time" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/pkg/tlsconfig" - "github.com/docker/go-connections/sockets" - "golang.org/x/net/context" -) - -// tlsClientCon holds tls information and a dialed connection. -type tlsClientCon struct { - *tls.Conn - rawConn net.Conn -} - -func (c *tlsClientCon) CloseWrite() error { - // Go standard tls.Conn doesn't provide the CloseWrite() method so we do it - // on its underlying connection. - if conn, ok := c.rawConn.(types.CloseWriter); ok { - return conn.CloseWrite() - } - return nil -} - -// postHijacked sends a POST request and hijacks the connection. -func (cli *Client) postHijacked(ctx context.Context, path string, query url.Values, body interface{}, headers map[string][]string) (types.HijackedResponse, error) { - bodyEncoded, err := encodeData(body) - if err != nil { - return types.HijackedResponse{}, err - } - - apiPath := cli.getAPIPath(path, query) - req, err := http.NewRequest("POST", apiPath, bodyEncoded) - if err != nil { - return types.HijackedResponse{}, err - } - req = cli.addHeaders(req, headers) - - req.Host = cli.addr - req.Header.Set("Connection", "Upgrade") - req.Header.Set("Upgrade", "tcp") - - conn, err := dial(cli.proto, cli.addr, resolveTLSConfig(cli.client.Transport)) - if err != nil { - if strings.Contains(err.Error(), "connection refused") { - return types.HijackedResponse{}, fmt.Errorf("Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?") - } - return types.HijackedResponse{}, err - } - - // When we set up a TCP connection for hijack, there could be long periods - // of inactivity (a long running command with no output) that in certain - // network setups may cause ECONNTIMEOUT, leaving the client in an unknown - // state. Setting TCP KeepAlive on the socket connection will prohibit - // ECONNTIMEOUT unless the socket connection truly is broken - if tcpConn, ok := conn.(*net.TCPConn); ok { - tcpConn.SetKeepAlive(true) - tcpConn.SetKeepAlivePeriod(30 * time.Second) - } - - clientconn := httputil.NewClientConn(conn, nil) - defer clientconn.Close() - - // Server hijacks the connection, error 'connection closed' expected - _, err = clientconn.Do(req) - - rwc, br := clientconn.Hijack() - - return types.HijackedResponse{Conn: rwc, Reader: br}, err -} - -func tlsDial(network, addr string, config *tls.Config) (net.Conn, error) { - return tlsDialWithDialer(new(net.Dialer), network, addr, config) -} - -// We need to copy Go's implementation of tls.Dial (pkg/cryptor/tls/tls.go) in -// order to return our custom tlsClientCon struct which holds both the tls.Conn -// object _and_ its underlying raw connection. The rationale for this is that -// we need to be able to close the write end of the connection when attaching, -// which tls.Conn does not provide. -func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Config) (net.Conn, error) { - // We want the Timeout and Deadline values from dialer to cover the - // whole process: TCP connection and TLS handshake. This means that we - // also need to start our own timers now. - timeout := dialer.Timeout - - if !dialer.Deadline.IsZero() { - deadlineTimeout := dialer.Deadline.Sub(time.Now()) - if timeout == 0 || deadlineTimeout < timeout { - timeout = deadlineTimeout - } - } - - var errChannel chan error - - if timeout != 0 { - errChannel = make(chan error, 2) - time.AfterFunc(timeout, func() { - errChannel <- errors.New("") - }) - } - - proxyDialer, err := sockets.DialerFromEnvironment(dialer) - if err != nil { - return nil, err - } - - rawConn, err := proxyDialer.Dial(network, addr) - if err != nil { - return nil, err - } - // When we set up a TCP connection for hijack, there could be long periods - // of inactivity (a long running command with no output) that in certain - // network setups may cause ECONNTIMEOUT, leaving the client in an unknown - // state. Setting TCP KeepAlive on the socket connection will prohibit - // ECONNTIMEOUT unless the socket connection truly is broken - if tcpConn, ok := rawConn.(*net.TCPConn); ok { - tcpConn.SetKeepAlive(true) - tcpConn.SetKeepAlivePeriod(30 * time.Second) - } - - colonPos := strings.LastIndex(addr, ":") - if colonPos == -1 { - colonPos = len(addr) - } - hostname := addr[:colonPos] - - // If no ServerName is set, infer the ServerName - // from the hostname we're connecting to. - if config.ServerName == "" { - // Make a copy to avoid polluting argument or default. - config = tlsconfig.Clone(config) - config.ServerName = hostname - } - - conn := tls.Client(rawConn, config) - - if timeout == 0 { - err = conn.Handshake() - } else { - go func() { - errChannel <- conn.Handshake() - }() - - err = <-errChannel - } - - if err != nil { - rawConn.Close() - return nil, err - } - - // This is Docker difference with standard's crypto/tls package: returned a - // wrapper which holds both the TLS and raw connections. - return &tlsClientCon{conn, rawConn}, nil -} - -func dial(proto, addr string, tlsConfig *tls.Config) (net.Conn, error) { - if tlsConfig != nil && proto != "unix" && proto != "npipe" { - // Notice this isn't Go standard's tls.Dial function - return tlsDial(proto, addr, tlsConfig) - } - if proto == "npipe" { - return sockets.DialPipe(addr, 32*time.Second) - } - return net.Dial(proto, addr) -} diff --git a/vendor/github.com/docker/docker/client/image_build.go b/vendor/github.com/docker/docker/client/image_build.go deleted file mode 100644 index 6fde75dc..00000000 --- a/vendor/github.com/docker/docker/client/image_build.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -import ( - "encoding/base64" - "encoding/json" - "io" - "net/http" - "net/url" - "strconv" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" -) - -// ImageBuild sends request to the daemon to build images. -// The Body in the response implement an io.ReadCloser and it's up to the caller to -// close it. -func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { - query, err := cli.imageBuildOptionsToQuery(options) - if err != nil { - return types.ImageBuildResponse{}, err - } - - headers := http.Header(make(map[string][]string)) - buf, err := json.Marshal(options.AuthConfigs) - if err != nil { - return types.ImageBuildResponse{}, err - } - headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf)) - headers.Set("Content-Type", "application/tar") - - serverResp, err := cli.postRaw(ctx, "/build", query, buildContext, headers) - if err != nil { - return types.ImageBuildResponse{}, err - } - - osType := getDockerOS(serverResp.header.Get("Server")) - - return types.ImageBuildResponse{ - Body: serverResp.body, - OSType: osType, - }, nil -} - -func (cli *Client) imageBuildOptionsToQuery(options types.ImageBuildOptions) (url.Values, error) { - query := url.Values{ - "t": options.Tags, - "securityopt": options.SecurityOpt, - } - if options.SuppressOutput { - query.Set("q", "1") - } - if options.RemoteContext != "" { - query.Set("remote", options.RemoteContext) - } - if options.NoCache { - query.Set("nocache", "1") - } - if options.Remove { - query.Set("rm", "1") - } else { - query.Set("rm", "0") - } - - if options.ForceRemove { - query.Set("forcerm", "1") - } - - if options.PullParent { - query.Set("pull", "1") - } - - if options.Squash { - if err := cli.NewVersionError("1.25", "squash"); err != nil { - return query, err - } - query.Set("squash", "1") - } - - if !container.Isolation.IsDefault(options.Isolation) { - query.Set("isolation", string(options.Isolation)) - } - - query.Set("cpusetcpus", options.CPUSetCPUs) - query.Set("networkmode", options.NetworkMode) - query.Set("cpusetmems", options.CPUSetMems) - query.Set("cpushares", strconv.FormatInt(options.CPUShares, 10)) - query.Set("cpuquota", strconv.FormatInt(options.CPUQuota, 10)) - query.Set("cpuperiod", strconv.FormatInt(options.CPUPeriod, 10)) - query.Set("memory", strconv.FormatInt(options.Memory, 10)) - query.Set("memswap", strconv.FormatInt(options.MemorySwap, 10)) - query.Set("cgroupparent", options.CgroupParent) - query.Set("shmsize", strconv.FormatInt(options.ShmSize, 10)) - query.Set("dockerfile", options.Dockerfile) - - ulimitsJSON, err := json.Marshal(options.Ulimits) - if err != nil { - return query, err - } - query.Set("ulimits", string(ulimitsJSON)) - - buildArgsJSON, err := json.Marshal(options.BuildArgs) - if err != nil { - return query, err - } - query.Set("buildargs", string(buildArgsJSON)) - - labelsJSON, err := json.Marshal(options.Labels) - if err != nil { - return query, err - } - query.Set("labels", string(labelsJSON)) - - cacheFromJSON, err := json.Marshal(options.CacheFrom) - if err != nil { - return query, err - } - query.Set("cachefrom", string(cacheFromJSON)) - - return query, nil -} diff --git a/vendor/github.com/docker/docker/client/image_create.go b/vendor/github.com/docker/docker/client/image_create.go deleted file mode 100644 index cf023a71..00000000 --- a/vendor/github.com/docker/docker/client/image_create.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "io" - "net/url" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/reference" -) - -// ImageCreate creates a new image based in the parent options. -// It returns the JSON content in the response body. -func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { - repository, tag, err := reference.Parse(parentReference) - if err != nil { - return nil, err - } - - query := url.Values{} - query.Set("fromImage", repository) - query.Set("tag", tag) - resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) - if err != nil { - return nil, err - } - return resp.body, nil -} - -func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.post(ctx, "/images/create", query, nil, headers) -} diff --git a/vendor/github.com/docker/docker/client/image_history.go b/vendor/github.com/docker/docker/client/image_history.go deleted file mode 100644 index acb1ee92..00000000 --- a/vendor/github.com/docker/docker/client/image_history.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ImageHistory returns the changes in an image in history format. -func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]types.ImageHistory, error) { - var history []types.ImageHistory - serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil) - if err != nil { - return history, err - } - - err = json.NewDecoder(serverResp.body).Decode(&history) - ensureReaderClosed(serverResp) - return history, err -} diff --git a/vendor/github.com/docker/docker/client/image_import.go b/vendor/github.com/docker/docker/client/image_import.go deleted file mode 100644 index c6f154b2..00000000 --- a/vendor/github.com/docker/docker/client/image_import.go +++ /dev/null @@ -1,37 +0,0 @@ -package client - -import ( - "io" - "net/url" - - "golang.org/x/net/context" - - "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" -) - -// ImageImport creates a new image based in the source options. -// It returns the JSON content in the response body. -func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { - if ref != "" { - //Check if the given image name can be resolved - if _, err := reference.ParseNamed(ref); err != nil { - return nil, err - } - } - - query := url.Values{} - query.Set("fromSrc", source.SourceName) - query.Set("repo", ref) - query.Set("tag", options.Tag) - query.Set("message", options.Message) - for _, change := range options.Changes { - query.Add("changes", change) - } - - resp, err := cli.postRaw(ctx, "/images/create", query, source.Source, nil) - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/image_inspect.go b/vendor/github.com/docker/docker/client/image_inspect.go deleted file mode 100644 index b3a64ce2..00000000 --- a/vendor/github.com/docker/docker/client/image_inspect.go +++ /dev/null @@ -1,33 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ImageInspectWithRaw returns the image information and its raw representation. -func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) { - serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return types.ImageInspect{}, nil, imageNotFoundError{imageID} - } - return types.ImageInspect{}, nil, err - } - defer ensureReaderClosed(serverResp) - - body, err := ioutil.ReadAll(serverResp.body) - if err != nil { - return types.ImageInspect{}, nil, err - } - - var response types.ImageInspect - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&response) - return response, body, err -} diff --git a/vendor/github.com/docker/docker/client/image_list.go b/vendor/github.com/docker/docker/client/image_list.go deleted file mode 100644 index f26464f6..00000000 --- a/vendor/github.com/docker/docker/client/image_list.go +++ /dev/null @@ -1,45 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/versions" - "golang.org/x/net/context" -) - -// ImageList returns a list of images in the docker host. -func (cli *Client) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) { - var images []types.ImageSummary - query := url.Values{} - - optionFilters := options.Filters - referenceFilters := optionFilters.Get("reference") - if versions.LessThan(cli.version, "1.25") && len(referenceFilters) > 0 { - query.Set("filter", referenceFilters[0]) - for _, filterValue := range referenceFilters { - optionFilters.Del("reference", filterValue) - } - } - if optionFilters.Len() > 0 { - filterJSON, err := filters.ToParamWithVersion(cli.version, optionFilters) - if err != nil { - return images, err - } - query.Set("filters", filterJSON) - } - if options.All { - query.Set("all", "1") - } - - serverResp, err := cli.get(ctx, "/images/json", query, nil) - if err != nil { - return images, err - } - - err = json.NewDecoder(serverResp.body).Decode(&images) - ensureReaderClosed(serverResp) - return images, err -} diff --git a/vendor/github.com/docker/docker/client/image_load.go b/vendor/github.com/docker/docker/client/image_load.go deleted file mode 100644 index 77aaf1af..00000000 --- a/vendor/github.com/docker/docker/client/image_load.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -import ( - "io" - "net/url" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" -) - -// ImageLoad loads an image in the docker host from the client host. -// It's up to the caller to close the io.ReadCloser in the -// ImageLoadResponse returned by this function. -func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { - v := url.Values{} - v.Set("quiet", "0") - if quiet { - v.Set("quiet", "1") - } - headers := map[string][]string{"Content-Type": {"application/x-tar"}} - resp, err := cli.postRaw(ctx, "/images/load", v, input, headers) - if err != nil { - return types.ImageLoadResponse{}, err - } - return types.ImageLoadResponse{ - Body: resp.body, - JSON: resp.header.Get("Content-Type") == "application/json", - }, nil -} diff --git a/vendor/github.com/docker/docker/client/image_prune.go b/vendor/github.com/docker/docker/client/image_prune.go deleted file mode 100644 index 5ef98b7f..00000000 --- a/vendor/github.com/docker/docker/client/image_prune.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// ImagesPrune requests the daemon to delete unused data -func (cli *Client) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (types.ImagesPruneReport, error) { - var report types.ImagesPruneReport - - if err := cli.NewVersionError("1.25", "image prune"); err != nil { - return report, err - } - - query, err := getFiltersQuery(pruneFilters) - if err != nil { - return report, err - } - - serverResp, err := cli.post(ctx, "/images/prune", query, nil, nil) - if err != nil { - return report, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { - return report, fmt.Errorf("Error retrieving disk usage: %v", err) - } - - return report, nil -} diff --git a/vendor/github.com/docker/docker/client/image_pull.go b/vendor/github.com/docker/docker/client/image_pull.go deleted file mode 100644 index 3bffdb70..00000000 --- a/vendor/github.com/docker/docker/client/image_pull.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -import ( - "io" - "net/http" - "net/url" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/reference" -) - -// ImagePull requests the docker host to pull an image from a remote registry. -// It executes the privileged function if the operation is unauthorized -// and it tries one more time. -// It's up to the caller to handle the io.ReadCloser and close it properly. -// -// FIXME(vdemeester): there is currently used in a few way in docker/docker -// - if not in trusted content, ref is used to pass the whole reference, and tag is empty -// - if in trusted content, ref is used to pass the reference name, and tag for the digest -func (cli *Client) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) { - repository, tag, err := reference.Parse(ref) - if err != nil { - return nil, err - } - - query := url.Values{} - query.Set("fromImage", repository) - if tag != "" && !options.All { - query.Set("tag", tag) - } - - resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) - if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { - newAuthHeader, privilegeErr := options.PrivilegeFunc() - if privilegeErr != nil { - return nil, privilegeErr - } - resp, err = cli.tryImageCreate(ctx, query, newAuthHeader) - } - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/image_push.go b/vendor/github.com/docker/docker/client/image_push.go deleted file mode 100644 index 8e73d28f..00000000 --- a/vendor/github.com/docker/docker/client/image_push.go +++ /dev/null @@ -1,54 +0,0 @@ -package client - -import ( - "errors" - "io" - "net/http" - "net/url" - - "golang.org/x/net/context" - - distreference "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" -) - -// ImagePush requests the docker host to push an image to a remote registry. -// It executes the privileged function if the operation is unauthorized -// and it tries one more time. -// It's up to the caller to handle the io.ReadCloser and close it properly. -func (cli *Client) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) { - distributionRef, err := distreference.ParseNamed(ref) - if err != nil { - return nil, err - } - - if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical { - return nil, errors.New("cannot push a digest reference") - } - - var tag = "" - if nameTaggedRef, isNamedTagged := distributionRef.(distreference.NamedTagged); isNamedTagged { - tag = nameTaggedRef.Tag() - } - - query := url.Values{} - query.Set("tag", tag) - - resp, err := cli.tryImagePush(ctx, distributionRef.Name(), query, options.RegistryAuth) - if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { - newAuthHeader, privilegeErr := options.PrivilegeFunc() - if privilegeErr != nil { - return nil, privilegeErr - } - resp, err = cli.tryImagePush(ctx, distributionRef.Name(), query, newAuthHeader) - } - if err != nil { - return nil, err - } - return resp.body, nil -} - -func (cli *Client) tryImagePush(ctx context.Context, imageID string, query url.Values, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.post(ctx, "/images/"+imageID+"/push", query, nil, headers) -} diff --git a/vendor/github.com/docker/docker/client/image_remove.go b/vendor/github.com/docker/docker/client/image_remove.go deleted file mode 100644 index 839e5311..00000000 --- a/vendor/github.com/docker/docker/client/image_remove.go +++ /dev/null @@ -1,31 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ImageRemove removes an image from the docker host. -func (cli *Client) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) { - query := url.Values{} - - if options.Force { - query.Set("force", "1") - } - if !options.PruneChildren { - query.Set("noprune", "1") - } - - resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) - if err != nil { - return nil, err - } - - var dels []types.ImageDelete - err = json.NewDecoder(resp.body).Decode(&dels) - ensureReaderClosed(resp) - return dels, err -} diff --git a/vendor/github.com/docker/docker/client/image_save.go b/vendor/github.com/docker/docker/client/image_save.go deleted file mode 100644 index ecac880a..00000000 --- a/vendor/github.com/docker/docker/client/image_save.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "io" - "net/url" - - "golang.org/x/net/context" -) - -// ImageSave retrieves one or more images from the docker host as an io.ReadCloser. -// It's up to the caller to store the images and close the stream. -func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) { - query := url.Values{ - "names": imageIDs, - } - - resp, err := cli.get(ctx, "/images/get", query, nil) - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/image_search.go b/vendor/github.com/docker/docker/client/image_search.go deleted file mode 100644 index b0fcd5c2..00000000 --- a/vendor/github.com/docker/docker/client/image_search.go +++ /dev/null @@ -1,51 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" - "golang.org/x/net/context" -) - -// ImageSearch makes the docker host to search by a term in a remote registry. -// The list of results is not sorted in any fashion. -func (cli *Client) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) { - var results []registry.SearchResult - query := url.Values{} - query.Set("term", term) - query.Set("limit", fmt.Sprintf("%d", options.Limit)) - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParam(options.Filters) - if err != nil { - return results, err - } - query.Set("filters", filterJSON) - } - - resp, err := cli.tryImageSearch(ctx, query, options.RegistryAuth) - if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { - newAuthHeader, privilegeErr := options.PrivilegeFunc() - if privilegeErr != nil { - return results, privilegeErr - } - resp, err = cli.tryImageSearch(ctx, query, newAuthHeader) - } - if err != nil { - return results, err - } - - err = json.NewDecoder(resp.body).Decode(&results) - ensureReaderClosed(resp) - return results, err -} - -func (cli *Client) tryImageSearch(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.get(ctx, "/images/search", query, headers) -} diff --git a/vendor/github.com/docker/docker/client/image_tag.go b/vendor/github.com/docker/docker/client/image_tag.go deleted file mode 100644 index bdbf94ad..00000000 --- a/vendor/github.com/docker/docker/client/image_tag.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "errors" - "fmt" - "net/url" - - "golang.org/x/net/context" - - distreference "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types/reference" -) - -// ImageTag tags an image in the docker host -func (cli *Client) ImageTag(ctx context.Context, imageID, ref string) error { - distributionRef, err := distreference.ParseNamed(ref) - if err != nil { - return fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", ref) - } - - if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical { - return errors.New("refusing to create a tag with a digest reference") - } - - tag := reference.GetTagFromNamedRef(distributionRef) - - query := url.Values{} - query.Set("repo", distributionRef.Name()) - query.Set("tag", tag) - - resp, err := cli.post(ctx, "/images/"+imageID+"/tag", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/info.go b/vendor/github.com/docker/docker/client/info.go deleted file mode 100644 index ac079612..00000000 --- a/vendor/github.com/docker/docker/client/info.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// Info returns information about the docker server. -func (cli *Client) Info(ctx context.Context) (types.Info, error) { - var info types.Info - serverResp, err := cli.get(ctx, "/info", url.Values{}, nil) - if err != nil { - return info, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&info); err != nil { - return info, fmt.Errorf("Error reading remote info: %v", err) - } - - return info, nil -} diff --git a/vendor/github.com/docker/docker/client/interface.go b/vendor/github.com/docker/docker/client/interface.go deleted file mode 100644 index 05978039..00000000 --- a/vendor/github.com/docker/docker/client/interface.go +++ /dev/null @@ -1,171 +0,0 @@ -package client - -import ( - "io" - "time" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/events" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/network" - "github.com/docker/docker/api/types/registry" - "github.com/docker/docker/api/types/swarm" - volumetypes "github.com/docker/docker/api/types/volume" - "golang.org/x/net/context" -) - -// CommonAPIClient is the common methods between stable and experimental versions of APIClient. -type CommonAPIClient interface { - ContainerAPIClient - ImageAPIClient - NodeAPIClient - NetworkAPIClient - PluginAPIClient - ServiceAPIClient - SwarmAPIClient - SecretAPIClient - SystemAPIClient - VolumeAPIClient - ClientVersion() string - ServerVersion(ctx context.Context) (types.Version, error) - UpdateClientVersion(v string) -} - -// ContainerAPIClient defines API client methods for the containers -type ContainerAPIClient interface { - ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) - ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) - ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) - ContainerDiff(ctx context.Context, container string) ([]types.ContainerChange, error) - ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error) - ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) - ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) - ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error - ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error - ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) - ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) - ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) - ContainerKill(ctx context.Context, container, signal string) error - ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) - ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) - ContainerPause(ctx context.Context, container string) error - ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error - ContainerRename(ctx context.Context, container, newContainerName string) error - ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error - ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error - ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) - ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) - ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error - ContainerStop(ctx context.Context, container string, timeout *time.Duration) error - ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) - ContainerUnpause(ctx context.Context, container string) error - ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) - ContainerWait(ctx context.Context, container string) (int64, error) - CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) - CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error - ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) -} - -// ImageAPIClient defines API client methods for the images -type ImageAPIClient interface { - ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) - ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) - ImageHistory(ctx context.Context, image string) ([]types.ImageHistory, error) - ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) - ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) - ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) - ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) - ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) - ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) - ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) - ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) - ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) - ImageTag(ctx context.Context, image, ref string) error - ImagesPrune(ctx context.Context, pruneFilter filters.Args) (types.ImagesPruneReport, error) -} - -// NetworkAPIClient defines API client methods for the networks -type NetworkAPIClient interface { - NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error - NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) - NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error - NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) - NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) - NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) - NetworkRemove(ctx context.Context, networkID string) error - NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error) -} - -// NodeAPIClient defines API client methods for the nodes -type NodeAPIClient interface { - NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) - NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) - NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error - NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error -} - -// PluginAPIClient defines API client methods for the plugins -type PluginAPIClient interface { - PluginList(ctx context.Context) (types.PluginsListResponse, error) - PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error - PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error - PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error - PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) - PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) - PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) - PluginSet(ctx context.Context, name string, args []string) error - PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) - PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error -} - -// ServiceAPIClient defines API client methods for the services -type ServiceAPIClient interface { - ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) - ServiceInspectWithRaw(ctx context.Context, serviceID string) (swarm.Service, []byte, error) - ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) - ServiceRemove(ctx context.Context, serviceID string) error - ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) - ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) - TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) - TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) -} - -// SwarmAPIClient defines API client methods for the swarm -type SwarmAPIClient interface { - SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) - SwarmJoin(ctx context.Context, req swarm.JoinRequest) error - SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) - SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error - SwarmLeave(ctx context.Context, force bool) error - SwarmInspect(ctx context.Context) (swarm.Swarm, error) - SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error -} - -// SystemAPIClient defines API client methods for the system -type SystemAPIClient interface { - Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) - Info(ctx context.Context) (types.Info, error) - RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) - DiskUsage(ctx context.Context) (types.DiskUsage, error) - Ping(ctx context.Context) (types.Ping, error) -} - -// VolumeAPIClient defines API client methods for the volumes -type VolumeAPIClient interface { - VolumeCreate(ctx context.Context, options volumetypes.VolumesCreateBody) (types.Volume, error) - VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) - VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) - VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumesListOKBody, error) - VolumeRemove(ctx context.Context, volumeID string, force bool) error - VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error) -} - -// SecretAPIClient defines API client methods for secrets -type SecretAPIClient interface { - SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) - SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) - SecretRemove(ctx context.Context, id string) error - SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) - SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error -} diff --git a/vendor/github.com/docker/docker/client/interface_experimental.go b/vendor/github.com/docker/docker/client/interface_experimental.go deleted file mode 100644 index 51da98ec..00000000 --- a/vendor/github.com/docker/docker/client/interface_experimental.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -type apiClientExperimental interface { - CheckpointAPIClient -} - -// CheckpointAPIClient defines API client methods for the checkpoints -type CheckpointAPIClient interface { - CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error - CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error - CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) -} diff --git a/vendor/github.com/docker/docker/client/interface_stable.go b/vendor/github.com/docker/docker/client/interface_stable.go deleted file mode 100644 index cc90a3cb..00000000 --- a/vendor/github.com/docker/docker/client/interface_stable.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -// APIClient is an interface that clients that talk with a docker server must implement. -type APIClient interface { - CommonAPIClient - apiClientExperimental -} - -// Ensure that Client always implements APIClient. -var _ APIClient = &Client{} diff --git a/vendor/github.com/docker/docker/client/login.go b/vendor/github.com/docker/docker/client/login.go deleted file mode 100644 index 600dc719..00000000 --- a/vendor/github.com/docker/docker/client/login.go +++ /dev/null @@ -1,29 +0,0 @@ -package client - -import ( - "encoding/json" - "net/http" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/registry" - "golang.org/x/net/context" -) - -// RegistryLogin authenticates the docker server with a given docker registry. -// It returns UnauthorizerError when the authentication fails. -func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { - resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil) - - if resp.statusCode == http.StatusUnauthorized { - return registry.AuthenticateOKBody{}, unauthorizedError{err} - } - if err != nil { - return registry.AuthenticateOKBody{}, err - } - - var response registry.AuthenticateOKBody - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/network_connect.go b/vendor/github.com/docker/docker/client/network_connect.go deleted file mode 100644 index c022c17b..00000000 --- a/vendor/github.com/docker/docker/client/network_connect.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/network" - "golang.org/x/net/context" -) - -// NetworkConnect connects a container to an existent network in the docker host. -func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error { - nc := types.NetworkConnect{ - Container: containerID, - EndpointConfig: config, - } - resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/network_create.go b/vendor/github.com/docker/docker/client/network_create.go deleted file mode 100644 index 4067a541..00000000 --- a/vendor/github.com/docker/docker/client/network_create.go +++ /dev/null @@ -1,25 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// NetworkCreate creates a new network in the docker host. -func (cli *Client) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { - networkCreateRequest := types.NetworkCreateRequest{ - NetworkCreate: options, - Name: name, - } - var response types.NetworkCreateResponse - serverResp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil) - if err != nil { - return response, err - } - - json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/network_disconnect.go b/vendor/github.com/docker/docker/client/network_disconnect.go deleted file mode 100644 index 24b58e3c..00000000 --- a/vendor/github.com/docker/docker/client/network_disconnect.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// NetworkDisconnect disconnects a container from an existent network in the docker host. -func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error { - nd := types.NetworkDisconnect{Container: containerID, Force: force} - resp, err := cli.post(ctx, "/networks/"+networkID+"/disconnect", nil, nd, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/network_inspect.go b/vendor/github.com/docker/docker/client/network_inspect.go deleted file mode 100644 index 5ad4ea5b..00000000 --- a/vendor/github.com/docker/docker/client/network_inspect.go +++ /dev/null @@ -1,38 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// NetworkInspect returns the information for a specific network configured in the docker host. -func (cli *Client) NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) { - networkResource, _, err := cli.NetworkInspectWithRaw(ctx, networkID) - return networkResource, err -} - -// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation. -func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) { - var networkResource types.NetworkResource - resp, err := cli.get(ctx, "/networks/"+networkID, nil, nil) - if err != nil { - if resp.statusCode == http.StatusNotFound { - return networkResource, nil, networkNotFoundError{networkID} - } - return networkResource, nil, err - } - defer ensureReaderClosed(resp) - - body, err := ioutil.ReadAll(resp.body) - if err != nil { - return networkResource, nil, err - } - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&networkResource) - return networkResource, body, err -} diff --git a/vendor/github.com/docker/docker/client/network_list.go b/vendor/github.com/docker/docker/client/network_list.go deleted file mode 100644 index e566a93e..00000000 --- a/vendor/github.com/docker/docker/client/network_list.go +++ /dev/null @@ -1,31 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// NetworkList returns the list of networks configured in the docker host. -func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { - query := url.Values{} - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - var networkResources []types.NetworkResource - resp, err := cli.get(ctx, "/networks", query, nil) - if err != nil { - return networkResources, err - } - err = json.NewDecoder(resp.body).Decode(&networkResources) - ensureReaderClosed(resp) - return networkResources, err -} diff --git a/vendor/github.com/docker/docker/client/network_prune.go b/vendor/github.com/docker/docker/client/network_prune.go deleted file mode 100644 index 7352a7f0..00000000 --- a/vendor/github.com/docker/docker/client/network_prune.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// NetworksPrune requests the daemon to delete unused networks -func (cli *Client) NetworksPrune(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error) { - var report types.NetworksPruneReport - - if err := cli.NewVersionError("1.25", "network prune"); err != nil { - return report, err - } - - query, err := getFiltersQuery(pruneFilters) - if err != nil { - return report, err - } - - serverResp, err := cli.post(ctx, "/networks/prune", query, nil, nil) - if err != nil { - return report, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { - return report, fmt.Errorf("Error retrieving network prune report: %v", err) - } - - return report, nil -} diff --git a/vendor/github.com/docker/docker/client/network_remove.go b/vendor/github.com/docker/docker/client/network_remove.go deleted file mode 100644 index 6bd67489..00000000 --- a/vendor/github.com/docker/docker/client/network_remove.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import "golang.org/x/net/context" - -// NetworkRemove removes an existent network from the docker host. -func (cli *Client) NetworkRemove(ctx context.Context, networkID string) error { - resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/node_inspect.go b/vendor/github.com/docker/docker/client/node_inspect.go deleted file mode 100644 index abf505d2..00000000 --- a/vendor/github.com/docker/docker/client/node_inspect.go +++ /dev/null @@ -1,33 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// NodeInspectWithRaw returns the node information. -func (cli *Client) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { - serverResp, err := cli.get(ctx, "/nodes/"+nodeID, nil, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return swarm.Node{}, nil, nodeNotFoundError{nodeID} - } - return swarm.Node{}, nil, err - } - defer ensureReaderClosed(serverResp) - - body, err := ioutil.ReadAll(serverResp.body) - if err != nil { - return swarm.Node{}, nil, err - } - - var response swarm.Node - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&response) - return response, body, err -} diff --git a/vendor/github.com/docker/docker/client/node_list.go b/vendor/github.com/docker/docker/client/node_list.go deleted file mode 100644 index 3e8440f0..00000000 --- a/vendor/github.com/docker/docker/client/node_list.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// NodeList returns the list of nodes. -func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { - query := url.Values{} - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParam(options.Filters) - - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - - resp, err := cli.get(ctx, "/nodes", query, nil) - if err != nil { - return nil, err - } - - var nodes []swarm.Node - err = json.NewDecoder(resp.body).Decode(&nodes) - ensureReaderClosed(resp) - return nodes, err -} diff --git a/vendor/github.com/docker/docker/client/node_remove.go b/vendor/github.com/docker/docker/client/node_remove.go deleted file mode 100644 index 0a77f3d5..00000000 --- a/vendor/github.com/docker/docker/client/node_remove.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - - "golang.org/x/net/context" -) - -// NodeRemove removes a Node. -func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { - query := url.Values{} - if options.Force { - query.Set("force", "1") - } - - resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/node_update.go b/vendor/github.com/docker/docker/client/node_update.go deleted file mode 100644 index 3ca97602..00000000 --- a/vendor/github.com/docker/docker/client/node_update.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "net/url" - "strconv" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// NodeUpdate updates a Node. -func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { - query := url.Values{} - query.Set("version", strconv.FormatUint(version.Index, 10)) - resp, err := cli.post(ctx, "/nodes/"+nodeID+"/update", query, node, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/ping.go b/vendor/github.com/docker/docker/client/ping.go deleted file mode 100644 index 22dcda24..00000000 --- a/vendor/github.com/docker/docker/client/ping.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -import ( - "fmt" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// Ping pings the server and return the value of the "Docker-Experimental" & "API-Version" headers -func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { - var ping types.Ping - req, err := cli.buildRequest("GET", fmt.Sprintf("%s/_ping", cli.basePath), nil, nil) - if err != nil { - return ping, err - } - serverResp, err := cli.doRequest(ctx, req) - if err != nil { - return ping, err - } - defer ensureReaderClosed(serverResp) - - ping.APIVersion = serverResp.header.Get("API-Version") - - if serverResp.header.Get("Docker-Experimental") == "true" { - ping.Experimental = true - } - - return ping, nil -} diff --git a/vendor/github.com/docker/docker/client/plugin_create.go b/vendor/github.com/docker/docker/client/plugin_create.go deleted file mode 100644 index a660ba57..00000000 --- a/vendor/github.com/docker/docker/client/plugin_create.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "io" - "net/http" - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginCreate creates a plugin -func (cli *Client) PluginCreate(ctx context.Context, createContext io.Reader, createOptions types.PluginCreateOptions) error { - headers := http.Header(make(map[string][]string)) - headers.Set("Content-Type", "application/tar") - - query := url.Values{} - query.Set("name", createOptions.RepoName) - - resp, err := cli.postRaw(ctx, "/plugins/create", query, createContext, headers) - if err != nil { - return err - } - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/plugin_disable.go b/vendor/github.com/docker/docker/client/plugin_disable.go deleted file mode 100644 index 30467db7..00000000 --- a/vendor/github.com/docker/docker/client/plugin_disable.go +++ /dev/null @@ -1,19 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginDisable disables a plugin -func (cli *Client) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { - query := url.Values{} - if options.Force { - query.Set("force", "1") - } - resp, err := cli.post(ctx, "/plugins/"+name+"/disable", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/plugin_enable.go b/vendor/github.com/docker/docker/client/plugin_enable.go deleted file mode 100644 index 95517c4b..00000000 --- a/vendor/github.com/docker/docker/client/plugin_enable.go +++ /dev/null @@ -1,19 +0,0 @@ -package client - -import ( - "net/url" - "strconv" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginEnable enables a plugin -func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { - query := url.Values{} - query.Set("timeout", strconv.Itoa(options.Timeout)) - - resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/plugin_inspect.go b/vendor/github.com/docker/docker/client/plugin_inspect.go deleted file mode 100644 index 89f39ee2..00000000 --- a/vendor/github.com/docker/docker/client/plugin_inspect.go +++ /dev/null @@ -1,32 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginInspectWithRaw inspects an existing plugin -func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { - resp, err := cli.get(ctx, "/plugins/"+name+"/json", nil, nil) - if err != nil { - if resp.statusCode == http.StatusNotFound { - return nil, nil, pluginNotFoundError{name} - } - return nil, nil, err - } - - defer ensureReaderClosed(resp) - body, err := ioutil.ReadAll(resp.body) - if err != nil { - return nil, nil, err - } - var p types.Plugin - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&p) - return &p, body, err -} diff --git a/vendor/github.com/docker/docker/client/plugin_install.go b/vendor/github.com/docker/docker/client/plugin_install.go deleted file mode 100644 index 3217c4cf..00000000 --- a/vendor/github.com/docker/docker/client/plugin_install.go +++ /dev/null @@ -1,113 +0,0 @@ -package client - -import ( - "encoding/json" - "io" - "net/http" - "net/url" - - "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/pkg/errors" - "golang.org/x/net/context" -) - -// PluginInstall installs a plugin -func (cli *Client) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (rc io.ReadCloser, err error) { - query := url.Values{} - if _, err := reference.ParseNamed(options.RemoteRef); err != nil { - return nil, errors.Wrap(err, "invalid remote reference") - } - query.Set("remote", options.RemoteRef) - - privileges, err := cli.checkPluginPermissions(ctx, query, options) - if err != nil { - return nil, err - } - - // set name for plugin pull, if empty should default to remote reference - query.Set("name", name) - - resp, err := cli.tryPluginPull(ctx, query, privileges, options.RegistryAuth) - if err != nil { - return nil, err - } - - name = resp.header.Get("Docker-Plugin-Name") - - pr, pw := io.Pipe() - go func() { // todo: the client should probably be designed more around the actual api - _, err := io.Copy(pw, resp.body) - if err != nil { - pw.CloseWithError(err) - return - } - defer func() { - if err != nil { - delResp, _ := cli.delete(ctx, "/plugins/"+name, nil, nil) - ensureReaderClosed(delResp) - } - }() - if len(options.Args) > 0 { - if err := cli.PluginSet(ctx, name, options.Args); err != nil { - pw.CloseWithError(err) - return - } - } - - if options.Disabled { - pw.Close() - return - } - - err = cli.PluginEnable(ctx, name, types.PluginEnableOptions{Timeout: 0}) - pw.CloseWithError(err) - }() - return pr, nil -} - -func (cli *Client) tryPluginPrivileges(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.get(ctx, "/plugins/privileges", query, headers) -} - -func (cli *Client) tryPluginPull(ctx context.Context, query url.Values, privileges types.PluginPrivileges, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.post(ctx, "/plugins/pull", query, privileges, headers) -} - -func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, options types.PluginInstallOptions) (types.PluginPrivileges, error) { - resp, err := cli.tryPluginPrivileges(ctx, query, options.RegistryAuth) - if resp.statusCode == http.StatusUnauthorized && options.PrivilegeFunc != nil { - // todo: do inspect before to check existing name before checking privileges - newAuthHeader, privilegeErr := options.PrivilegeFunc() - if privilegeErr != nil { - ensureReaderClosed(resp) - return nil, privilegeErr - } - options.RegistryAuth = newAuthHeader - resp, err = cli.tryPluginPrivileges(ctx, query, options.RegistryAuth) - } - if err != nil { - ensureReaderClosed(resp) - return nil, err - } - - var privileges types.PluginPrivileges - if err := json.NewDecoder(resp.body).Decode(&privileges); err != nil { - ensureReaderClosed(resp) - return nil, err - } - ensureReaderClosed(resp) - - if !options.AcceptAllPermissions && options.AcceptPermissionsFunc != nil && len(privileges) > 0 { - accept, err := options.AcceptPermissionsFunc(privileges) - if err != nil { - return nil, err - } - if !accept { - return nil, pluginPermissionDenied{options.RemoteRef} - } - } - return privileges, nil -} diff --git a/vendor/github.com/docker/docker/client/plugin_list.go b/vendor/github.com/docker/docker/client/plugin_list.go deleted file mode 100644 index 88c480a3..00000000 --- a/vendor/github.com/docker/docker/client/plugin_list.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginList returns the installed plugins -func (cli *Client) PluginList(ctx context.Context) (types.PluginsListResponse, error) { - var plugins types.PluginsListResponse - resp, err := cli.get(ctx, "/plugins", nil, nil) - if err != nil { - return plugins, err - } - - err = json.NewDecoder(resp.body).Decode(&plugins) - ensureReaderClosed(resp) - return plugins, err -} diff --git a/vendor/github.com/docker/docker/client/plugin_push.go b/vendor/github.com/docker/docker/client/plugin_push.go deleted file mode 100644 index 1e5f9632..00000000 --- a/vendor/github.com/docker/docker/client/plugin_push.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import ( - "io" - - "golang.org/x/net/context" -) - -// PluginPush pushes a plugin to a registry -func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers) - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/plugin_remove.go b/vendor/github.com/docker/docker/client/plugin_remove.go deleted file mode 100644 index b017e4d3..00000000 --- a/vendor/github.com/docker/docker/client/plugin_remove.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// PluginRemove removes a plugin -func (cli *Client) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { - query := url.Values{} - if options.Force { - query.Set("force", "1") - } - - resp, err := cli.delete(ctx, "/plugins/"+name, query, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/plugin_set.go b/vendor/github.com/docker/docker/client/plugin_set.go deleted file mode 100644 index 3260d2a9..00000000 --- a/vendor/github.com/docker/docker/client/plugin_set.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -import ( - "golang.org/x/net/context" -) - -// PluginSet modifies settings for an existing plugin -func (cli *Client) PluginSet(ctx context.Context, name string, args []string) error { - resp, err := cli.post(ctx, "/plugins/"+name+"/set", nil, args, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/plugin_upgrade.go b/vendor/github.com/docker/docker/client/plugin_upgrade.go deleted file mode 100644 index 95a4356b..00000000 --- a/vendor/github.com/docker/docker/client/plugin_upgrade.go +++ /dev/null @@ -1,37 +0,0 @@ -package client - -import ( - "fmt" - "io" - "net/url" - - "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" - "github.com/pkg/errors" - "golang.org/x/net/context" -) - -// PluginUpgrade upgrades a plugin -func (cli *Client) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (rc io.ReadCloser, err error) { - query := url.Values{} - if _, err := reference.ParseNamed(options.RemoteRef); err != nil { - return nil, errors.Wrap(err, "invalid remote reference") - } - query.Set("remote", options.RemoteRef) - - privileges, err := cli.checkPluginPermissions(ctx, query, options) - if err != nil { - return nil, err - } - - resp, err := cli.tryPluginUpgrade(ctx, query, privileges, name, options.RegistryAuth) - if err != nil { - return nil, err - } - return resp.body, nil -} - -func (cli *Client) tryPluginUpgrade(ctx context.Context, query url.Values, privileges types.PluginPrivileges, name, registryAuth string) (serverResponse, error) { - headers := map[string][]string{"X-Registry-Auth": {registryAuth}} - return cli.post(ctx, fmt.Sprintf("/plugins/%s/upgrade", name), query, privileges, headers) -} diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go deleted file mode 100644 index ac053636..00000000 --- a/vendor/github.com/docker/docker/client/request.go +++ /dev/null @@ -1,247 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "strings" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/versions" - "github.com/pkg/errors" - "golang.org/x/net/context" - "golang.org/x/net/context/ctxhttp" -) - -// serverResponse is a wrapper for http API responses. -type serverResponse struct { - body io.ReadCloser - header http.Header - statusCode int -} - -// head sends an http request to the docker API using the method HEAD. -func (cli *Client) head(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "HEAD", path, query, nil, headers) -} - -// getWithContext sends an http request to the docker API using the method GET with a specific go context. -func (cli *Client) get(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "GET", path, query, nil, headers) -} - -// postWithContext sends an http request to the docker API using the method POST with a specific go context. -func (cli *Client) post(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) { - body, headers, err := encodeBody(obj, headers) - if err != nil { - return serverResponse{}, err - } - return cli.sendRequest(ctx, "POST", path, query, body, headers) -} - -func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "POST", path, query, body, headers) -} - -// put sends an http request to the docker API using the method PUT. -func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) { - body, headers, err := encodeBody(obj, headers) - if err != nil { - return serverResponse{}, err - } - return cli.sendRequest(ctx, "PUT", path, query, body, headers) -} - -// put sends an http request to the docker API using the method PUT. -func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "PUT", path, query, body, headers) -} - -// delete sends an http request to the docker API using the method DELETE. -func (cli *Client) delete(ctx context.Context, path string, query url.Values, headers map[string][]string) (serverResponse, error) { - return cli.sendRequest(ctx, "DELETE", path, query, nil, headers) -} - -type headers map[string][]string - -func encodeBody(obj interface{}, headers headers) (io.Reader, headers, error) { - if obj == nil { - return nil, headers, nil - } - - body, err := encodeData(obj) - if err != nil { - return nil, headers, err - } - if headers == nil { - headers = make(map[string][]string) - } - headers["Content-Type"] = []string{"application/json"} - return body, headers, nil -} - -func (cli *Client) buildRequest(method, path string, body io.Reader, headers headers) (*http.Request, error) { - expectedPayload := (method == "POST" || method == "PUT") - if expectedPayload && body == nil { - body = bytes.NewReader([]byte{}) - } - - req, err := http.NewRequest(method, path, body) - if err != nil { - return nil, err - } - req = cli.addHeaders(req, headers) - - if cli.proto == "unix" || cli.proto == "npipe" { - // For local communications, it doesn't matter what the host is. We just - // need a valid and meaningful host name. (See #189) - req.Host = "docker" - } - - req.URL.Host = cli.addr - req.URL.Scheme = cli.scheme - - if expectedPayload && req.Header.Get("Content-Type") == "" { - req.Header.Set("Content-Type", "text/plain") - } - return req, nil -} - -func (cli *Client) sendRequest(ctx context.Context, method, path string, query url.Values, body io.Reader, headers headers) (serverResponse, error) { - req, err := cli.buildRequest(method, cli.getAPIPath(path, query), body, headers) - if err != nil { - return serverResponse{}, err - } - return cli.doRequest(ctx, req) -} - -func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResponse, error) { - serverResp := serverResponse{statusCode: -1} - - resp, err := ctxhttp.Do(ctx, cli.client, req) - if err != nil { - if cli.scheme != "https" && strings.Contains(err.Error(), "malformed HTTP response") { - return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err) - } - - if cli.scheme == "https" && strings.Contains(err.Error(), "bad certificate") { - return serverResp, fmt.Errorf("The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings: %v", err) - } - - // Don't decorate context sentinel errors; users may be comparing to - // them directly. - switch err { - case context.Canceled, context.DeadlineExceeded: - return serverResp, err - } - - if nErr, ok := err.(*url.Error); ok { - if nErr, ok := nErr.Err.(*net.OpError); ok { - if os.IsPermission(nErr.Err) { - return serverResp, errors.Wrapf(err, "Got permission denied while trying to connect to the Docker daemon socket at %v", cli.host) - } - } - } - - if err, ok := err.(net.Error); ok { - if err.Timeout() { - return serverResp, ErrorConnectionFailed(cli.host) - } - if !err.Temporary() { - if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") { - return serverResp, ErrorConnectionFailed(cli.host) - } - } - } - - // Although there's not a strongly typed error for this in go-winio, - // lots of people are using the default configuration for the docker - // daemon on Windows where the daemon is listening on a named pipe - // `//./pipe/docker_engine, and the client must be running elevated. - // Give users a clue rather than the not-overly useful message - // such as `error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/info: - // open //./pipe/docker_engine: The system cannot find the file specified.`. - // Note we can't string compare "The system cannot find the file specified" as - // this is localised - for example in French the error would be - // `open //./pipe/docker_engine: Le fichier spécifié est introuvable.` - if strings.Contains(err.Error(), `open //./pipe/docker_engine`) { - err = errors.New(err.Error() + " In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.") - } - - return serverResp, errors.Wrap(err, "error during connect") - } - - if resp != nil { - serverResp.statusCode = resp.StatusCode - } - - if serverResp.statusCode < 200 || serverResp.statusCode >= 400 { - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return serverResp, err - } - if len(body) == 0 { - return serverResp, fmt.Errorf("Error: request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(serverResp.statusCode), req.URL) - } - - var errorMessage string - if (cli.version == "" || versions.GreaterThan(cli.version, "1.23")) && - resp.Header.Get("Content-Type") == "application/json" { - var errorResponse types.ErrorResponse - if err := json.Unmarshal(body, &errorResponse); err != nil { - return serverResp, fmt.Errorf("Error reading JSON: %v", err) - } - errorMessage = errorResponse.Message - } else { - errorMessage = string(body) - } - - return serverResp, fmt.Errorf("Error response from daemon: %s", strings.TrimSpace(errorMessage)) - } - - serverResp.body = resp.Body - serverResp.header = resp.Header - return serverResp, nil -} - -func (cli *Client) addHeaders(req *http.Request, headers headers) *http.Request { - // Add CLI Config's HTTP Headers BEFORE we set the Docker headers - // then the user can't change OUR headers - for k, v := range cli.customHTTPHeaders { - if versions.LessThan(cli.version, "1.25") && k == "User-Agent" { - continue - } - req.Header.Set(k, v) - } - - if headers != nil { - for k, v := range headers { - req.Header[k] = v - } - } - return req -} - -func encodeData(data interface{}) (*bytes.Buffer, error) { - params := bytes.NewBuffer(nil) - if data != nil { - if err := json.NewEncoder(params).Encode(data); err != nil { - return nil, err - } - } - return params, nil -} - -func ensureReaderClosed(response serverResponse) { - if body := response.body; body != nil { - // Drain up to 512 bytes and close the body to let the Transport reuse the connection - io.CopyN(ioutil.Discard, body, 512) - response.body.Close() - } -} diff --git a/vendor/github.com/docker/docker/client/secret_create.go b/vendor/github.com/docker/docker/client/secret_create.go deleted file mode 100644 index de8b0415..00000000 --- a/vendor/github.com/docker/docker/client/secret_create.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SecretCreate creates a new Secret. -func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { - var headers map[string][]string - - var response types.SecretCreateResponse - resp, err := cli.post(ctx, "/secrets/create", nil, secret, headers) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/secret_inspect.go b/vendor/github.com/docker/docker/client/secret_inspect.go deleted file mode 100644 index f7745761..00000000 --- a/vendor/github.com/docker/docker/client/secret_inspect.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SecretInspectWithRaw returns the secret information with raw data -func (cli *Client) SecretInspectWithRaw(ctx context.Context, id string) (swarm.Secret, []byte, error) { - resp, err := cli.get(ctx, "/secrets/"+id, nil, nil) - if err != nil { - if resp.statusCode == http.StatusNotFound { - return swarm.Secret{}, nil, secretNotFoundError{id} - } - return swarm.Secret{}, nil, err - } - defer ensureReaderClosed(resp) - - body, err := ioutil.ReadAll(resp.body) - if err != nil { - return swarm.Secret{}, nil, err - } - - var secret swarm.Secret - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&secret) - - return secret, body, err -} diff --git a/vendor/github.com/docker/docker/client/secret_list.go b/vendor/github.com/docker/docker/client/secret_list.go deleted file mode 100644 index 7e9d5ec1..00000000 --- a/vendor/github.com/docker/docker/client/secret_list.go +++ /dev/null @@ -1,35 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SecretList returns the list of secrets. -func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { - query := url.Values{} - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParam(options.Filters) - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - - resp, err := cli.get(ctx, "/secrets", query, nil) - if err != nil { - return nil, err - } - - var secrets []swarm.Secret - err = json.NewDecoder(resp.body).Decode(&secrets) - ensureReaderClosed(resp) - return secrets, err -} diff --git a/vendor/github.com/docker/docker/client/secret_remove.go b/vendor/github.com/docker/docker/client/secret_remove.go deleted file mode 100644 index 1955b988..00000000 --- a/vendor/github.com/docker/docker/client/secret_remove.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import "golang.org/x/net/context" - -// SecretRemove removes a Secret. -func (cli *Client) SecretRemove(ctx context.Context, id string) error { - resp, err := cli.delete(ctx, "/secrets/"+id, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/secret_update.go b/vendor/github.com/docker/docker/client/secret_update.go deleted file mode 100644 index b94e24aa..00000000 --- a/vendor/github.com/docker/docker/client/secret_update.go +++ /dev/null @@ -1,19 +0,0 @@ -package client - -import ( - "net/url" - "strconv" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SecretUpdate updates a Secret. Currently, the only part of a secret spec -// which can be updated is Labels. -func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { - query := url.Values{} - query.Set("version", strconv.FormatUint(version.Index, 10)) - resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/service_create.go b/vendor/github.com/docker/docker/client/service_create.go deleted file mode 100644 index 3d1be225..00000000 --- a/vendor/github.com/docker/docker/client/service_create.go +++ /dev/null @@ -1,30 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// ServiceCreate creates a new Service. -func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { - var headers map[string][]string - - if options.EncodedRegistryAuth != "" { - headers = map[string][]string{ - "X-Registry-Auth": {options.EncodedRegistryAuth}, - } - } - - var response types.ServiceCreateResponse - resp, err := cli.post(ctx, "/services/create", nil, service, headers) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/service_inspect.go b/vendor/github.com/docker/docker/client/service_inspect.go deleted file mode 100644 index ca71cbde..00000000 --- a/vendor/github.com/docker/docker/client/service_inspect.go +++ /dev/null @@ -1,33 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// ServiceInspectWithRaw returns the service information and the raw data. -func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string) (swarm.Service, []byte, error) { - serverResp, err := cli.get(ctx, "/services/"+serviceID, nil, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return swarm.Service{}, nil, serviceNotFoundError{serviceID} - } - return swarm.Service{}, nil, err - } - defer ensureReaderClosed(serverResp) - - body, err := ioutil.ReadAll(serverResp.body) - if err != nil { - return swarm.Service{}, nil, err - } - - var response swarm.Service - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&response) - return response, body, err -} diff --git a/vendor/github.com/docker/docker/client/service_list.go b/vendor/github.com/docker/docker/client/service_list.go deleted file mode 100644 index c29e6d40..00000000 --- a/vendor/github.com/docker/docker/client/service_list.go +++ /dev/null @@ -1,35 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// ServiceList returns the list of services. -func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { - query := url.Values{} - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParam(options.Filters) - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - - resp, err := cli.get(ctx, "/services", query, nil) - if err != nil { - return nil, err - } - - var services []swarm.Service - err = json.NewDecoder(resp.body).Decode(&services) - ensureReaderClosed(resp) - return services, err -} diff --git a/vendor/github.com/docker/docker/client/service_logs.go b/vendor/github.com/docker/docker/client/service_logs.go deleted file mode 100644 index 24384e3e..00000000 --- a/vendor/github.com/docker/docker/client/service_logs.go +++ /dev/null @@ -1,52 +0,0 @@ -package client - -import ( - "io" - "net/url" - "time" - - "golang.org/x/net/context" - - "github.com/docker/docker/api/types" - timetypes "github.com/docker/docker/api/types/time" -) - -// ServiceLogs returns the logs generated by a service in an io.ReadCloser. -// It's up to the caller to close the stream. -func (cli *Client) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { - query := url.Values{} - if options.ShowStdout { - query.Set("stdout", "1") - } - - if options.ShowStderr { - query.Set("stderr", "1") - } - - if options.Since != "" { - ts, err := timetypes.GetTimestamp(options.Since, time.Now()) - if err != nil { - return nil, err - } - query.Set("since", ts) - } - - if options.Timestamps { - query.Set("timestamps", "1") - } - - if options.Details { - query.Set("details", "1") - } - - if options.Follow { - query.Set("follow", "1") - } - query.Set("tail", options.Tail) - - resp, err := cli.get(ctx, "/services/"+serviceID+"/logs", query, nil) - if err != nil { - return nil, err - } - return resp.body, nil -} diff --git a/vendor/github.com/docker/docker/client/service_remove.go b/vendor/github.com/docker/docker/client/service_remove.go deleted file mode 100644 index a9331f92..00000000 --- a/vendor/github.com/docker/docker/client/service_remove.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import "golang.org/x/net/context" - -// ServiceRemove kills and removes a service. -func (cli *Client) ServiceRemove(ctx context.Context, serviceID string) error { - resp, err := cli.delete(ctx, "/services/"+serviceID, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/service_update.go b/vendor/github.com/docker/docker/client/service_update.go deleted file mode 100644 index afa94d47..00000000 --- a/vendor/github.com/docker/docker/client/service_update.go +++ /dev/null @@ -1,41 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - "strconv" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// ServiceUpdate updates a Service. -func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) { - var ( - headers map[string][]string - query = url.Values{} - ) - - if options.EncodedRegistryAuth != "" { - headers = map[string][]string{ - "X-Registry-Auth": {options.EncodedRegistryAuth}, - } - } - - if options.RegistryAuthFrom != "" { - query.Set("registryAuthFrom", options.RegistryAuthFrom) - } - - query.Set("version", strconv.FormatUint(version.Index, 10)) - - var response types.ServiceUpdateResponse - resp, err := cli.post(ctx, "/services/"+serviceID+"/update", query, service, headers) - if err != nil { - return response, err - } - - err = json.NewDecoder(resp.body).Decode(&response) - ensureReaderClosed(resp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go b/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go deleted file mode 100644 index be28d326..00000000 --- a/vendor/github.com/docker/docker/client/swarm_get_unlock_key.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// SwarmGetUnlockKey retrieves the swarm's unlock key. -func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { - serverResp, err := cli.get(ctx, "/swarm/unlockkey", nil, nil) - if err != nil { - return types.SwarmUnlockKeyResponse{}, err - } - - var response types.SwarmUnlockKeyResponse - err = json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/swarm_init.go b/vendor/github.com/docker/docker/client/swarm_init.go deleted file mode 100644 index fd45d066..00000000 --- a/vendor/github.com/docker/docker/client/swarm_init.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SwarmInit initializes the Swarm. -func (cli *Client) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { - serverResp, err := cli.post(ctx, "/swarm/init", nil, req, nil) - if err != nil { - return "", err - } - - var response string - err = json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/swarm_inspect.go b/vendor/github.com/docker/docker/client/swarm_inspect.go deleted file mode 100644 index 6d95cfc0..00000000 --- a/vendor/github.com/docker/docker/client/swarm_inspect.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SwarmInspect inspects the Swarm. -func (cli *Client) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { - serverResp, err := cli.get(ctx, "/swarm", nil, nil) - if err != nil { - return swarm.Swarm{}, err - } - - var response swarm.Swarm - err = json.NewDecoder(serverResp.body).Decode(&response) - ensureReaderClosed(serverResp) - return response, err -} diff --git a/vendor/github.com/docker/docker/client/swarm_join.go b/vendor/github.com/docker/docker/client/swarm_join.go deleted file mode 100644 index cda99930..00000000 --- a/vendor/github.com/docker/docker/client/swarm_join.go +++ /dev/null @@ -1,13 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SwarmJoin joins the Swarm. -func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { - resp, err := cli.post(ctx, "/swarm/join", nil, req, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/swarm_leave.go b/vendor/github.com/docker/docker/client/swarm_leave.go deleted file mode 100644 index a4df7321..00000000 --- a/vendor/github.com/docker/docker/client/swarm_leave.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "net/url" - - "golang.org/x/net/context" -) - -// SwarmLeave leaves the Swarm. -func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { - query := url.Values{} - if force { - query.Set("force", "1") - } - resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/swarm_unlock.go b/vendor/github.com/docker/docker/client/swarm_unlock.go deleted file mode 100644 index addfb59f..00000000 --- a/vendor/github.com/docker/docker/client/swarm_unlock.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SwarmUnlock unlockes locked swarm. -func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { - serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil) - if err != nil { - return err - } - - ensureReaderClosed(serverResp) - return err -} diff --git a/vendor/github.com/docker/docker/client/swarm_update.go b/vendor/github.com/docker/docker/client/swarm_update.go deleted file mode 100644 index cc8eeb65..00000000 --- a/vendor/github.com/docker/docker/client/swarm_update.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "fmt" - "net/url" - "strconv" - - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// SwarmUpdate updates the Swarm. -func (cli *Client) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { - query := url.Values{} - query.Set("version", strconv.FormatUint(version.Index, 10)) - query.Set("rotateWorkerToken", fmt.Sprintf("%v", flags.RotateWorkerToken)) - query.Set("rotateManagerToken", fmt.Sprintf("%v", flags.RotateManagerToken)) - query.Set("rotateManagerUnlockKey", fmt.Sprintf("%v", flags.RotateManagerUnlockKey)) - resp, err := cli.post(ctx, "/swarm/update", query, swarm, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/client/task_inspect.go b/vendor/github.com/docker/docker/client/task_inspect.go deleted file mode 100644 index bc8058fc..00000000 --- a/vendor/github.com/docker/docker/client/task_inspect.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types/swarm" - - "golang.org/x/net/context" -) - -// TaskInspectWithRaw returns the task information and its raw representation.. -func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { - serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil) - if err != nil { - if serverResp.statusCode == http.StatusNotFound { - return swarm.Task{}, nil, taskNotFoundError{taskID} - } - return swarm.Task{}, nil, err - } - defer ensureReaderClosed(serverResp) - - body, err := ioutil.ReadAll(serverResp.body) - if err != nil { - return swarm.Task{}, nil, err - } - - var response swarm.Task - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&response) - return response, body, err -} diff --git a/vendor/github.com/docker/docker/client/task_list.go b/vendor/github.com/docker/docker/client/task_list.go deleted file mode 100644 index 66324da9..00000000 --- a/vendor/github.com/docker/docker/client/task_list.go +++ /dev/null @@ -1,35 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/swarm" - "golang.org/x/net/context" -) - -// TaskList returns the list of tasks. -func (cli *Client) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { - query := url.Values{} - - if options.Filters.Len() > 0 { - filterJSON, err := filters.ToParam(options.Filters) - if err != nil { - return nil, err - } - - query.Set("filters", filterJSON) - } - - resp, err := cli.get(ctx, "/tasks", query, nil) - if err != nil { - return nil, err - } - - var tasks []swarm.Task - err = json.NewDecoder(resp.body).Decode(&tasks) - ensureReaderClosed(resp) - return tasks, err -} diff --git a/vendor/github.com/docker/docker/client/transport.go b/vendor/github.com/docker/docker/client/transport.go deleted file mode 100644 index f04e6016..00000000 --- a/vendor/github.com/docker/docker/client/transport.go +++ /dev/null @@ -1,28 +0,0 @@ -package client - -import ( - "crypto/tls" - "errors" - "net/http" -) - -var errTLSConfigUnavailable = errors.New("TLSConfig unavailable") - -// transportFunc allows us to inject a mock transport for testing. We define it -// here so we can detect the tlsconfig and return nil for only this type. -type transportFunc func(*http.Request) (*http.Response, error) - -func (tf transportFunc) RoundTrip(req *http.Request) (*http.Response, error) { - return tf(req) -} - -// resolveTLSConfig attempts to resolve the tls configuration from the -// RoundTripper. -func resolveTLSConfig(transport http.RoundTripper) *tls.Config { - switch tr := transport.(type) { - case *http.Transport: - return tr.TLSClientConfig - default: - return nil - } -} diff --git a/vendor/github.com/docker/docker/client/utils.go b/vendor/github.com/docker/docker/client/utils.go deleted file mode 100644 index 23d520ec..00000000 --- a/vendor/github.com/docker/docker/client/utils.go +++ /dev/null @@ -1,33 +0,0 @@ -package client - -import ( - "github.com/docker/docker/api/types/filters" - "net/url" - "regexp" -) - -var headerRegexp = regexp.MustCompile(`\ADocker/.+\s\((.+)\)\z`) - -// getDockerOS returns the operating system based on the server header from the daemon. -func getDockerOS(serverHeader string) string { - var osType string - matches := headerRegexp.FindStringSubmatch(serverHeader) - if len(matches) > 0 { - osType = matches[1] - } - return osType -} - -// getFiltersQuery returns a url query with "filters" query term, based on the -// filters provided. -func getFiltersQuery(f filters.Args) (url.Values, error) { - query := url.Values{} - if f.Len() > 0 { - filterJSON, err := filters.ToParam(f) - if err != nil { - return query, err - } - query.Set("filters", filterJSON) - } - return query, nil -} diff --git a/vendor/github.com/docker/docker/client/version.go b/vendor/github.com/docker/docker/client/version.go deleted file mode 100644 index 933ceb4a..00000000 --- a/vendor/github.com/docker/docker/client/version.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// ServerVersion returns information of the docker client and server host. -func (cli *Client) ServerVersion(ctx context.Context) (types.Version, error) { - resp, err := cli.get(ctx, "/version", nil, nil) - if err != nil { - return types.Version{}, err - } - - var server types.Version - err = json.NewDecoder(resp.body).Decode(&server) - ensureReaderClosed(resp) - return server, err -} diff --git a/vendor/github.com/docker/docker/client/volume_create.go b/vendor/github.com/docker/docker/client/volume_create.go deleted file mode 100644 index 9620c87c..00000000 --- a/vendor/github.com/docker/docker/client/volume_create.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "encoding/json" - - "github.com/docker/docker/api/types" - volumetypes "github.com/docker/docker/api/types/volume" - "golang.org/x/net/context" -) - -// VolumeCreate creates a volume in the docker host. -func (cli *Client) VolumeCreate(ctx context.Context, options volumetypes.VolumesCreateBody) (types.Volume, error) { - var volume types.Volume - resp, err := cli.post(ctx, "/volumes/create", nil, options, nil) - if err != nil { - return volume, err - } - err = json.NewDecoder(resp.body).Decode(&volume) - ensureReaderClosed(resp) - return volume, err -} diff --git a/vendor/github.com/docker/docker/client/volume_inspect.go b/vendor/github.com/docker/docker/client/volume_inspect.go deleted file mode 100644 index 3860e9b2..00000000 --- a/vendor/github.com/docker/docker/client/volume_inspect.go +++ /dev/null @@ -1,38 +0,0 @@ -package client - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "net/http" - - "github.com/docker/docker/api/types" - "golang.org/x/net/context" -) - -// VolumeInspect returns the information about a specific volume in the docker host. -func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { - volume, _, err := cli.VolumeInspectWithRaw(ctx, volumeID) - return volume, err -} - -// VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation -func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { - var volume types.Volume - resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil) - if err != nil { - if resp.statusCode == http.StatusNotFound { - return volume, nil, volumeNotFoundError{volumeID} - } - return volume, nil, err - } - defer ensureReaderClosed(resp) - - body, err := ioutil.ReadAll(resp.body) - if err != nil { - return volume, nil, err - } - rdr := bytes.NewReader(body) - err = json.NewDecoder(rdr).Decode(&volume) - return volume, body, err -} diff --git a/vendor/github.com/docker/docker/client/volume_list.go b/vendor/github.com/docker/docker/client/volume_list.go deleted file mode 100644 index 32247ce1..00000000 --- a/vendor/github.com/docker/docker/client/volume_list.go +++ /dev/null @@ -1,32 +0,0 @@ -package client - -import ( - "encoding/json" - "net/url" - - "github.com/docker/docker/api/types/filters" - volumetypes "github.com/docker/docker/api/types/volume" - "golang.org/x/net/context" -) - -// VolumeList returns the volumes configured in the docker host. -func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumesListOKBody, error) { - var volumes volumetypes.VolumesListOKBody - query := url.Values{} - - if filter.Len() > 0 { - filterJSON, err := filters.ToParamWithVersion(cli.version, filter) - if err != nil { - return volumes, err - } - query.Set("filters", filterJSON) - } - resp, err := cli.get(ctx, "/volumes", query, nil) - if err != nil { - return volumes, err - } - - err = json.NewDecoder(resp.body).Decode(&volumes) - ensureReaderClosed(resp) - return volumes, err -} diff --git a/vendor/github.com/docker/docker/client/volume_prune.go b/vendor/github.com/docker/docker/client/volume_prune.go deleted file mode 100644 index a07e4ce6..00000000 --- a/vendor/github.com/docker/docker/client/volume_prune.go +++ /dev/null @@ -1,36 +0,0 @@ -package client - -import ( - "encoding/json" - "fmt" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/filters" - "golang.org/x/net/context" -) - -// VolumesPrune requests the daemon to delete unused data -func (cli *Client) VolumesPrune(ctx context.Context, pruneFilters filters.Args) (types.VolumesPruneReport, error) { - var report types.VolumesPruneReport - - if err := cli.NewVersionError("1.25", "volume prune"); err != nil { - return report, err - } - - query, err := getFiltersQuery(pruneFilters) - if err != nil { - return report, err - } - - serverResp, err := cli.post(ctx, "/volumes/prune", query, nil, nil) - if err != nil { - return report, err - } - defer ensureReaderClosed(serverResp) - - if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { - return report, fmt.Errorf("Error retrieving disk usage: %v", err) - } - - return report, nil -} diff --git a/vendor/github.com/docker/docker/client/volume_remove.go b/vendor/github.com/docker/docker/client/volume_remove.go deleted file mode 100644 index 6c26575b..00000000 --- a/vendor/github.com/docker/docker/client/volume_remove.go +++ /dev/null @@ -1,21 +0,0 @@ -package client - -import ( - "net/url" - - "github.com/docker/docker/api/types/versions" - "golang.org/x/net/context" -) - -// VolumeRemove removes a volume from the docker host. -func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error { - query := url.Values{} - if versions.GreaterThanOrEqualTo(cli.version, "1.25") { - if force { - query.Set("force", "1") - } - } - resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil) - ensureReaderClosed(resp) - return err -} diff --git a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone.go b/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone.go deleted file mode 100644 index e4dec3a5..00000000 --- a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build go1.8 - -package tlsconfig - -import "crypto/tls" - -// Clone returns a clone of tls.Config. This function is provided for -// compatibility for go1.7 that doesn't include this method in stdlib. -func Clone(c *tls.Config) *tls.Config { - return c.Clone() -} diff --git a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go16.go b/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go16.go deleted file mode 100644 index 0b816650..00000000 --- a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go16.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build go1.6,!go1.7 - -package tlsconfig - -import "crypto/tls" - -// Clone returns a clone of tls.Config. This function is provided for -// compatibility for go1.6 that doesn't include this method in stdlib. -func Clone(c *tls.Config) *tls.Config { - return &tls.Config{ - Rand: c.Rand, - Time: c.Time, - Certificates: c.Certificates, - NameToCertificate: c.NameToCertificate, - GetCertificate: c.GetCertificate, - RootCAs: c.RootCAs, - NextProtos: c.NextProtos, - ServerName: c.ServerName, - ClientAuth: c.ClientAuth, - ClientCAs: c.ClientCAs, - InsecureSkipVerify: c.InsecureSkipVerify, - CipherSuites: c.CipherSuites, - PreferServerCipherSuites: c.PreferServerCipherSuites, - SessionTicketsDisabled: c.SessionTicketsDisabled, - SessionTicketKey: c.SessionTicketKey, - ClientSessionCache: c.ClientSessionCache, - MinVersion: c.MinVersion, - MaxVersion: c.MaxVersion, - CurvePreferences: c.CurvePreferences, - } -} diff --git a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go17.go b/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go17.go deleted file mode 100644 index 0d5b448f..00000000 --- a/vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone_go17.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build go1.7,!go1.8 - -package tlsconfig - -import "crypto/tls" - -// Clone returns a clone of tls.Config. This function is provided for -// compatibility for go1.7 that doesn't include this method in stdlib. -func Clone(c *tls.Config) *tls.Config { - return &tls.Config{ - Rand: c.Rand, - Time: c.Time, - Certificates: c.Certificates, - NameToCertificate: c.NameToCertificate, - GetCertificate: c.GetCertificate, - RootCAs: c.RootCAs, - NextProtos: c.NextProtos, - ServerName: c.ServerName, - ClientAuth: c.ClientAuth, - ClientCAs: c.ClientCAs, - InsecureSkipVerify: c.InsecureSkipVerify, - CipherSuites: c.CipherSuites, - PreferServerCipherSuites: c.PreferServerCipherSuites, - SessionTicketsDisabled: c.SessionTicketsDisabled, - SessionTicketKey: c.SessionTicketKey, - ClientSessionCache: c.ClientSessionCache, - MinVersion: c.MinVersion, - MaxVersion: c.MaxVersion, - CurvePreferences: c.CurvePreferences, - DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, - Renegotiation: c.Renegotiation, - } -} diff --git a/vendor/github.com/docker/go-connections/LICENSE b/vendor/github.com/docker/go-connections/LICENSE deleted file mode 100644 index b55b37bc..00000000 --- a/vendor/github.com/docker/go-connections/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/go-connections/nat/nat.go b/vendor/github.com/docker/go-connections/nat/nat.go deleted file mode 100644 index bb7e4e33..00000000 --- a/vendor/github.com/docker/go-connections/nat/nat.go +++ /dev/null @@ -1,242 +0,0 @@ -// Package nat is a convenience package for manipulation of strings describing network ports. -package nat - -import ( - "fmt" - "net" - "strconv" - "strings" -) - -const ( - // portSpecTemplate is the expected format for port specifications - portSpecTemplate = "ip:hostPort:containerPort" -) - -// PortBinding represents a binding between a Host IP address and a Host Port -type PortBinding struct { - // HostIP is the host IP Address - HostIP string `json:"HostIp"` - // HostPort is the host port number - HostPort string -} - -// PortMap is a collection of PortBinding indexed by Port -type PortMap map[Port][]PortBinding - -// PortSet is a collection of structs indexed by Port -type PortSet map[Port]struct{} - -// Port is a string containing port number and protocol in the format "80/tcp" -type Port string - -// NewPort creates a new instance of a Port given a protocol and port number or port range -func NewPort(proto, port string) (Port, error) { - // Check for parsing issues on "port" now so we can avoid having - // to check it later on. - - portStartInt, portEndInt, err := ParsePortRangeToInt(port) - if err != nil { - return "", err - } - - if portStartInt == portEndInt { - return Port(fmt.Sprintf("%d/%s", portStartInt, proto)), nil - } - return Port(fmt.Sprintf("%d-%d/%s", portStartInt, portEndInt, proto)), nil -} - -// ParsePort parses the port number string and returns an int -func ParsePort(rawPort string) (int, error) { - if len(rawPort) == 0 { - return 0, nil - } - port, err := strconv.ParseUint(rawPort, 10, 16) - if err != nil { - return 0, err - } - return int(port), nil -} - -// ParsePortRangeToInt parses the port range string and returns start/end ints -func ParsePortRangeToInt(rawPort string) (int, int, error) { - if len(rawPort) == 0 { - return 0, 0, nil - } - start, end, err := ParsePortRange(rawPort) - if err != nil { - return 0, 0, err - } - return int(start), int(end), nil -} - -// Proto returns the protocol of a Port -func (p Port) Proto() string { - proto, _ := SplitProtoPort(string(p)) - return proto -} - -// Port returns the port number of a Port -func (p Port) Port() string { - _, port := SplitProtoPort(string(p)) - return port -} - -// Int returns the port number of a Port as an int -func (p Port) Int() int { - portStr := p.Port() - // We don't need to check for an error because we're going to - // assume that any error would have been found, and reported, in NewPort() - port, _ := ParsePort(portStr) - return port -} - -// Range returns the start/end port numbers of a Port range as ints -func (p Port) Range() (int, int, error) { - return ParsePortRangeToInt(p.Port()) -} - -// SplitProtoPort splits a port in the format of proto/port -func SplitProtoPort(rawPort string) (string, string) { - parts := strings.Split(rawPort, "/") - l := len(parts) - if len(rawPort) == 0 || l == 0 || len(parts[0]) == 0 { - return "", "" - } - if l == 1 { - return "tcp", rawPort - } - if len(parts[1]) == 0 { - return "tcp", parts[0] - } - return parts[1], parts[0] -} - -func validateProto(proto string) bool { - for _, availableProto := range []string{"tcp", "udp", "sctp"} { - if availableProto == proto { - return true - } - } - return false -} - -// ParsePortSpecs receives port specs in the format of ip:public:private/proto and parses -// these in to the internal types -func ParsePortSpecs(ports []string) (map[Port]struct{}, map[Port][]PortBinding, error) { - var ( - exposedPorts = make(map[Port]struct{}, len(ports)) - bindings = make(map[Port][]PortBinding) - ) - for _, rawPort := range ports { - portMappings, err := ParsePortSpec(rawPort) - if err != nil { - return nil, nil, err - } - - for _, portMapping := range portMappings { - port := portMapping.Port - if _, exists := exposedPorts[port]; !exists { - exposedPorts[port] = struct{}{} - } - bslice, exists := bindings[port] - if !exists { - bslice = []PortBinding{} - } - bindings[port] = append(bslice, portMapping.Binding) - } - } - return exposedPorts, bindings, nil -} - -// PortMapping is a data object mapping a Port to a PortBinding -type PortMapping struct { - Port Port - Binding PortBinding -} - -func splitParts(rawport string) (string, string, string) { - parts := strings.Split(rawport, ":") - n := len(parts) - containerport := parts[n-1] - - switch n { - case 1: - return "", "", containerport - case 2: - return "", parts[0], containerport - case 3: - return parts[0], parts[1], containerport - default: - return strings.Join(parts[:n-2], ":"), parts[n-2], containerport - } -} - -// ParsePortSpec parses a port specification string into a slice of PortMappings -func ParsePortSpec(rawPort string) ([]PortMapping, error) { - var proto string - rawIP, hostPort, containerPort := splitParts(rawPort) - proto, containerPort = SplitProtoPort(containerPort) - - // Strip [] from IPV6 addresses - ip, _, err := net.SplitHostPort(rawIP + ":") - if err != nil { - return nil, fmt.Errorf("Invalid ip address %v: %s", rawIP, err) - } - if ip != "" && net.ParseIP(ip) == nil { - return nil, fmt.Errorf("Invalid ip address: %s", ip) - } - if containerPort == "" { - return nil, fmt.Errorf("No port specified: %s", rawPort) - } - - startPort, endPort, err := ParsePortRange(containerPort) - if err != nil { - return nil, fmt.Errorf("Invalid containerPort: %s", containerPort) - } - - var startHostPort, endHostPort uint64 = 0, 0 - if len(hostPort) > 0 { - startHostPort, endHostPort, err = ParsePortRange(hostPort) - if err != nil { - return nil, fmt.Errorf("Invalid hostPort: %s", hostPort) - } - } - - if hostPort != "" && (endPort-startPort) != (endHostPort-startHostPort) { - // Allow host port range iff containerPort is not a range. - // In this case, use the host port range as the dynamic - // host port range to allocate into. - if endPort != startPort { - return nil, fmt.Errorf("Invalid ranges specified for container and host Ports: %s and %s", containerPort, hostPort) - } - } - - if !validateProto(strings.ToLower(proto)) { - return nil, fmt.Errorf("Invalid proto: %s", proto) - } - - ports := []PortMapping{} - for i := uint64(0); i <= (endPort - startPort); i++ { - containerPort = strconv.FormatUint(startPort+i, 10) - if len(hostPort) > 0 { - hostPort = strconv.FormatUint(startHostPort+i, 10) - } - // Set hostPort to a range only if there is a single container port - // and a dynamic host port. - if startPort == endPort && startHostPort != endHostPort { - hostPort = fmt.Sprintf("%s-%s", hostPort, strconv.FormatUint(endHostPort, 10)) - } - port, err := NewPort(strings.ToLower(proto), containerPort) - if err != nil { - return nil, err - } - - binding := PortBinding{ - HostIP: ip, - HostPort: hostPort, - } - ports = append(ports, PortMapping{Port: port, Binding: binding}) - } - return ports, nil -} diff --git a/vendor/github.com/docker/go-connections/nat/parse.go b/vendor/github.com/docker/go-connections/nat/parse.go deleted file mode 100644 index 892adf8c..00000000 --- a/vendor/github.com/docker/go-connections/nat/parse.go +++ /dev/null @@ -1,57 +0,0 @@ -package nat - -import ( - "fmt" - "strconv" - "strings" -) - -// PartParser parses and validates the specified string (data) using the specified template -// e.g. ip:public:private -> 192.168.0.1:80:8000 -// DEPRECATED: do not use, this function may be removed in a future version -func PartParser(template, data string) (map[string]string, error) { - // ip:public:private - var ( - templateParts = strings.Split(template, ":") - parts = strings.Split(data, ":") - out = make(map[string]string, len(templateParts)) - ) - if len(parts) != len(templateParts) { - return nil, fmt.Errorf("Invalid format to parse. %s should match template %s", data, template) - } - - for i, t := range templateParts { - value := "" - if len(parts) > i { - value = parts[i] - } - out[t] = value - } - return out, nil -} - -// ParsePortRange parses and validates the specified string as a port-range (8000-9000) -func ParsePortRange(ports string) (uint64, uint64, error) { - if ports == "" { - return 0, 0, fmt.Errorf("Empty string specified for ports.") - } - if !strings.Contains(ports, "-") { - start, err := strconv.ParseUint(ports, 10, 16) - end := start - return start, end, err - } - - parts := strings.Split(ports, "-") - start, err := strconv.ParseUint(parts[0], 10, 16) - if err != nil { - return 0, 0, err - } - end, err := strconv.ParseUint(parts[1], 10, 16) - if err != nil { - return 0, 0, err - } - if end < start { - return 0, 0, fmt.Errorf("Invalid range specified for the Port: %s", ports) - } - return start, end, nil -} diff --git a/vendor/github.com/docker/go-connections/nat/sort.go b/vendor/github.com/docker/go-connections/nat/sort.go deleted file mode 100644 index ce950171..00000000 --- a/vendor/github.com/docker/go-connections/nat/sort.go +++ /dev/null @@ -1,96 +0,0 @@ -package nat - -import ( - "sort" - "strings" -) - -type portSorter struct { - ports []Port - by func(i, j Port) bool -} - -func (s *portSorter) Len() int { - return len(s.ports) -} - -func (s *portSorter) Swap(i, j int) { - s.ports[i], s.ports[j] = s.ports[j], s.ports[i] -} - -func (s *portSorter) Less(i, j int) bool { - ip := s.ports[i] - jp := s.ports[j] - - return s.by(ip, jp) -} - -// Sort sorts a list of ports using the provided predicate -// This function should compare `i` and `j`, returning true if `i` is -// considered to be less than `j` -func Sort(ports []Port, predicate func(i, j Port) bool) { - s := &portSorter{ports, predicate} - sort.Sort(s) -} - -type portMapEntry struct { - port Port - binding PortBinding -} - -type portMapSorter []portMapEntry - -func (s portMapSorter) Len() int { return len(s) } -func (s portMapSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// sort the port so that the order is: -// 1. port with larger specified bindings -// 2. larger port -// 3. port with tcp protocol -func (s portMapSorter) Less(i, j int) bool { - pi, pj := s[i].port, s[j].port - hpi, hpj := toInt(s[i].binding.HostPort), toInt(s[j].binding.HostPort) - return hpi > hpj || pi.Int() > pj.Int() || (pi.Int() == pj.Int() && strings.ToLower(pi.Proto()) == "tcp") -} - -// SortPortMap sorts the list of ports and their respected mapping. The ports -// will explicit HostPort will be placed first. -func SortPortMap(ports []Port, bindings PortMap) { - s := portMapSorter{} - for _, p := range ports { - if binding, ok := bindings[p]; ok { - for _, b := range binding { - s = append(s, portMapEntry{port: p, binding: b}) - } - bindings[p] = []PortBinding{} - } else { - s = append(s, portMapEntry{port: p}) - } - } - - sort.Sort(s) - var ( - i int - pm = make(map[Port]struct{}) - ) - // reorder ports - for _, entry := range s { - if _, ok := pm[entry.port]; !ok { - ports[i] = entry.port - pm[entry.port] = struct{}{} - i++ - } - // reorder bindings for this port - if _, ok := bindings[entry.port]; ok { - bindings[entry.port] = append(bindings[entry.port], entry.binding) - } - } -} - -func toInt(s string) uint64 { - i, _, err := ParsePortRange(s) - if err != nil { - i = 0 - } - return i -} diff --git a/vendor/github.com/docker/go-connections/sockets/README.md b/vendor/github.com/docker/go-connections/sockets/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/github.com/docker/go-connections/sockets/inmem_socket.go b/vendor/github.com/docker/go-connections/sockets/inmem_socket.go deleted file mode 100644 index 99846ffd..00000000 --- a/vendor/github.com/docker/go-connections/sockets/inmem_socket.go +++ /dev/null @@ -1,81 +0,0 @@ -package sockets - -import ( - "errors" - "net" - "sync" -) - -var errClosed = errors.New("use of closed network connection") - -// InmemSocket implements net.Listener using in-memory only connections. -type InmemSocket struct { - chConn chan net.Conn - chClose chan struct{} - addr string - mu sync.Mutex -} - -// dummyAddr is used to satisfy net.Addr for the in-mem socket -// it is just stored as a string and returns the string for all calls -type dummyAddr string - -// NewInmemSocket creates an in-memory only net.Listener -// The addr argument can be any string, but is used to satisfy the `Addr()` part -// of the net.Listener interface -func NewInmemSocket(addr string, bufSize int) *InmemSocket { - return &InmemSocket{ - chConn: make(chan net.Conn, bufSize), - chClose: make(chan struct{}), - addr: addr, - } -} - -// Addr returns the socket's addr string to satisfy net.Listener -func (s *InmemSocket) Addr() net.Addr { - return dummyAddr(s.addr) -} - -// Accept implements the Accept method in the Listener interface; it waits for the next call and returns a generic Conn. -func (s *InmemSocket) Accept() (net.Conn, error) { - select { - case conn := <-s.chConn: - return conn, nil - case <-s.chClose: - return nil, errClosed - } -} - -// Close closes the listener. It will be unavailable for use once closed. -func (s *InmemSocket) Close() error { - s.mu.Lock() - defer s.mu.Unlock() - select { - case <-s.chClose: - default: - close(s.chClose) - } - return nil -} - -// Dial is used to establish a connection with the in-mem server -func (s *InmemSocket) Dial(network, addr string) (net.Conn, error) { - srvConn, clientConn := net.Pipe() - select { - case s.chConn <- srvConn: - case <-s.chClose: - return nil, errClosed - } - - return clientConn, nil -} - -// Network returns the addr string, satisfies net.Addr -func (a dummyAddr) Network() string { - return string(a) -} - -// String returns the string form -func (a dummyAddr) String() string { - return string(a) -} diff --git a/vendor/github.com/docker/go-connections/sockets/proxy.go b/vendor/github.com/docker/go-connections/sockets/proxy.go deleted file mode 100644 index 98e9a1dc..00000000 --- a/vendor/github.com/docker/go-connections/sockets/proxy.go +++ /dev/null @@ -1,51 +0,0 @@ -package sockets - -import ( - "net" - "net/url" - "os" - "strings" - - "golang.org/x/net/proxy" -) - -// GetProxyEnv allows access to the uppercase and the lowercase forms of -// proxy-related variables. See the Go specification for details on these -// variables. https://golang.org/pkg/net/http/ -func GetProxyEnv(key string) string { - proxyValue := os.Getenv(strings.ToUpper(key)) - if proxyValue == "" { - return os.Getenv(strings.ToLower(key)) - } - return proxyValue -} - -// DialerFromEnvironment takes in a "direct" *net.Dialer and returns a -// proxy.Dialer which will route the connections through the proxy using the -// given dialer. -func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error) { - allProxy := GetProxyEnv("all_proxy") - if len(allProxy) == 0 { - return direct, nil - } - - proxyURL, err := url.Parse(allProxy) - if err != nil { - return direct, err - } - - proxyFromURL, err := proxy.FromURL(proxyURL, direct) - if err != nil { - return direct, err - } - - noProxy := GetProxyEnv("no_proxy") - if len(noProxy) == 0 { - return proxyFromURL, nil - } - - perHost := proxy.NewPerHost(proxyFromURL, direct) - perHost.AddFromString(noProxy) - - return perHost, nil -} diff --git a/vendor/github.com/docker/go-connections/sockets/sockets.go b/vendor/github.com/docker/go-connections/sockets/sockets.go deleted file mode 100644 index a1d7beb4..00000000 --- a/vendor/github.com/docker/go-connections/sockets/sockets.go +++ /dev/null @@ -1,38 +0,0 @@ -// Package sockets provides helper functions to create and configure Unix or TCP sockets. -package sockets - -import ( - "errors" - "net" - "net/http" - "time" -) - -// Why 32? See https://github.com/docker/docker/pull/8035. -const defaultTimeout = 32 * time.Second - -// ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system. -var ErrProtocolNotAvailable = errors.New("protocol not available") - -// ConfigureTransport configures the specified Transport according to the -// specified proto and addr. -// If the proto is unix (using a unix socket to communicate) or npipe the -// compression is disabled. -func ConfigureTransport(tr *http.Transport, proto, addr string) error { - switch proto { - case "unix": - return configureUnixTransport(tr, proto, addr) - case "npipe": - return configureNpipeTransport(tr, proto, addr) - default: - tr.Proxy = http.ProxyFromEnvironment - dialer, err := DialerFromEnvironment(&net.Dialer{ - Timeout: defaultTimeout, - }) - if err != nil { - return err - } - tr.Dial = dialer.Dial - } - return nil -} diff --git a/vendor/github.com/docker/go-connections/sockets/sockets_unix.go b/vendor/github.com/docker/go-connections/sockets/sockets_unix.go deleted file mode 100644 index 386cf0db..00000000 --- a/vendor/github.com/docker/go-connections/sockets/sockets_unix.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build !windows - -package sockets - -import ( - "fmt" - "net" - "net/http" - "syscall" - "time" -) - -const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) - -func configureUnixTransport(tr *http.Transport, proto, addr string) error { - if len(addr) > maxUnixSocketPathSize { - return fmt.Errorf("Unix socket path %q is too long", addr) - } - // No need for compression in local communications. - tr.DisableCompression = true - tr.Dial = func(_, _ string) (net.Conn, error) { - return net.DialTimeout(proto, addr, defaultTimeout) - } - return nil -} - -func configureNpipeTransport(tr *http.Transport, proto, addr string) error { - return ErrProtocolNotAvailable -} - -// DialPipe connects to a Windows named pipe. -// This is not supported on other OSes. -func DialPipe(_ string, _ time.Duration) (net.Conn, error) { - return nil, syscall.EAFNOSUPPORT -} diff --git a/vendor/github.com/docker/go-connections/sockets/sockets_windows.go b/vendor/github.com/docker/go-connections/sockets/sockets_windows.go deleted file mode 100644 index 5c21644e..00000000 --- a/vendor/github.com/docker/go-connections/sockets/sockets_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -package sockets - -import ( - "net" - "net/http" - "time" - - "github.com/Microsoft/go-winio" -) - -func configureUnixTransport(tr *http.Transport, proto, addr string) error { - return ErrProtocolNotAvailable -} - -func configureNpipeTransport(tr *http.Transport, proto, addr string) error { - // No need for compression in local communications. - tr.DisableCompression = true - tr.Dial = func(_, _ string) (net.Conn, error) { - return DialPipe(addr, defaultTimeout) - } - return nil -} - -// DialPipe connects to a Windows named pipe. -func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { - return winio.DialPipe(addr, &timeout) -} diff --git a/vendor/github.com/docker/go-connections/sockets/tcp_socket.go b/vendor/github.com/docker/go-connections/sockets/tcp_socket.go deleted file mode 100644 index 53cbb6c7..00000000 --- a/vendor/github.com/docker/go-connections/sockets/tcp_socket.go +++ /dev/null @@ -1,22 +0,0 @@ -// Package sockets provides helper functions to create and configure Unix or TCP sockets. -package sockets - -import ( - "crypto/tls" - "net" -) - -// NewTCPSocket creates a TCP socket listener with the specified address and -// the specified tls configuration. If TLSConfig is set, will encapsulate the -// TCP listener inside a TLS one. -func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { - l, err := net.Listen("tcp", addr) - if err != nil { - return nil, err - } - if tlsConfig != nil { - tlsConfig.NextProtos = []string{"http/1.1"} - l = tls.NewListener(l, tlsConfig) - } - return l, nil -} diff --git a/vendor/github.com/docker/go-connections/sockets/unix_socket.go b/vendor/github.com/docker/go-connections/sockets/unix_socket.go deleted file mode 100644 index a8b5dbb6..00000000 --- a/vendor/github.com/docker/go-connections/sockets/unix_socket.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build !windows - -package sockets - -import ( - "net" - "os" - "syscall" -) - -// NewUnixSocket creates a unix socket with the specified path and group. -func NewUnixSocket(path string, gid int) (net.Listener, error) { - if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { - return nil, err - } - mask := syscall.Umask(0777) - defer syscall.Umask(mask) - - l, err := net.Listen("unix", path) - if err != nil { - return nil, err - } - if err := os.Chown(path, 0, gid); err != nil { - l.Close() - return nil, err - } - if err := os.Chmod(path, 0660); err != nil { - l.Close() - return nil, err - } - return l, nil -} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go b/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go deleted file mode 100644 index 1ca0965e..00000000 --- a/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build go1.7 - -package tlsconfig - -import ( - "crypto/x509" - "runtime" -) - -// SystemCertPool returns a copy of the system cert pool, -// returns an error if failed to load or empty pool on windows. -func SystemCertPool() (*x509.CertPool, error) { - certpool, err := x509.SystemCertPool() - if err != nil && runtime.GOOS == "windows" { - return x509.NewCertPool(), nil - } - return certpool, err -} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go b/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go deleted file mode 100644 index 1ff81c33..00000000 --- a/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !go1.7 - -package tlsconfig - -import ( - "crypto/x509" -) - -// SystemCertPool returns an new empty cert pool, -// accessing system cert pool is supported in go 1.7 -func SystemCertPool() (*x509.CertPool, error) { - return x509.NewCertPool(), nil -} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/config.go b/vendor/github.com/docker/go-connections/tlsconfig/config.go deleted file mode 100644 index 0ef3fdcb..00000000 --- a/vendor/github.com/docker/go-connections/tlsconfig/config.go +++ /dev/null @@ -1,254 +0,0 @@ -// Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. -// -// As a reminder from https://golang.org/pkg/crypto/tls/#Config: -// A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. -// A Config may be reused; the tls package will also not modify it. -package tlsconfig - -import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" - "fmt" - "io/ioutil" - "os" - - "github.com/pkg/errors" -) - -// Options represents the information needed to create client and server TLS configurations. -type Options struct { - CAFile string - - // If either CertFile or KeyFile is empty, Client() will not load them - // preventing the client from authenticating to the server. - // However, Server() requires them and will error out if they are empty. - CertFile string - KeyFile string - - // client-only option - InsecureSkipVerify bool - // server-only option - ClientAuth tls.ClientAuthType - // If ExclusiveRootPools is set, then if a CA file is provided, the root pool used for TLS - // creds will include exclusively the roots in that CA file. If no CA file is provided, - // the system pool will be used. - ExclusiveRootPools bool - MinVersion uint16 - // If Passphrase is set, it will be used to decrypt a TLS private key - // if the key is encrypted - Passphrase string -} - -// Extra (server-side) accepted CBC cipher suites - will phase out in the future -var acceptedCBCCiphers = []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, -} - -// DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls -// options struct but wants to use a commonly accepted set of TLS cipher suites, with -// known weak algorithms removed. -var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...) - -// allTLSVersions lists all the TLS versions and is used by the code that validates -// a uint16 value as a TLS version. -var allTLSVersions = map[uint16]struct{}{ - tls.VersionSSL30: {}, - tls.VersionTLS10: {}, - tls.VersionTLS11: {}, - tls.VersionTLS12: {}, -} - -// ServerDefault returns a secure-enough TLS configuration for the server TLS configuration. -func ServerDefault(ops ...func(*tls.Config)) *tls.Config { - tlsconfig := &tls.Config{ - // Avoid fallback by default to SSL protocols < TLS1.2 - MinVersion: tls.VersionTLS12, - PreferServerCipherSuites: true, - CipherSuites: DefaultServerAcceptedCiphers, - } - - for _, op := range ops { - op(tlsconfig) - } - - return tlsconfig -} - -// ClientDefault returns a secure-enough TLS configuration for the client TLS configuration. -func ClientDefault(ops ...func(*tls.Config)) *tls.Config { - tlsconfig := &tls.Config{ - // Prefer TLS1.2 as the client minimum - MinVersion: tls.VersionTLS12, - CipherSuites: clientCipherSuites, - } - - for _, op := range ops { - op(tlsconfig) - } - - return tlsconfig -} - -// certPool returns an X.509 certificate pool from `caFile`, the certificate file. -func certPool(caFile string, exclusivePool bool) (*x509.CertPool, error) { - // If we should verify the server, we need to load a trusted ca - var ( - certPool *x509.CertPool - err error - ) - if exclusivePool { - certPool = x509.NewCertPool() - } else { - certPool, err = SystemCertPool() - if err != nil { - return nil, fmt.Errorf("failed to read system certificates: %v", err) - } - } - pem, err := ioutil.ReadFile(caFile) - if err != nil { - return nil, fmt.Errorf("could not read CA certificate %q: %v", caFile, err) - } - if !certPool.AppendCertsFromPEM(pem) { - return nil, fmt.Errorf("failed to append certificates from PEM file: %q", caFile) - } - return certPool, nil -} - -// isValidMinVersion checks that the input value is a valid tls minimum version -func isValidMinVersion(version uint16) bool { - _, ok := allTLSVersions[version] - return ok -} - -// adjustMinVersion sets the MinVersion on `config`, the input configuration. -// It assumes the current MinVersion on the `config` is the lowest allowed. -func adjustMinVersion(options Options, config *tls.Config) error { - if options.MinVersion > 0 { - if !isValidMinVersion(options.MinVersion) { - return fmt.Errorf("Invalid minimum TLS version: %x", options.MinVersion) - } - if options.MinVersion < config.MinVersion { - return fmt.Errorf("Requested minimum TLS version is too low. Should be at-least: %x", config.MinVersion) - } - config.MinVersion = options.MinVersion - } - - return nil -} - -// IsErrEncryptedKey returns true if the 'err' is an error of incorrect -// password when tryin to decrypt a TLS private key -func IsErrEncryptedKey(err error) bool { - return errors.Cause(err) == x509.IncorrectPasswordError -} - -// getPrivateKey returns the private key in 'keyBytes', in PEM-encoded format. -// If the private key is encrypted, 'passphrase' is used to decrypted the -// private key. -func getPrivateKey(keyBytes []byte, passphrase string) ([]byte, error) { - // this section makes some small changes to code from notary/tuf/utils/x509.go - pemBlock, _ := pem.Decode(keyBytes) - if pemBlock == nil { - return nil, fmt.Errorf("no valid private key found") - } - - var err error - if x509.IsEncryptedPEMBlock(pemBlock) { - keyBytes, err = x509.DecryptPEMBlock(pemBlock, []byte(passphrase)) - if err != nil { - return nil, errors.Wrap(err, "private key is encrypted, but could not decrypt it") - } - keyBytes = pem.EncodeToMemory(&pem.Block{Type: pemBlock.Type, Bytes: keyBytes}) - } - - return keyBytes, nil -} - -// getCert returns a Certificate from the CertFile and KeyFile in 'options', -// if the key is encrypted, the Passphrase in 'options' will be used to -// decrypt it. -func getCert(options Options) ([]tls.Certificate, error) { - if options.CertFile == "" && options.KeyFile == "" { - return nil, nil - } - - errMessage := "Could not load X509 key pair" - - cert, err := ioutil.ReadFile(options.CertFile) - if err != nil { - return nil, errors.Wrap(err, errMessage) - } - - prKeyBytes, err := ioutil.ReadFile(options.KeyFile) - if err != nil { - return nil, errors.Wrap(err, errMessage) - } - - prKeyBytes, err = getPrivateKey(prKeyBytes, options.Passphrase) - if err != nil { - return nil, errors.Wrap(err, errMessage) - } - - tlsCert, err := tls.X509KeyPair(cert, prKeyBytes) - if err != nil { - return nil, errors.Wrap(err, errMessage) - } - - return []tls.Certificate{tlsCert}, nil -} - -// Client returns a TLS configuration meant to be used by a client. -func Client(options Options) (*tls.Config, error) { - tlsConfig := ClientDefault() - tlsConfig.InsecureSkipVerify = options.InsecureSkipVerify - if !options.InsecureSkipVerify && options.CAFile != "" { - CAs, err := certPool(options.CAFile, options.ExclusiveRootPools) - if err != nil { - return nil, err - } - tlsConfig.RootCAs = CAs - } - - tlsCerts, err := getCert(options) - if err != nil { - return nil, err - } - tlsConfig.Certificates = tlsCerts - - if err := adjustMinVersion(options, tlsConfig); err != nil { - return nil, err - } - - return tlsConfig, nil -} - -// Server returns a TLS configuration meant to be used by a server. -func Server(options Options) (*tls.Config, error) { - tlsConfig := ServerDefault() - tlsConfig.ClientAuth = options.ClientAuth - tlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile) - if err != nil { - if os.IsNotExist(err) { - return nil, fmt.Errorf("Could not load X509 key pair (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) - } - return nil, fmt.Errorf("Error reading X509 key pair (cert: %q, key: %q): %v. Make sure the key is not encrypted.", options.CertFile, options.KeyFile, err) - } - tlsConfig.Certificates = []tls.Certificate{tlsCert} - if options.ClientAuth >= tls.VerifyClientCertIfGiven && options.CAFile != "" { - CAs, err := certPool(options.CAFile, options.ExclusiveRootPools) - if err != nil { - return nil, err - } - tlsConfig.ClientCAs = CAs - } - - if err := adjustMinVersion(options, tlsConfig); err != nil { - return nil, err - } - - return tlsConfig, nil -} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go b/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go deleted file mode 100644 index 6b4c6a7c..00000000 --- a/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build go1.5 - -// Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. -// -package tlsconfig - -import ( - "crypto/tls" -) - -// Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) -var clientCipherSuites = []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, -} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go b/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go deleted file mode 100644 index ee22df47..00000000 --- a/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build !go1.5 - -// Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. -// -package tlsconfig - -import ( - "crypto/tls" -) - -// Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) -var clientCipherSuites = []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, -} diff --git a/vendor/github.com/docker/go-units/CONTRIBUTING.md b/vendor/github.com/docker/go-units/CONTRIBUTING.md deleted file mode 100644 index 9ea86d78..00000000 --- a/vendor/github.com/docker/go-units/CONTRIBUTING.md +++ /dev/null @@ -1,67 +0,0 @@ -# Contributing to go-units - -Want to hack on go-units? Awesome! Here are instructions to get you started. - -go-units is a part of the [Docker](https://www.docker.com) project, and follows -the same rules and principles. If you're already familiar with the way -Docker does things, you'll feel right at home. - -Otherwise, go read Docker's -[contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), -[issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), -[review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and -[branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). - -### Sign your work - -The sign-off is a simple line at the end of the explanation for the patch. Your -signature certifies that you wrote the patch or otherwise have the right to pass -it on as an open-source patch. The rules are pretty simple: if you can certify -the below (from [developercertificate.org](http://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -Then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -Use your real name (sorry, no pseudonyms or anonymous contributions.) - -If you set your `user.name` and `user.email` git configs, you can sign your -commit automatically with `git commit -s`. diff --git a/vendor/github.com/docker/go-units/LICENSE b/vendor/github.com/docker/go-units/LICENSE deleted file mode 100644 index b55b37bc..00000000 --- a/vendor/github.com/docker/go-units/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/go-units/MAINTAINERS b/vendor/github.com/docker/go-units/MAINTAINERS deleted file mode 100644 index 4aac7c74..00000000 --- a/vendor/github.com/docker/go-units/MAINTAINERS +++ /dev/null @@ -1,46 +0,0 @@ -# go-units maintainers file -# -# This file describes who runs the docker/go-units project and how. -# This is a living document - if you see something out of date or missing, speak up! -# -# It is structured to be consumable by both humans and programs. -# To extract its contents programmatically, use any TOML-compliant parser. -# -# This file is compiled into the MAINTAINERS file in docker/opensource. -# -[Org] - [Org."Core maintainers"] - people = [ - "akihirosuda", - "dnephin", - "thajeztah", - "vdemeester", - ] - -[people] - -# A reference list of all people associated with the project. -# All other sections should refer to people by their canonical key -# in the people section. - - # ADD YOURSELF HERE IN ALPHABETICAL ORDER - - [people.akihirosuda] - Name = "Akihiro Suda" - Email = "akihiro.suda.cz@hco.ntt.co.jp" - GitHub = "AkihiroSuda" - - [people.dnephin] - Name = "Daniel Nephin" - Email = "dnephin@gmail.com" - GitHub = "dnephin" - - [people.thajeztah] - Name = "Sebastiaan van Stijn" - Email = "github@gone.nl" - GitHub = "thaJeztah" - - [people.vdemeester] - Name = "Vincent Demeester" - Email = "vincent@sbr.pm" - GitHub = "vdemeester" \ No newline at end of file diff --git a/vendor/github.com/docker/go-units/README.md b/vendor/github.com/docker/go-units/README.md deleted file mode 100644 index 4f70a4e1..00000000 --- a/vendor/github.com/docker/go-units/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) - -# Introduction - -go-units is a library to transform human friendly measurements into machine friendly values. - -## Usage - -See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. - -## Copyright and license - -Copyright © 2015 Docker, Inc. - -go-units is licensed under the Apache License, Version 2.0. -See [LICENSE](LICENSE) for the full text of the license. diff --git a/vendor/github.com/docker/go-units/circle.yml b/vendor/github.com/docker/go-units/circle.yml deleted file mode 100644 index af9d6055..00000000 --- a/vendor/github.com/docker/go-units/circle.yml +++ /dev/null @@ -1,11 +0,0 @@ -dependencies: - post: - # install golint - - go get golang.org/x/lint/golint - -test: - pre: - # run analysis before tests - - go vet ./... - - test -z "$(golint ./... | tee /dev/stderr)" - - test -z "$(gofmt -s -l . | tee /dev/stderr)" diff --git a/vendor/github.com/docker/go-units/duration.go b/vendor/github.com/docker/go-units/duration.go deleted file mode 100644 index 48dd8744..00000000 --- a/vendor/github.com/docker/go-units/duration.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package units provides helper function to parse and print size and time units -// in human-readable format. -package units - -import ( - "fmt" - "time" -) - -// HumanDuration returns a human-readable approximation of a duration -// (eg. "About a minute", "4 hours ago", etc.). -func HumanDuration(d time.Duration) string { - if seconds := int(d.Seconds()); seconds < 1 { - return "Less than a second" - } else if seconds == 1 { - return "1 second" - } else if seconds < 60 { - return fmt.Sprintf("%d seconds", seconds) - } else if minutes := int(d.Minutes()); minutes == 1 { - return "About a minute" - } else if minutes < 60 { - return fmt.Sprintf("%d minutes", minutes) - } else if hours := int(d.Hours() + 0.5); hours == 1 { - return "About an hour" - } else if hours < 48 { - return fmt.Sprintf("%d hours", hours) - } else if hours < 24*7*2 { - return fmt.Sprintf("%d days", hours/24) - } else if hours < 24*30*2 { - return fmt.Sprintf("%d weeks", hours/24/7) - } else if hours < 24*365*2 { - return fmt.Sprintf("%d months", hours/24/30) - } - return fmt.Sprintf("%d years", int(d.Hours())/24/365) -} diff --git a/vendor/github.com/docker/go-units/size.go b/vendor/github.com/docker/go-units/size.go deleted file mode 100644 index 85f6ab07..00000000 --- a/vendor/github.com/docker/go-units/size.go +++ /dev/null @@ -1,108 +0,0 @@ -package units - -import ( - "fmt" - "regexp" - "strconv" - "strings" -) - -// See: http://en.wikipedia.org/wiki/Binary_prefix -const ( - // Decimal - - KB = 1000 - MB = 1000 * KB - GB = 1000 * MB - TB = 1000 * GB - PB = 1000 * TB - - // Binary - - KiB = 1024 - MiB = 1024 * KiB - GiB = 1024 * MiB - TiB = 1024 * GiB - PiB = 1024 * TiB -) - -type unitMap map[string]int64 - -var ( - decimalMap = unitMap{"k": KB, "m": MB, "g": GB, "t": TB, "p": PB} - binaryMap = unitMap{"k": KiB, "m": MiB, "g": GiB, "t": TiB, "p": PiB} - sizeRegex = regexp.MustCompile(`^(\d+(\.\d+)*) ?([kKmMgGtTpP])?[iI]?[bB]?$`) -) - -var decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} -var binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} - -func getSizeAndUnit(size float64, base float64, _map []string) (float64, string) { - i := 0 - unitsLimit := len(_map) - 1 - for size >= base && i < unitsLimit { - size = size / base - i++ - } - return size, _map[i] -} - -// CustomSize returns a human-readable approximation of a size -// using custom format. -func CustomSize(format string, size float64, base float64, _map []string) string { - size, unit := getSizeAndUnit(size, base, _map) - return fmt.Sprintf(format, size, unit) -} - -// HumanSizeWithPrecision allows the size to be in any precision, -// instead of 4 digit precision used in units.HumanSize. -func HumanSizeWithPrecision(size float64, precision int) string { - size, unit := getSizeAndUnit(size, 1000.0, decimapAbbrs) - return fmt.Sprintf("%.*g%s", precision, size, unit) -} - -// HumanSize returns a human-readable approximation of a size -// capped at 4 valid numbers (eg. "2.746 MB", "796 KB"). -func HumanSize(size float64) string { - return HumanSizeWithPrecision(size, 4) -} - -// BytesSize returns a human-readable size in bytes, kibibytes, -// mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB"). -func BytesSize(size float64) string { - return CustomSize("%.4g%s", size, 1024.0, binaryAbbrs) -} - -// FromHumanSize returns an integer from a human-readable specification of a -// size using SI standard (eg. "44kB", "17MB"). -func FromHumanSize(size string) (int64, error) { - return parseSize(size, decimalMap) -} - -// RAMInBytes parses a human-readable string representing an amount of RAM -// in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and -// returns the number of bytes, or -1 if the string is unparseable. -// Units are case-insensitive, and the 'b' suffix is optional. -func RAMInBytes(size string) (int64, error) { - return parseSize(size, binaryMap) -} - -// Parses the human-readable size string into the amount it represents. -func parseSize(sizeStr string, uMap unitMap) (int64, error) { - matches := sizeRegex.FindStringSubmatch(sizeStr) - if len(matches) != 4 { - return -1, fmt.Errorf("invalid size: '%s'", sizeStr) - } - - size, err := strconv.ParseFloat(matches[1], 64) - if err != nil { - return -1, err - } - - unitPrefix := strings.ToLower(matches[3]) - if mul, ok := uMap[unitPrefix]; ok { - size *= float64(mul) - } - - return int64(size), nil -} diff --git a/vendor/github.com/docker/go-units/ulimit.go b/vendor/github.com/docker/go-units/ulimit.go deleted file mode 100644 index fca0400c..00000000 --- a/vendor/github.com/docker/go-units/ulimit.go +++ /dev/null @@ -1,123 +0,0 @@ -package units - -import ( - "fmt" - "strconv" - "strings" -) - -// Ulimit is a human friendly version of Rlimit. -type Ulimit struct { - Name string - Hard int64 - Soft int64 -} - -// Rlimit specifies the resource limits, such as max open files. -type Rlimit struct { - Type int `json:"type,omitempty"` - Hard uint64 `json:"hard,omitempty"` - Soft uint64 `json:"soft,omitempty"` -} - -const ( - // magic numbers for making the syscall - // some of these are defined in the syscall package, but not all. - // Also since Windows client doesn't get access to the syscall package, need to - // define these here - rlimitAs = 9 - rlimitCore = 4 - rlimitCPU = 0 - rlimitData = 2 - rlimitFsize = 1 - rlimitLocks = 10 - rlimitMemlock = 8 - rlimitMsgqueue = 12 - rlimitNice = 13 - rlimitNofile = 7 - rlimitNproc = 6 - rlimitRss = 5 - rlimitRtprio = 14 - rlimitRttime = 15 - rlimitSigpending = 11 - rlimitStack = 3 -) - -var ulimitNameMapping = map[string]int{ - //"as": rlimitAs, // Disabled since this doesn't seem usable with the way Docker inits a container. - "core": rlimitCore, - "cpu": rlimitCPU, - "data": rlimitData, - "fsize": rlimitFsize, - "locks": rlimitLocks, - "memlock": rlimitMemlock, - "msgqueue": rlimitMsgqueue, - "nice": rlimitNice, - "nofile": rlimitNofile, - "nproc": rlimitNproc, - "rss": rlimitRss, - "rtprio": rlimitRtprio, - "rttime": rlimitRttime, - "sigpending": rlimitSigpending, - "stack": rlimitStack, -} - -// ParseUlimit parses and returns a Ulimit from the specified string. -func ParseUlimit(val string) (*Ulimit, error) { - parts := strings.SplitN(val, "=", 2) - if len(parts) != 2 { - return nil, fmt.Errorf("invalid ulimit argument: %s", val) - } - - if _, exists := ulimitNameMapping[parts[0]]; !exists { - return nil, fmt.Errorf("invalid ulimit type: %s", parts[0]) - } - - var ( - soft int64 - hard = &soft // default to soft in case no hard was set - temp int64 - err error - ) - switch limitVals := strings.Split(parts[1], ":"); len(limitVals) { - case 2: - temp, err = strconv.ParseInt(limitVals[1], 10, 64) - if err != nil { - return nil, err - } - hard = &temp - fallthrough - case 1: - soft, err = strconv.ParseInt(limitVals[0], 10, 64) - if err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("too many limit value arguments - %s, can only have up to two, `soft[:hard]`", parts[1]) - } - - if *hard != -1 { - if soft == -1 { - return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: soft: -1 (unlimited), hard: %d", *hard) - } - if soft > *hard { - return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: %d > %d", soft, *hard) - } - } - - return &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil -} - -// GetRlimit returns the RLimit corresponding to Ulimit. -func (u *Ulimit) GetRlimit() (*Rlimit, error) { - t, exists := ulimitNameMapping[u.Name] - if !exists { - return nil, fmt.Errorf("invalid ulimit name %s", u.Name) - } - - return &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil -} - -func (u *Ulimit) String() string { - return fmt.Sprintf("%s=%d:%d", u.Name, u.Soft, u.Hard) -} diff --git a/vendor/github.com/dustin/go-humanize/.travis.yml b/vendor/github.com/dustin/go-humanize/.travis.yml deleted file mode 100644 index ba95cdd1..00000000 --- a/vendor/github.com/dustin/go-humanize/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false -language: go -go: - - 1.3.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/dustin/go-humanize/LICENSE b/vendor/github.com/dustin/go-humanize/LICENSE deleted file mode 100644 index 8d9a94a9..00000000 --- a/vendor/github.com/dustin/go-humanize/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2005-2008 Dustin Sallings - -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. - - diff --git a/vendor/github.com/dustin/go-humanize/README.markdown b/vendor/github.com/dustin/go-humanize/README.markdown deleted file mode 100644 index 91b4ae56..00000000 --- a/vendor/github.com/dustin/go-humanize/README.markdown +++ /dev/null @@ -1,124 +0,0 @@ -# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dustin/go-humanize) [![GoDoc](https://godoc.org/github.com/dustin/go-humanize?status.svg)](https://godoc.org/github.com/dustin/go-humanize) - -Just a few functions for helping humanize times and sizes. - -`go get` it as `github.com/dustin/go-humanize`, import it as -`"github.com/dustin/go-humanize"`, use it as `humanize`. - -See [godoc](https://godoc.org/github.com/dustin/go-humanize) for -complete documentation. - -## Sizes - -This lets you take numbers like `82854982` and convert them to useful -strings like, `83 MB` or `79 MiB` (whichever you prefer). - -Example: - -```go -fmt.Printf("That file is %s.", humanize.Bytes(82854982)) // That file is 83 MB. -``` - -## Times - -This lets you take a `time.Time` and spit it out in relative terms. -For example, `12 seconds ago` or `3 days from now`. - -Example: - -```go -fmt.Printf("This was touched %s.", humanize.Time(someTimeInstance)) // This was touched 7 hours ago. -``` - -Thanks to Kyle Lemons for the time implementation from an IRC -conversation one day. It's pretty neat. - -## Ordinals - -From a [mailing list discussion][odisc] where a user wanted to be able -to label ordinals. - - 0 -> 0th - 1 -> 1st - 2 -> 2nd - 3 -> 3rd - 4 -> 4th - [...] - -Example: - -```go -fmt.Printf("You're my %s best friend.", humanize.Ordinal(193)) // You are my 193rd best friend. -``` - -## Commas - -Want to shove commas into numbers? Be my guest. - - 0 -> 0 - 100 -> 100 - 1000 -> 1,000 - 1000000000 -> 1,000,000,000 - -100000 -> -100,000 - -Example: - -```go -fmt.Printf("You owe $%s.\n", humanize.Comma(6582491)) // You owe $6,582,491. -``` - -## Ftoa - -Nicer float64 formatter that removes trailing zeros. - -```go -fmt.Printf("%f", 2.24) // 2.240000 -fmt.Printf("%s", humanize.Ftoa(2.24)) // 2.24 -fmt.Printf("%f", 2.0) // 2.000000 -fmt.Printf("%s", humanize.Ftoa(2.0)) // 2 -``` - -## SI notation - -Format numbers with [SI notation][sinotation]. - -Example: - -```go -humanize.SI(0.00000000223, "M") // 2.23 nM -``` - -## English-specific functions - -The following functions are in the `humanize/english` subpackage. - -### Plurals - -Simple English pluralization - -```go -english.PluralWord(1, "object", "") // object -english.PluralWord(42, "object", "") // objects -english.PluralWord(2, "bus", "") // buses -english.PluralWord(99, "locus", "loci") // loci - -english.Plural(1, "object", "") // 1 object -english.Plural(42, "object", "") // 42 objects -english.Plural(2, "bus", "") // 2 buses -english.Plural(99, "locus", "loci") // 99 loci -``` - -### Word series - -Format comma-separated words lists with conjuctions: - -```go -english.WordSeries([]string{"foo"}, "and") // foo -english.WordSeries([]string{"foo", "bar"}, "and") // foo and bar -english.WordSeries([]string{"foo", "bar", "baz"}, "and") // foo, bar and baz - -english.OxfordWordSeries([]string{"foo", "bar", "baz"}, "and") // foo, bar, and baz -``` - -[odisc]: https://groups.google.com/d/topic/golang-nuts/l8NhI74jl-4/discussion -[sinotation]: http://en.wikipedia.org/wiki/Metric_prefix diff --git a/vendor/github.com/dustin/go-humanize/big.go b/vendor/github.com/dustin/go-humanize/big.go deleted file mode 100644 index f49dc337..00000000 --- a/vendor/github.com/dustin/go-humanize/big.go +++ /dev/null @@ -1,31 +0,0 @@ -package humanize - -import ( - "math/big" -) - -// order of magnitude (to a max order) -func oomm(n, b *big.Int, maxmag int) (float64, int) { - mag := 0 - m := &big.Int{} - for n.Cmp(b) >= 0 { - n.DivMod(n, b, m) - mag++ - if mag == maxmag && maxmag >= 0 { - break - } - } - return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag -} - -// total order of magnitude -// (same as above, but with no upper limit) -func oom(n, b *big.Int) (float64, int) { - mag := 0 - m := &big.Int{} - for n.Cmp(b) >= 0 { - n.DivMod(n, b, m) - mag++ - } - return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag -} diff --git a/vendor/github.com/dustin/go-humanize/bigbytes.go b/vendor/github.com/dustin/go-humanize/bigbytes.go deleted file mode 100644 index 1a2bf617..00000000 --- a/vendor/github.com/dustin/go-humanize/bigbytes.go +++ /dev/null @@ -1,173 +0,0 @@ -package humanize - -import ( - "fmt" - "math/big" - "strings" - "unicode" -) - -var ( - bigIECExp = big.NewInt(1024) - - // BigByte is one byte in bit.Ints - BigByte = big.NewInt(1) - // BigKiByte is 1,024 bytes in bit.Ints - BigKiByte = (&big.Int{}).Mul(BigByte, bigIECExp) - // BigMiByte is 1,024 k bytes in bit.Ints - BigMiByte = (&big.Int{}).Mul(BigKiByte, bigIECExp) - // BigGiByte is 1,024 m bytes in bit.Ints - BigGiByte = (&big.Int{}).Mul(BigMiByte, bigIECExp) - // BigTiByte is 1,024 g bytes in bit.Ints - BigTiByte = (&big.Int{}).Mul(BigGiByte, bigIECExp) - // BigPiByte is 1,024 t bytes in bit.Ints - BigPiByte = (&big.Int{}).Mul(BigTiByte, bigIECExp) - // BigEiByte is 1,024 p bytes in bit.Ints - BigEiByte = (&big.Int{}).Mul(BigPiByte, bigIECExp) - // BigZiByte is 1,024 e bytes in bit.Ints - BigZiByte = (&big.Int{}).Mul(BigEiByte, bigIECExp) - // BigYiByte is 1,024 z bytes in bit.Ints - BigYiByte = (&big.Int{}).Mul(BigZiByte, bigIECExp) -) - -var ( - bigSIExp = big.NewInt(1000) - - // BigSIByte is one SI byte in big.Ints - BigSIByte = big.NewInt(1) - // BigKByte is 1,000 SI bytes in big.Ints - BigKByte = (&big.Int{}).Mul(BigSIByte, bigSIExp) - // BigMByte is 1,000 SI k bytes in big.Ints - BigMByte = (&big.Int{}).Mul(BigKByte, bigSIExp) - // BigGByte is 1,000 SI m bytes in big.Ints - BigGByte = (&big.Int{}).Mul(BigMByte, bigSIExp) - // BigTByte is 1,000 SI g bytes in big.Ints - BigTByte = (&big.Int{}).Mul(BigGByte, bigSIExp) - // BigPByte is 1,000 SI t bytes in big.Ints - BigPByte = (&big.Int{}).Mul(BigTByte, bigSIExp) - // BigEByte is 1,000 SI p bytes in big.Ints - BigEByte = (&big.Int{}).Mul(BigPByte, bigSIExp) - // BigZByte is 1,000 SI e bytes in big.Ints - BigZByte = (&big.Int{}).Mul(BigEByte, bigSIExp) - // BigYByte is 1,000 SI z bytes in big.Ints - BigYByte = (&big.Int{}).Mul(BigZByte, bigSIExp) -) - -var bigBytesSizeTable = map[string]*big.Int{ - "b": BigByte, - "kib": BigKiByte, - "kb": BigKByte, - "mib": BigMiByte, - "mb": BigMByte, - "gib": BigGiByte, - "gb": BigGByte, - "tib": BigTiByte, - "tb": BigTByte, - "pib": BigPiByte, - "pb": BigPByte, - "eib": BigEiByte, - "eb": BigEByte, - "zib": BigZiByte, - "zb": BigZByte, - "yib": BigYiByte, - "yb": BigYByte, - // Without suffix - "": BigByte, - "ki": BigKiByte, - "k": BigKByte, - "mi": BigMiByte, - "m": BigMByte, - "gi": BigGiByte, - "g": BigGByte, - "ti": BigTiByte, - "t": BigTByte, - "pi": BigPiByte, - "p": BigPByte, - "ei": BigEiByte, - "e": BigEByte, - "z": BigZByte, - "zi": BigZiByte, - "y": BigYByte, - "yi": BigYiByte, -} - -var ten = big.NewInt(10) - -func humanateBigBytes(s, base *big.Int, sizes []string) string { - if s.Cmp(ten) < 0 { - return fmt.Sprintf("%d B", s) - } - c := (&big.Int{}).Set(s) - val, mag := oomm(c, base, len(sizes)-1) - suffix := sizes[mag] - f := "%.0f %s" - if val < 10 { - f = "%.1f %s" - } - - return fmt.Sprintf(f, val, suffix) - -} - -// BigBytes produces a human readable representation of an SI size. -// -// See also: ParseBigBytes. -// -// BigBytes(82854982) -> 83 MB -func BigBytes(s *big.Int) string { - sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} - return humanateBigBytes(s, bigSIExp, sizes) -} - -// BigIBytes produces a human readable representation of an IEC size. -// -// See also: ParseBigBytes. -// -// BigIBytes(82854982) -> 79 MiB -func BigIBytes(s *big.Int) string { - sizes := []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} - return humanateBigBytes(s, bigIECExp, sizes) -} - -// ParseBigBytes parses a string representation of bytes into the number -// of bytes it represents. -// -// See also: BigBytes, BigIBytes. -// -// ParseBigBytes("42 MB") -> 42000000, nil -// ParseBigBytes("42 mib") -> 44040192, nil -func ParseBigBytes(s string) (*big.Int, error) { - lastDigit := 0 - hasComma := false - for _, r := range s { - if !(unicode.IsDigit(r) || r == '.' || r == ',') { - break - } - if r == ',' { - hasComma = true - } - lastDigit++ - } - - num := s[:lastDigit] - if hasComma { - num = strings.Replace(num, ",", "", -1) - } - - val := &big.Rat{} - _, err := fmt.Sscanf(num, "%f", val) - if err != nil { - return nil, err - } - - extra := strings.ToLower(strings.TrimSpace(s[lastDigit:])) - if m, ok := bigBytesSizeTable[extra]; ok { - mv := (&big.Rat{}).SetInt(m) - val.Mul(val, mv) - rv := &big.Int{} - rv.Div(val.Num(), val.Denom()) - return rv, nil - } - - return nil, fmt.Errorf("unhandled size name: %v", extra) -} diff --git a/vendor/github.com/dustin/go-humanize/bytes.go b/vendor/github.com/dustin/go-humanize/bytes.go deleted file mode 100644 index 0b498f48..00000000 --- a/vendor/github.com/dustin/go-humanize/bytes.go +++ /dev/null @@ -1,143 +0,0 @@ -package humanize - -import ( - "fmt" - "math" - "strconv" - "strings" - "unicode" -) - -// IEC Sizes. -// kibis of bits -const ( - Byte = 1 << (iota * 10) - KiByte - MiByte - GiByte - TiByte - PiByte - EiByte -) - -// SI Sizes. -const ( - IByte = 1 - KByte = IByte * 1000 - MByte = KByte * 1000 - GByte = MByte * 1000 - TByte = GByte * 1000 - PByte = TByte * 1000 - EByte = PByte * 1000 -) - -var bytesSizeTable = map[string]uint64{ - "b": Byte, - "kib": KiByte, - "kb": KByte, - "mib": MiByte, - "mb": MByte, - "gib": GiByte, - "gb": GByte, - "tib": TiByte, - "tb": TByte, - "pib": PiByte, - "pb": PByte, - "eib": EiByte, - "eb": EByte, - // Without suffix - "": Byte, - "ki": KiByte, - "k": KByte, - "mi": MiByte, - "m": MByte, - "gi": GiByte, - "g": GByte, - "ti": TiByte, - "t": TByte, - "pi": PiByte, - "p": PByte, - "ei": EiByte, - "e": EByte, -} - -func logn(n, b float64) float64 { - return math.Log(n) / math.Log(b) -} - -func humanateBytes(s uint64, base float64, sizes []string) string { - if s < 10 { - return fmt.Sprintf("%d B", s) - } - e := math.Floor(logn(float64(s), base)) - suffix := sizes[int(e)] - val := math.Floor(float64(s)/math.Pow(base, e)*10+0.5) / 10 - f := "%.0f %s" - if val < 10 { - f = "%.1f %s" - } - - return fmt.Sprintf(f, val, suffix) -} - -// Bytes produces a human readable representation of an SI size. -// -// See also: ParseBytes. -// -// Bytes(82854982) -> 83 MB -func Bytes(s uint64) string { - sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} - return humanateBytes(s, 1000, sizes) -} - -// IBytes produces a human readable representation of an IEC size. -// -// See also: ParseBytes. -// -// IBytes(82854982) -> 79 MiB -func IBytes(s uint64) string { - sizes := []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"} - return humanateBytes(s, 1024, sizes) -} - -// ParseBytes parses a string representation of bytes into the number -// of bytes it represents. -// -// See Also: Bytes, IBytes. -// -// ParseBytes("42 MB") -> 42000000, nil -// ParseBytes("42 mib") -> 44040192, nil -func ParseBytes(s string) (uint64, error) { - lastDigit := 0 - hasComma := false - for _, r := range s { - if !(unicode.IsDigit(r) || r == '.' || r == ',') { - break - } - if r == ',' { - hasComma = true - } - lastDigit++ - } - - num := s[:lastDigit] - if hasComma { - num = strings.Replace(num, ",", "", -1) - } - - f, err := strconv.ParseFloat(num, 64) - if err != nil { - return 0, err - } - - extra := strings.ToLower(strings.TrimSpace(s[lastDigit:])) - if m, ok := bytesSizeTable[extra]; ok { - f *= float64(m) - if f >= math.MaxUint64 { - return 0, fmt.Errorf("too large: %v", s) - } - return uint64(f), nil - } - - return 0, fmt.Errorf("unhandled size name: %v", extra) -} diff --git a/vendor/github.com/dustin/go-humanize/comma.go b/vendor/github.com/dustin/go-humanize/comma.go deleted file mode 100644 index 520ae3e5..00000000 --- a/vendor/github.com/dustin/go-humanize/comma.go +++ /dev/null @@ -1,116 +0,0 @@ -package humanize - -import ( - "bytes" - "math" - "math/big" - "strconv" - "strings" -) - -// Comma produces a string form of the given number in base 10 with -// commas after every three orders of magnitude. -// -// e.g. Comma(834142) -> 834,142 -func Comma(v int64) string { - sign := "" - - // Min int64 can't be negated to a usable value, so it has to be special cased. - if v == math.MinInt64 { - return "-9,223,372,036,854,775,808" - } - - if v < 0 { - sign = "-" - v = 0 - v - } - - parts := []string{"", "", "", "", "", "", ""} - j := len(parts) - 1 - - for v > 999 { - parts[j] = strconv.FormatInt(v%1000, 10) - switch len(parts[j]) { - case 2: - parts[j] = "0" + parts[j] - case 1: - parts[j] = "00" + parts[j] - } - v = v / 1000 - j-- - } - parts[j] = strconv.Itoa(int(v)) - return sign + strings.Join(parts[j:], ",") -} - -// Commaf produces a string form of the given number in base 10 with -// commas after every three orders of magnitude. -// -// e.g. Commaf(834142.32) -> 834,142.32 -func Commaf(v float64) string { - buf := &bytes.Buffer{} - if v < 0 { - buf.Write([]byte{'-'}) - v = 0 - v - } - - comma := []byte{','} - - parts := strings.Split(strconv.FormatFloat(v, 'f', -1, 64), ".") - pos := 0 - if len(parts[0])%3 != 0 { - pos += len(parts[0]) % 3 - buf.WriteString(parts[0][:pos]) - buf.Write(comma) - } - for ; pos < len(parts[0]); pos += 3 { - buf.WriteString(parts[0][pos : pos+3]) - buf.Write(comma) - } - buf.Truncate(buf.Len() - 1) - - if len(parts) > 1 { - buf.Write([]byte{'.'}) - buf.WriteString(parts[1]) - } - return buf.String() -} - -// CommafWithDigits works like the Commaf but limits the resulting -// string to the given number of decimal places. -// -// e.g. CommafWithDigits(834142.32, 1) -> 834,142.3 -func CommafWithDigits(f float64, decimals int) string { - return stripTrailingDigits(Commaf(f), decimals) -} - -// BigComma produces a string form of the given big.Int in base 10 -// with commas after every three orders of magnitude. -func BigComma(b *big.Int) string { - sign := "" - if b.Sign() < 0 { - sign = "-" - b.Abs(b) - } - - athousand := big.NewInt(1000) - c := (&big.Int{}).Set(b) - _, m := oom(c, athousand) - parts := make([]string, m+1) - j := len(parts) - 1 - - mod := &big.Int{} - for b.Cmp(athousand) >= 0 { - b.DivMod(b, athousand, mod) - parts[j] = strconv.FormatInt(mod.Int64(), 10) - switch len(parts[j]) { - case 2: - parts[j] = "0" + parts[j] - case 1: - parts[j] = "00" + parts[j] - } - j-- - } - parts[j] = strconv.Itoa(int(b.Int64())) - return sign + strings.Join(parts[j:], ",") -} diff --git a/vendor/github.com/dustin/go-humanize/commaf.go b/vendor/github.com/dustin/go-humanize/commaf.go deleted file mode 100644 index 620690de..00000000 --- a/vendor/github.com/dustin/go-humanize/commaf.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build go1.6 - -package humanize - -import ( - "bytes" - "math/big" - "strings" -) - -// BigCommaf produces a string form of the given big.Float in base 10 -// with commas after every three orders of magnitude. -func BigCommaf(v *big.Float) string { - buf := &bytes.Buffer{} - if v.Sign() < 0 { - buf.Write([]byte{'-'}) - v.Abs(v) - } - - comma := []byte{','} - - parts := strings.Split(v.Text('f', -1), ".") - pos := 0 - if len(parts[0])%3 != 0 { - pos += len(parts[0]) % 3 - buf.WriteString(parts[0][:pos]) - buf.Write(comma) - } - for ; pos < len(parts[0]); pos += 3 { - buf.WriteString(parts[0][pos : pos+3]) - buf.Write(comma) - } - buf.Truncate(buf.Len() - 1) - - if len(parts) > 1 { - buf.Write([]byte{'.'}) - buf.WriteString(parts[1]) - } - return buf.String() -} diff --git a/vendor/github.com/dustin/go-humanize/ftoa.go b/vendor/github.com/dustin/go-humanize/ftoa.go deleted file mode 100644 index 1c62b640..00000000 --- a/vendor/github.com/dustin/go-humanize/ftoa.go +++ /dev/null @@ -1,46 +0,0 @@ -package humanize - -import ( - "strconv" - "strings" -) - -func stripTrailingZeros(s string) string { - offset := len(s) - 1 - for offset > 0 { - if s[offset] == '.' { - offset-- - break - } - if s[offset] != '0' { - break - } - offset-- - } - return s[:offset+1] -} - -func stripTrailingDigits(s string, digits int) string { - if i := strings.Index(s, "."); i >= 0 { - if digits <= 0 { - return s[:i] - } - i++ - if i+digits >= len(s) { - return s - } - return s[:i+digits] - } - return s -} - -// Ftoa converts a float to a string with no trailing zeros. -func Ftoa(num float64) string { - return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64)) -} - -// FtoaWithDigits converts a float to a string but limits the resulting string -// to the given number of decimal places, and no trailing zeros. -func FtoaWithDigits(num float64, digits int) string { - return stripTrailingZeros(stripTrailingDigits(strconv.FormatFloat(num, 'f', 6, 64), digits)) -} diff --git a/vendor/github.com/dustin/go-humanize/humanize.go b/vendor/github.com/dustin/go-humanize/humanize.go deleted file mode 100644 index a2c2da31..00000000 --- a/vendor/github.com/dustin/go-humanize/humanize.go +++ /dev/null @@ -1,8 +0,0 @@ -/* -Package humanize converts boring ugly numbers to human-friendly strings and back. - -Durations can be turned into strings such as "3 days ago", numbers -representing sizes like 82854982 into useful strings like, "83 MB" or -"79 MiB" (whichever you prefer). -*/ -package humanize diff --git a/vendor/github.com/dustin/go-humanize/number.go b/vendor/github.com/dustin/go-humanize/number.go deleted file mode 100644 index dec61865..00000000 --- a/vendor/github.com/dustin/go-humanize/number.go +++ /dev/null @@ -1,192 +0,0 @@ -package humanize - -/* -Slightly adapted from the source to fit go-humanize. - -Author: https://github.com/gorhill -Source: https://gist.github.com/gorhill/5285193 - -*/ - -import ( - "math" - "strconv" -) - -var ( - renderFloatPrecisionMultipliers = [...]float64{ - 1, - 10, - 100, - 1000, - 10000, - 100000, - 1000000, - 10000000, - 100000000, - 1000000000, - } - - renderFloatPrecisionRounders = [...]float64{ - 0.5, - 0.05, - 0.005, - 0.0005, - 0.00005, - 0.000005, - 0.0000005, - 0.00000005, - 0.000000005, - 0.0000000005, - } -) - -// FormatFloat produces a formatted number as string based on the following user-specified criteria: -// * thousands separator -// * decimal separator -// * decimal precision -// -// Usage: s := RenderFloat(format, n) -// The format parameter tells how to render the number n. -// -// See examples: http://play.golang.org/p/LXc1Ddm1lJ -// -// Examples of format strings, given n = 12345.6789: -// "#,###.##" => "12,345.67" -// "#,###." => "12,345" -// "#,###" => "12345,678" -// "#\u202F###,##" => "12 345,68" -// "#.###,###### => 12.345,678900 -// "" (aka default format) => 12,345.67 -// -// The highest precision allowed is 9 digits after the decimal symbol. -// There is also a version for integer number, FormatInteger(), -// which is convenient for calls within template. -func FormatFloat(format string, n float64) string { - // Special cases: - // NaN = "NaN" - // +Inf = "+Infinity" - // -Inf = "-Infinity" - if math.IsNaN(n) { - return "NaN" - } - if n > math.MaxFloat64 { - return "Infinity" - } - if n < -math.MaxFloat64 { - return "-Infinity" - } - - // default format - precision := 2 - decimalStr := "." - thousandStr := "," - positiveStr := "" - negativeStr := "-" - - if len(format) > 0 { - format := []rune(format) - - // If there is an explicit format directive, - // then default values are these: - precision = 9 - thousandStr = "" - - // collect indices of meaningful formatting directives - formatIndx := []int{} - for i, char := range format { - if char != '#' && char != '0' { - formatIndx = append(formatIndx, i) - } - } - - if len(formatIndx) > 0 { - // Directive at index 0: - // Must be a '+' - // Raise an error if not the case - // index: 0123456789 - // +0.000,000 - // +000,000.0 - // +0000.00 - // +0000 - if formatIndx[0] == 0 { - if format[formatIndx[0]] != '+' { - panic("RenderFloat(): invalid positive sign directive") - } - positiveStr = "+" - formatIndx = formatIndx[1:] - } - - // Two directives: - // First is thousands separator - // Raise an error if not followed by 3-digit - // 0123456789 - // 0.000,000 - // 000,000.00 - if len(formatIndx) == 2 { - if (formatIndx[1] - formatIndx[0]) != 4 { - panic("RenderFloat(): thousands separator directive must be followed by 3 digit-specifiers") - } - thousandStr = string(format[formatIndx[0]]) - formatIndx = formatIndx[1:] - } - - // One directive: - // Directive is decimal separator - // The number of digit-specifier following the separator indicates wanted precision - // 0123456789 - // 0.00 - // 000,0000 - if len(formatIndx) == 1 { - decimalStr = string(format[formatIndx[0]]) - precision = len(format) - formatIndx[0] - 1 - } - } - } - - // generate sign part - var signStr string - if n >= 0.000000001 { - signStr = positiveStr - } else if n <= -0.000000001 { - signStr = negativeStr - n = -n - } else { - signStr = "" - n = 0.0 - } - - // split number into integer and fractional parts - intf, fracf := math.Modf(n + renderFloatPrecisionRounders[precision]) - - // generate integer part string - intStr := strconv.FormatInt(int64(intf), 10) - - // add thousand separator if required - if len(thousandStr) > 0 { - for i := len(intStr); i > 3; { - i -= 3 - intStr = intStr[:i] + thousandStr + intStr[i:] - } - } - - // no fractional part, we can leave now - if precision == 0 { - return signStr + intStr - } - - // generate fractional part - fracStr := strconv.Itoa(int(fracf * renderFloatPrecisionMultipliers[precision])) - // may need padding - if len(fracStr) < precision { - fracStr = "000000000000000"[:precision-len(fracStr)] + fracStr - } - - return signStr + intStr + decimalStr + fracStr -} - -// FormatInteger produces a formatted number as string. -// See FormatFloat. -func FormatInteger(format string, n int) string { - return FormatFloat(format, float64(n)) -} diff --git a/vendor/github.com/dustin/go-humanize/ordinals.go b/vendor/github.com/dustin/go-humanize/ordinals.go deleted file mode 100644 index 43d88a86..00000000 --- a/vendor/github.com/dustin/go-humanize/ordinals.go +++ /dev/null @@ -1,25 +0,0 @@ -package humanize - -import "strconv" - -// Ordinal gives you the input number in a rank/ordinal format. -// -// Ordinal(3) -> 3rd -func Ordinal(x int) string { - suffix := "th" - switch x % 10 { - case 1: - if x%100 != 11 { - suffix = "st" - } - case 2: - if x%100 != 12 { - suffix = "nd" - } - case 3: - if x%100 != 13 { - suffix = "rd" - } - } - return strconv.Itoa(x) + suffix -} diff --git a/vendor/github.com/dustin/go-humanize/si.go b/vendor/github.com/dustin/go-humanize/si.go deleted file mode 100644 index ae659e0e..00000000 --- a/vendor/github.com/dustin/go-humanize/si.go +++ /dev/null @@ -1,123 +0,0 @@ -package humanize - -import ( - "errors" - "math" - "regexp" - "strconv" -) - -var siPrefixTable = map[float64]string{ - -24: "y", // yocto - -21: "z", // zepto - -18: "a", // atto - -15: "f", // femto - -12: "p", // pico - -9: "n", // nano - -6: "µ", // micro - -3: "m", // milli - 0: "", - 3: "k", // kilo - 6: "M", // mega - 9: "G", // giga - 12: "T", // tera - 15: "P", // peta - 18: "E", // exa - 21: "Z", // zetta - 24: "Y", // yotta -} - -var revSIPrefixTable = revfmap(siPrefixTable) - -// revfmap reverses the map and precomputes the power multiplier -func revfmap(in map[float64]string) map[string]float64 { - rv := map[string]float64{} - for k, v := range in { - rv[v] = math.Pow(10, k) - } - return rv -} - -var riParseRegex *regexp.Regexp - -func init() { - ri := `^([\-0-9.]+)\s?([` - for _, v := range siPrefixTable { - ri += v - } - ri += `]?)(.*)` - - riParseRegex = regexp.MustCompile(ri) -} - -// ComputeSI finds the most appropriate SI prefix for the given number -// and returns the prefix along with the value adjusted to be within -// that prefix. -// -// See also: SI, ParseSI. -// -// e.g. ComputeSI(2.2345e-12) -> (2.2345, "p") -func ComputeSI(input float64) (float64, string) { - if input == 0 { - return 0, "" - } - mag := math.Abs(input) - exponent := math.Floor(logn(mag, 10)) - exponent = math.Floor(exponent/3) * 3 - - value := mag / math.Pow(10, exponent) - - // Handle special case where value is exactly 1000.0 - // Should return 1 M instead of 1000 k - if value == 1000.0 { - exponent += 3 - value = mag / math.Pow(10, exponent) - } - - value = math.Copysign(value, input) - - prefix := siPrefixTable[exponent] - return value, prefix -} - -// SI returns a string with default formatting. -// -// SI uses Ftoa to format float value, removing trailing zeros. -// -// See also: ComputeSI, ParseSI. -// -// e.g. SI(1000000, "B") -> 1 MB -// e.g. SI(2.2345e-12, "F") -> 2.2345 pF -func SI(input float64, unit string) string { - value, prefix := ComputeSI(input) - return Ftoa(value) + " " + prefix + unit -} - -// SIWithDigits works like SI but limits the resulting string to the -// given number of decimal places. -// -// e.g. SIWithDigits(1000000, 0, "B") -> 1 MB -// e.g. SIWithDigits(2.2345e-12, 2, "F") -> 2.23 pF -func SIWithDigits(input float64, decimals int, unit string) string { - value, prefix := ComputeSI(input) - return FtoaWithDigits(value, decimals) + " " + prefix + unit -} - -var errInvalid = errors.New("invalid input") - -// ParseSI parses an SI string back into the number and unit. -// -// See also: SI, ComputeSI. -// -// e.g. ParseSI("2.2345 pF") -> (2.2345e-12, "F", nil) -func ParseSI(input string) (float64, string, error) { - found := riParseRegex.FindStringSubmatch(input) - if len(found) != 4 { - return 0, "", errInvalid - } - mag := revSIPrefixTable[found[2]] - unit := found[3] - - base, err := strconv.ParseFloat(found[1], 64) - return base * mag, unit, err -} diff --git a/vendor/github.com/dustin/go-humanize/times.go b/vendor/github.com/dustin/go-humanize/times.go deleted file mode 100644 index dd3fbf5e..00000000 --- a/vendor/github.com/dustin/go-humanize/times.go +++ /dev/null @@ -1,117 +0,0 @@ -package humanize - -import ( - "fmt" - "math" - "sort" - "time" -) - -// Seconds-based time units -const ( - Day = 24 * time.Hour - Week = 7 * Day - Month = 30 * Day - Year = 12 * Month - LongTime = 37 * Year -) - -// Time formats a time into a relative string. -// -// Time(someT) -> "3 weeks ago" -func Time(then time.Time) string { - return RelTime(then, time.Now(), "ago", "from now") -} - -// A RelTimeMagnitude struct contains a relative time point at which -// the relative format of time will switch to a new format string. A -// slice of these in ascending order by their "D" field is passed to -// CustomRelTime to format durations. -// -// The Format field is a string that may contain a "%s" which will be -// replaced with the appropriate signed label (e.g. "ago" or "from -// now") and a "%d" that will be replaced by the quantity. -// -// The DivBy field is the amount of time the time difference must be -// divided by in order to display correctly. -// -// e.g. if D is 2*time.Minute and you want to display "%d minutes %s" -// DivBy should be time.Minute so whatever the duration is will be -// expressed in minutes. -type RelTimeMagnitude struct { - D time.Duration - Format string - DivBy time.Duration -} - -var defaultMagnitudes = []RelTimeMagnitude{ - {time.Second, "now", time.Second}, - {2 * time.Second, "1 second %s", 1}, - {time.Minute, "%d seconds %s", time.Second}, - {2 * time.Minute, "1 minute %s", 1}, - {time.Hour, "%d minutes %s", time.Minute}, - {2 * time.Hour, "1 hour %s", 1}, - {Day, "%d hours %s", time.Hour}, - {2 * Day, "1 day %s", 1}, - {Week, "%d days %s", Day}, - {2 * Week, "1 week %s", 1}, - {Month, "%d weeks %s", Week}, - {2 * Month, "1 month %s", 1}, - {Year, "%d months %s", Month}, - {18 * Month, "1 year %s", 1}, - {2 * Year, "2 years %s", 1}, - {LongTime, "%d years %s", Year}, - {math.MaxInt64, "a long while %s", 1}, -} - -// RelTime formats a time into a relative string. -// -// It takes two times and two labels. In addition to the generic time -// delta string (e.g. 5 minutes), the labels are used applied so that -// the label corresponding to the smaller time is applied. -// -// RelTime(timeInPast, timeInFuture, "earlier", "later") -> "3 weeks earlier" -func RelTime(a, b time.Time, albl, blbl string) string { - return CustomRelTime(a, b, albl, blbl, defaultMagnitudes) -} - -// CustomRelTime formats a time into a relative string. -// -// It takes two times two labels and a table of relative time formats. -// In addition to the generic time delta string (e.g. 5 minutes), the -// labels are used applied so that the label corresponding to the -// smaller time is applied. -func CustomRelTime(a, b time.Time, albl, blbl string, magnitudes []RelTimeMagnitude) string { - lbl := albl - diff := b.Sub(a) - - if a.After(b) { - lbl = blbl - diff = a.Sub(b) - } - - n := sort.Search(len(magnitudes), func(i int) bool { - return magnitudes[i].D > diff - }) - - if n >= len(magnitudes) { - n = len(magnitudes) - 1 - } - mag := magnitudes[n] - args := []interface{}{} - escaped := false - for _, ch := range mag.Format { - if escaped { - switch ch { - case 's': - args = append(args, lbl) - case 'd': - args = append(args, diff/mag.DivBy) - } - escaped = false - } else { - escaped = ch == '%' - } - } - return fmt.Sprintf(mag.Format, args...) -} diff --git a/vendor/github.com/gdamore/encoding/.appveyor.yml b/vendor/github.com/gdamore/encoding/.appveyor.yml deleted file mode 100644 index 19a4c5dd..00000000 --- a/vendor/github.com/gdamore/encoding/.appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 1.0.{build} -clone_folder: c:\gopath\src\github.com\gdamore\encoding -environment: - GOPATH: c:\gopath -build_script: -- go version -- go env -- SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% -- go get -t ./... -- go build -- go install ./... -test_script: -- go test ./... diff --git a/vendor/github.com/gdamore/encoding/.travis.yml b/vendor/github.com/gdamore/encoding/.travis.yml deleted file mode 100644 index 50424138..00000000 --- a/vendor/github.com/gdamore/encoding/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - tip diff --git a/vendor/github.com/gdamore/encoding/LICENSE b/vendor/github.com/gdamore/encoding/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/gdamore/encoding/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/gdamore/encoding/README.md b/vendor/github.com/gdamore/encoding/README.md deleted file mode 100644 index 3db2b4c5..00000000 --- a/vendor/github.com/gdamore/encoding/README.md +++ /dev/null @@ -1,19 +0,0 @@ -## encoding - -[![Linux Status](https://img.shields.io/travis/gdamore/encoding.svg?label=linux)](https://travis-ci.org/gdamore/encoding) -[![Windows Status](https://img.shields.io/appveyor/ci/gdamore/encoding.svg?label=windows)](https://ci.appveyor.com/project/gdamore/encoding) -[![Apache License](https://img.shields.io/badge/license-APACHE2-blue.svg)](https://github.com/gdamore/encoding/blob/master/LICENSE) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/gdamore/encoding) -[![Go Report Card](http://goreportcard.com/badge/gdamore/encoding)](http://goreportcard.com/report/gdamore/encoding) - -Package encoding provides a number of encodings that are missing from the -standard Go [encoding]("https://godoc.org/golang.org/x/text/encoding") package. - -We hope that we can contribute these to the standard Go library someday. It -turns out that some of these are useful for dealing with I/O streams coming -from non-UTF friendly sources. - -The UTF8 Encoder is also useful for situations where valid UTF-8 might be -carried in streams that contain non-valid UTF; in particular I use it for -helping me cope with terminals that embed escape sequences in otherwise -valid UTF-8. diff --git a/vendor/github.com/gdamore/encoding/ascii.go b/vendor/github.com/gdamore/encoding/ascii.go deleted file mode 100644 index b7321f43..00000000 --- a/vendor/github.com/gdamore/encoding/ascii.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ASCII represents the 7-bit US-ASCII scheme. It decodes directly to -// UTF-8 without change, as all ASCII values are legal UTF-8. -// Unicode values less than 128 (i.e. 7 bits) map 1:1 with ASCII. -// It encodes runes outside of that to 0x1A, the ASCII substitution character. -var ASCII encoding.Encoding - -func init() { - amap := make(map[byte]rune) - for i := 128; i <= 255; i++ { - amap[byte(i)] = RuneError - } - - cm := &Charmap{Map: amap} - cm.Init() - ASCII = cm -} diff --git a/vendor/github.com/gdamore/encoding/charmap.go b/vendor/github.com/gdamore/encoding/charmap.go deleted file mode 100644 index db1c33ef..00000000 --- a/vendor/github.com/gdamore/encoding/charmap.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "sync" - "unicode/utf8" - - "golang.org/x/text/encoding" - "golang.org/x/text/transform" -) - -const ( - // RuneError is an alias for the UTF-8 replacement rune, '\uFFFD'. - RuneError = '\uFFFD' - - // RuneSelf is the rune below which UTF-8 and the Unicode values are - // identical. Its also the limit for ASCII. - RuneSelf = 0x80 - - // ASCIISub is the ASCII substitution character. - ASCIISub = '\x1a' -) - -// Charmap is a structure for setting up encodings for 8-bit character sets, -// for transforming between UTF8 and that other character set. It has some -// ideas borrowed from golang.org/x/text/encoding/charmap, but it uses a -// different implementation. This implementation uses maps, and supports -// user-defined maps. -// -// We do assume that a character map has a reasonable substitution character, -// and that valid encodings are stable (exactly a 1:1 map) and stateless -// (that is there is no shift character or anything like that.) Hence this -// approach will not work for many East Asian character sets. -// -// Measurement shows little or no measurable difference in the performance of -// the two approaches. The difference was down to a couple of nsec/op, and -// no consistent pattern as to which ran faster. With the conversion to -// UTF-8 the code takes about 25 nsec/op. The conversion in the reverse -// direction takes about 100 nsec/op. (The larger cost for conversion -// from UTF-8 is most likely due to the need to convert the UTF-8 byte stream -// to a rune before conversion. -// -type Charmap struct { - transform.NopResetter - bytes map[rune]byte - runes [256][]byte - once sync.Once - - // The map between bytes and runes. To indicate that a specific - // byte value is invalid for a charcter set, use the rune - // utf8.RuneError. Values that are absent from this map will - // be assumed to have the identity mapping -- that is the default - // is to assume ISO8859-1, where all 8-bit characters have the same - // numeric value as their Unicode runes. (Not to be confused with - // the UTF-8 values, which *will* be different for non-ASCII runes.) - // - // If no values less than RuneSelf are changed (or have non-identity - // mappings), then the character set is assumed to be an ASCII - // superset, and certain assumptions and optimizations become - // available for ASCII bytes. - Map map[byte]rune - - // The ReplacementChar is the byte value to use for substitution. - // It should normally be ASCIISub for ASCII encodings. This may be - // unset (left to zero) for mappings that are strictly ASCII supersets. - // In that case ASCIISub will be assumed instead. - ReplacementChar byte -} - -type cmapDecoder struct { - transform.NopResetter - runes [256][]byte -} - -type cmapEncoder struct { - transform.NopResetter - bytes map[rune]byte - replace byte -} - -// Init initializes internal values of a character map. This should -// be done early, to minimize the cost of allocation of transforms -// later. It is not strictly necessary however, as the allocation -// functions will arrange to call it if it has not already been done. -func (c *Charmap) Init() { - c.once.Do(c.initialize) -} - -func (c *Charmap) initialize() { - c.bytes = make(map[rune]byte) - ascii := true - - for i := 0; i < 256; i++ { - r, ok := c.Map[byte(i)] - if !ok { - r = rune(i) - } - if r < 128 && r != rune(i) { - ascii = false - } - if r != RuneError { - c.bytes[r] = byte(i) - } - utf := make([]byte, utf8.RuneLen(r)) - utf8.EncodeRune(utf, r) - c.runes[i] = utf - } - if ascii && c.ReplacementChar == '\x00' { - c.ReplacementChar = ASCIISub - } -} - -// NewDecoder returns a Decoder the converts from the 8-bit -// character set to UTF-8. Unknown mappings, if any, are mapped -// to '\uFFFD'. -func (c *Charmap) NewDecoder() *encoding.Decoder { - c.Init() - return &encoding.Decoder{Transformer: &cmapDecoder{runes: c.runes}} -} - -// NewEncoder returns a Transformer that converts from UTF8 to the -// 8-bit character set. Unknown mappings are mapped to 0x1A. -func (c *Charmap) NewEncoder() *encoding.Encoder { - c.Init() - return &encoding.Encoder{ - Transformer: &cmapEncoder{ - bytes: c.bytes, - replace: c.ReplacementChar, - }, - } -} - -func (d *cmapDecoder) Transform(dst, src []byte, atEOF bool) (int, int, error) { - var e error - var ndst, nsrc int - - for _, c := range src { - b := d.runes[c] - l := len(b) - - if ndst+l > len(dst) { - e = transform.ErrShortDst - break - } - for i := 0; i < l; i++ { - dst[ndst] = b[i] - ndst++ - } - nsrc++ - } - return ndst, nsrc, e -} - -func (d *cmapEncoder) Transform(dst, src []byte, atEOF bool) (int, int, error) { - var e error - var ndst, nsrc int - for nsrc < len(src) { - if ndst >= len(dst) { - e = transform.ErrShortDst - break - } - - r, sz := utf8.DecodeRune(src[nsrc:]) - if r == utf8.RuneError && sz == 1 { - // If its inconclusive due to insufficient data in - // in the source, report it - if !atEOF && !utf8.FullRune(src[nsrc:]) { - e = transform.ErrShortSrc - break - } - } - - if c, ok := d.bytes[r]; ok { - dst[ndst] = c - } else { - dst[ndst] = d.replace - } - nsrc += sz - ndst++ - } - - return ndst, nsrc, e -} diff --git a/vendor/github.com/gdamore/encoding/doc.go b/vendor/github.com/gdamore/encoding/doc.go deleted file mode 100644 index 8a7b48d7..00000000 --- a/vendor/github.com/gdamore/encoding/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package encoding provides a few of the encoding structures that are -// missing from the Go x/text/encoding tree. -package encoding diff --git a/vendor/github.com/gdamore/encoding/ebcdic.go b/vendor/github.com/gdamore/encoding/ebcdic.go deleted file mode 100644 index 8e13f1a9..00000000 --- a/vendor/github.com/gdamore/encoding/ebcdic.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// EBCDIC represents the 8-bit EBCDIC scheme, found in some mainframe -// environments. If you don't know what this is, consider yourself lucky. -var EBCDIC encoding.Encoding - -func init() { - cm := &Charmap{ - ReplacementChar: '\x3f', - Map: map[byte]rune{ - // 0x00-0x03 match - 0x04: RuneError, - 0x05: '\t', - 0x06: RuneError, - 0x07: '\x7f', - 0x08: RuneError, - 0x09: RuneError, - 0x0a: RuneError, - // 0x0b-0x13 match - 0x14: RuneError, - 0x15: '\x85', // Not in any ISO code - 0x16: '\x08', - 0x17: RuneError, - // 0x18-0x19 match - 0x1a: RuneError, - 0x1b: RuneError, - // 0x1c-0x1f match - 0x20: RuneError, - 0x21: RuneError, - 0x22: RuneError, - 0x23: RuneError, - 0x24: RuneError, - 0x25: '\n', - 0x26: '\x17', - 0x27: '\x1b', - 0x28: RuneError, - 0x29: RuneError, - 0x2a: RuneError, - 0x2b: RuneError, - 0x2c: RuneError, - 0x2d: '\x05', - 0x2e: '\x06', - 0x2f: '\x07', - 0x30: RuneError, - 0x31: RuneError, - 0x32: '\x16', - 0x33: RuneError, - 0x34: RuneError, - 0x35: RuneError, - 0x36: RuneError, - 0x37: '\x04', - 0x38: RuneError, - 0x39: RuneError, - 0x3a: RuneError, - 0x3b: RuneError, - 0x3c: '\x14', - 0x3d: '\x15', - 0x3e: RuneError, - 0x3f: '\x1a', // also replacement char - 0x40: ' ', - 0x41: '\xa0', - 0x42: RuneError, - 0x43: RuneError, - 0x44: RuneError, - 0x45: RuneError, - 0x46: RuneError, - 0x47: RuneError, - 0x48: RuneError, - 0x49: RuneError, - 0x4a: RuneError, - 0x4b: '.', - 0x4c: '<', - 0x4d: '(', - 0x4e: '+', - 0x4f: '|', - 0x50: '&', - 0x51: RuneError, - 0x52: RuneError, - 0x53: RuneError, - 0x54: RuneError, - 0x55: RuneError, - 0x56: RuneError, - 0x57: RuneError, - 0x58: RuneError, - 0x59: RuneError, - 0x5a: '!', - 0x5b: '$', - 0x5c: '*', - 0x5d: ')', - 0x5e: ';', - 0x5f: '¬', - 0x60: '-', - 0x61: '/', - 0x62: RuneError, - 0x63: RuneError, - 0x64: RuneError, - 0x65: RuneError, - 0x66: RuneError, - 0x67: RuneError, - 0x68: RuneError, - 0x69: RuneError, - 0x6a: '¦', - 0x6b: ',', - 0x6c: '%', - 0x6d: '_', - 0x6e: '>', - 0x6f: '?', - 0x70: RuneError, - 0x71: RuneError, - 0x72: RuneError, - 0x73: RuneError, - 0x74: RuneError, - 0x75: RuneError, - 0x76: RuneError, - 0x77: RuneError, - 0x78: RuneError, - 0x79: '`', - 0x7a: ':', - 0x7b: '#', - 0x7c: '@', - 0x7d: '\'', - 0x7e: '=', - 0x7f: '"', - 0x80: RuneError, - 0x81: 'a', - 0x82: 'b', - 0x83: 'c', - 0x84: 'd', - 0x85: 'e', - 0x86: 'f', - 0x87: 'g', - 0x88: 'h', - 0x89: 'i', - 0x8a: RuneError, - 0x8b: RuneError, - 0x8c: RuneError, - 0x8d: RuneError, - 0x8e: RuneError, - 0x8f: '±', - 0x90: RuneError, - 0x91: 'j', - 0x92: 'k', - 0x93: 'l', - 0x94: 'm', - 0x95: 'n', - 0x96: 'o', - 0x97: 'p', - 0x98: 'q', - 0x99: 'r', - 0x9a: RuneError, - 0x9b: RuneError, - 0x9c: RuneError, - 0x9d: RuneError, - 0x9e: RuneError, - 0x9f: RuneError, - 0xa0: RuneError, - 0xa1: '~', - 0xa2: 's', - 0xa3: 't', - 0xa4: 'u', - 0xa5: 'v', - 0xa6: 'w', - 0xa7: 'x', - 0xa8: 'y', - 0xa9: 'z', - 0xaa: RuneError, - 0xab: RuneError, - 0xac: RuneError, - 0xad: RuneError, - 0xae: RuneError, - 0xaf: RuneError, - 0xb0: '^', - 0xb1: RuneError, - 0xb2: RuneError, - 0xb3: RuneError, - 0xb4: RuneError, - 0xb5: RuneError, - 0xb6: RuneError, - 0xb7: RuneError, - 0xb8: RuneError, - 0xb9: RuneError, - 0xba: '[', - 0xbb: ']', - 0xbc: RuneError, - 0xbd: RuneError, - 0xbe: RuneError, - 0xbf: RuneError, - 0xc0: '{', - 0xc1: 'A', - 0xc2: 'B', - 0xc3: 'C', - 0xc4: 'D', - 0xc5: 'E', - 0xc6: 'F', - 0xc7: 'G', - 0xc8: 'H', - 0xc9: 'I', - 0xca: '\xad', // NB: soft hyphen - 0xcb: RuneError, - 0xcc: RuneError, - 0xcd: RuneError, - 0xce: RuneError, - 0xcf: RuneError, - 0xd0: '}', - 0xd1: 'J', - 0xd2: 'K', - 0xd3: 'L', - 0xd4: 'M', - 0xd5: 'N', - 0xd6: 'O', - 0xd7: 'P', - 0xd8: 'Q', - 0xd9: 'R', - 0xda: RuneError, - 0xdb: RuneError, - 0xdc: RuneError, - 0xdd: RuneError, - 0xde: RuneError, - 0xdf: RuneError, - 0xe0: '\\', - 0xe1: '\u2007', // Non-breaking space - 0xe2: 'S', - 0xe3: 'T', - 0xe4: 'U', - 0xe5: 'V', - 0xe6: 'W', - 0xe7: 'X', - 0xe8: 'Y', - 0xe9: 'Z', - 0xea: RuneError, - 0xeb: RuneError, - 0xec: RuneError, - 0xed: RuneError, - 0xee: RuneError, - 0xef: RuneError, - 0xf0: '0', - 0xf1: '1', - 0xf2: '2', - 0xf3: '3', - 0xf4: '4', - 0xf5: '5', - 0xf6: '6', - 0xf7: '7', - 0xf8: '8', - 0xf9: '9', - 0xfa: RuneError, - 0xfb: RuneError, - 0xfc: RuneError, - 0xfd: RuneError, - 0xfe: RuneError, - 0xff: RuneError, - }} - cm.Init() - EBCDIC = cm -} diff --git a/vendor/github.com/gdamore/encoding/go.mod b/vendor/github.com/gdamore/encoding/go.mod deleted file mode 100644 index e91b30d5..00000000 --- a/vendor/github.com/gdamore/encoding/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/gdamore/encoding - -go 1.9 - -require golang.org/x/text v0.3.0 diff --git a/vendor/github.com/gdamore/encoding/go.sum b/vendor/github.com/gdamore/encoding/go.sum deleted file mode 100644 index 6bad37b2..00000000 --- a/vendor/github.com/gdamore/encoding/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/vendor/github.com/gdamore/encoding/latin1.go b/vendor/github.com/gdamore/encoding/latin1.go deleted file mode 100644 index 226bf01d..00000000 --- a/vendor/github.com/gdamore/encoding/latin1.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ISO8859_1 represents the 8-bit ISO8859-1 scheme. It decodes directly to -// UTF-8 without change, as all ISO8859-1 values are legal UTF-8. -// Unicode values less than 256 (i.e. 8 bits) map 1:1 with 8859-1. -// It encodes runes outside of that to 0x1A, the ASCII substitution character. -var ISO8859_1 encoding.Encoding - -func init() { - cm := &Charmap{} - cm.Init() - - // 8859-1 is the 8-bit identity map for Unicode. - ISO8859_1 = cm -} diff --git a/vendor/github.com/gdamore/encoding/latin5.go b/vendor/github.com/gdamore/encoding/latin5.go deleted file mode 100644 index c75ecf27..00000000 --- a/vendor/github.com/gdamore/encoding/latin5.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -// ISO8859_9 represents the 8-bit ISO8859-9 scheme. -var ISO8859_9 encoding.Encoding - -func init() { - cm := &Charmap{Map: map[byte]rune{ - 0xD0: 'Ğ', - 0xDD: 'İ', - 0xDE: 'Ş', - 0xF0: 'ğ', - 0xFD: 'ı', - 0xFE: 'ş', - }} - cm.Init() - ISO8859_9 = cm -} diff --git a/vendor/github.com/gdamore/encoding/utf8.go b/vendor/github.com/gdamore/encoding/utf8.go deleted file mode 100644 index 2d59f4b3..00000000 --- a/vendor/github.com/gdamore/encoding/utf8.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 Garrett D'Amore -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package encoding - -import ( - "golang.org/x/text/encoding" -) - -type validUtf8 struct{} - -// UTF8 is an encoding for UTF-8. All it does is verify that the UTF-8 -// in is valid. The main reason for its existence is that it will detect -// and report ErrSrcShort or ErrDstShort, whereas the Nop encoding just -// passes every byte, blithely. -var UTF8 encoding.Encoding = validUtf8{} - -func (validUtf8) NewDecoder() *encoding.Decoder { - return &encoding.Decoder{Transformer: encoding.UTF8Validator} -} - -func (validUtf8) NewEncoder() *encoding.Encoder { - return &encoding.Encoder{Transformer: encoding.UTF8Validator} -} diff --git a/vendor/github.com/gdamore/tcell/.appveyor.yml b/vendor/github.com/gdamore/tcell/.appveyor.yml deleted file mode 100644 index 435dfe3a..00000000 --- a/vendor/github.com/gdamore/tcell/.appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 1.0.{build} -clone_folder: c:\gopath\src\github.com\gdamore\tcell -environment: - GOPATH: c:\gopath -build_script: -- go version -- go env -- SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% -- go get -t ./... -- go build -- go install ./... -test_script: -- go test ./... diff --git a/vendor/github.com/gdamore/tcell/.gitignore b/vendor/github.com/gdamore/tcell/.gitignore deleted file mode 100644 index c57100a5..00000000 --- a/vendor/github.com/gdamore/tcell/.gitignore +++ /dev/null @@ -1 +0,0 @@ -coverage.txt diff --git a/vendor/github.com/gdamore/tcell/.travis.yml b/vendor/github.com/gdamore/tcell/.travis.yml deleted file mode 100644 index fec3f669..00000000 --- a/vendor/github.com/gdamore/tcell/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.10.x - - 1.11.x - - master - -before_install: - - go get -t -v ./... - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/gdamore/tcell/AUTHORS b/vendor/github.com/gdamore/tcell/AUTHORS deleted file mode 100644 index 53f87ee6..00000000 --- a/vendor/github.com/gdamore/tcell/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Garrett D'Amore -Zachary Yedidia -Junegunn Choi -Staysail Systems, Inc. diff --git a/vendor/github.com/gdamore/tcell/LICENSE b/vendor/github.com/gdamore/tcell/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/gdamore/tcell/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/gdamore/tcell/README.adoc b/vendor/github.com/gdamore/tcell/README.adoc deleted file mode 100644 index bfea1e79..00000000 --- a/vendor/github.com/gdamore/tcell/README.adoc +++ /dev/null @@ -1,272 +0,0 @@ -= tcell - - -image:https://img.shields.io/travis/gdamore/tcell.svg?label=linux[Linux Status,link="https://travis-ci.org/gdamore/tcell"] -image:https://img.shields.io/appveyor/ci/gdamore/tcell.svg?label=windows[Windows Status,link="https://ci.appveyor.com/project/gdamore/tcell"] -image:https://img.shields.io/badge/license-APACHE2-blue.svg[Apache License,link="https://github.com/gdamore/tcell/blob/master/LICENSE"] -image:https://img.shields.io/badge/gitter-join-brightgreen.svg[Gitter,link="https://gitter.im/gdamore/tcell"] -image:https://img.shields.io/badge/godoc-reference-blue.svg[GoDoc,link="https://godoc.org/github.com/gdamore/tcell"] -image:http://goreportcard.com/badge/gdamore/tcell[Go Report Card,link="http://goreportcard.com/report/gdamore/tcell"] -image:https://codecov.io/gh/gdamore/tcell/branch/master/graph/badge.svg[codecov,link="https://codecov.io/gh/gdamore/tcell"] -image:https://tidelift.com/badges/github/gdamore/tcell?style=flat[Dependencies] - -[cols="2",grid="none"] -|=== -|_Tcell_ is a _Go_ package that provides a cell based view for text terminals, like _xterm_. -It was inspired by _termbox_, but includes many additional improvements. -a|[.right] -image::logos/tcell.png[float="right"] -|=== - -## Examples - -* https://github.com/gdamore/proxima5[proxima5] - space shooter (https://youtu.be/jNxKTCmY_bQ[video]) -* https://github.com/gdamore/govisor[govisor] - service management UI (http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png[screenshot]) -* mouse demo - included mouse test (http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png[screenshot]) -* https://github.com/gdamore/gomatrix[gomatrix] - converted from Termbox -* https://github.com/zyedidia/micro/[micro] - lightweight text editor with syntax-highlighting and themes -* https://github.com/viktomas/godu[godu] - simple golang utility helping to discover large files/folders. -* https://github.com/rivo/tview[tview] - rich interactive widgets for terminal UIs -* https://github.com/marcusolsson/tui-go[tui-go] - UI library for terminal apps -* https://github.com/rgm3/gomandelbrot[gomandelbrot] - Mandelbrot! -* https://github.com/senorprogrammer/wtf[WTF]- Personal information dashboard for your terminal -* https://github.com/browsh-org/browsh[browsh] - A fully-modern text-based browser, rendering to TTY and browsers (https://www.youtube.com/watch?v=HZq86XfBoRo[video]) -* https://github.com/sachaos/go-life[go-life] - Conway's Game of Life. -* https://github.com/gcla/gowid[gowid] - compositional widgets for terminal UIs, inspired by urwid -* https://termshark.io[termshark] - a terminal UI for tshark, inspired by Wireshark, built on gowid - -## Pure Go Terminfo Database - -_Tcell_ includes a full parser and expander for terminfo capability strings, -so that it can avoid hard coding escape strings for formatting. It also favors -portability, and includes support for all POSIX systems. - -The database is also flexible & extensible, and can modified by either running -a program to build the entire database, or an entry for just a single terminal. - -## More Portable - -_Tcell_ is portable to a wide variety of systems. -_Tcell_ is believed -to work with all of the systems officially supported by golang with -the exception of nacl (which lacks any kind of a terminal interface). -(Plan9 is not supported by _Tcell_, but it is experimental status only -in golang.) For all of these systems *except Solaris/illumos*, _Tcell_ -is pure Go, with no need for CGO. - -## No Async IO - -_Tcell_ is able to operate without requiring `SIGIO` signals (unlike _termbox_), -or asynchronous I/O, and can instead use standard Go file -objects and Go routines. -This means it should be safe, especially for -use with programs that use exec, or otherwise need to manipulate the -tty streams. -This model is also much closer to idiomatic Go, leading -to fewer surprises. - -## Rich Unicode & non-Unicode support - -_Tcell_ includes enhanced support for Unicode, including wide characters and -combining characters, provided your terminal can support them. -Note that -Windows terminals generally don't support the full Unicode repertoire. - -It will also convert to and from Unicode locales, so that the program -can work with UTF-8 internally, and get reasonable output in other locales. -_Tcell_ tries hard to convert to native characters on both input and output, and -on output _Tcell_ even makes use of the alternate character set to facilitate -drawing certain characters. - -## More Function Keys - -_Tcell_ also has richer support for a larger number of special keys that some terminals can send. - -## Better Color Handling - -_Tcell_ will respect your terminal's color space as specified within your terminfo -entries, so that for example attempts to emit color sequences on VT100 terminals -won't result in unintended consequences. - -In Windows mode, _Tcell_ supports 16 colors, bold, dim, and reverse, -instead of just termbox's 8 colors with reverse. (Note that there is some -conflation with bold/dim and colors.) - -_Tcell_ maps 16 colors down to 8, for terminals that need it. -(The upper 8 colors are just brighter versions of the lower 8.) - -## Better Mouse Support - -_Tcell_ supports enhanced mouse tracking mode, so your application can receive -regular mouse motion events, and wheel events, if your terminal supports it. - -## _Termbox_ Compatibility - -A compatibility layer for _termbox_ is provided in the `compat` directory. -To use it, try importing `github.com/gdamore/tcell/termbox` -instead. Most _termbox-go_ programs will probably work without further -modification. - -## Working With Unicode - -Internally Tcell uses UTF-8, just like Go. -However, Tcell understands how to -convert to and from other character sets, using the capabilities of -the `golang.org/x/text/encoding packages`. -Your application must supply -them, as the full set of the most common ones bloats the program by about 2MB. -If you're lazy, and want them all anyway, see the `encoding` sub-directory. - -## Wide & Combining Characters - -The `SetContent()` API takes a primary rune, and an optional list of combining runes. -If any of the runes is a wide (East Asian) rune occupying two cells, -then the library will skip output from the following cell, but care must be -taken in the application to avoid explicitly attempting to set content in the -next cell, otherwise the results are undefined. (Normally wide character -is displayed, and the other character is not; do not depend on that behavior.) - -Experience has shown that the vanilla Windows 8 console application does not -support any of these characters properly, but at least some options like -_ConEmu_ do support Wide characters. - -## Colors - -_Tcell_ assumes the ANSI/XTerm color model, including the 256 color map that -XTerm uses when it supports 256 colors. The terminfo guidance will be -honored, with respect to the number of colors supported. Also, only -terminals which expose ANSI style `setaf` and `setab` will support color; -if you have a color terminal that only has `setf` and `setb`, please let me -know; it wouldn't be hard to add that if there is need. - -## 24-bit Color - -_Tcell_ _supports true color_! (That is, if your terminal can support it, -_Tcell_ can accurately display 24-bit color.) - -To use 24-bit color, you need to use a terminal that supports it. Modern -xterm and similar teminal emulators can support this. As terminfo lacks any -way to describe this capability, we fabricate the capability for -terminals with names ending in `*-truecolor`. The stock distribution ships -with a database that defines `xterm-truecolor`. -To try it out, set your -`TERM` variable to `xterm-truecolor`. - -When using TrueColor, programs will display the colors that the programmer -intended, overriding any "`themes`" you may have set in your terminal -emulator. (For some cases, accurate color fidelity is more important -than respecting themes. For other cases, such as typical text apps that -only use a few colors, its more desirable to respect the themes that -the user has established.) - -If you find this undesirable, you can either use a `TERM` variable -that lacks the `TRUECOLOR` setting, or set `TCELL_TRUECOLOR=disable` in your -environment. - -## Performance - -Reasonable attempts have been made to minimize sending data to terminals, -avoiding repeated sequences or drawing the same cell on refresh updates. - -## Terminfo - -(Not relevent for Windows users.) - -The Terminfo implementation operates with two forms of database. The first -is the built-in go database, which contains a number of real database entries -that are compiled into the program directly. This should minimize calling -out to database file searches. - -The second is in the form of JSON files, that contain the same information, -which can be located either by the `$TCELLDB` environment file, `$HOME/.tcelldb`, -or is located in the Go source directory as `database.json`. - -These files (both the Go and the JSON files) can be generated using the -mkinfo.go program. If you need to regnerate the entire set for some reason, -run the mkdatabase.sh file. The generation uses the infocmp(1) program on -the system to collect the necessary information. - -The `mkinfo.go` program can also be used to generate specific database entries -for named terminals, in case your favorite terminal is missing. (If you -find that this is the case, please let me know and I'll try to add it!) - -_Tcell_ requires that the terminal support the `cup` mode of cursor addressing. -Terminals without absolute cursor addressability are not supported. -This is unlikely to be a problem; such terminals have not been mass produced -since the early 1970s. - -## Mouse Support - -Mouse support is detected via the `kmous` terminfo variable, however, -enablement/disablement and decoding mouse events is done using hard coded -sequences based on the XTerm X11 model. As of this writing all popular -terminals with mouse tracking support this model. (Full terminfo support -is not possible as terminfo sequences are not defined.) - -On Windows, the mouse works normally. - -Mouse wheel buttons on various terminals are known to work, but the support -in terminal emulators, as well as support for various buttons and -live mouse tracking, varies widely. Modern _xterm_, macOS _Terminal_, and _iTerm_ all work well. - -## Testablity - -There is a `SimulationScreen`, that can be used to simulate a real screen -for automated testing. The supplied tests do this. The simulation contains -event delivery, screen resizing support, and capabilities to inject events -and examine "`physical`" screen contents. - -## Platforms - -### POSIX (Linux, FreeBSD, macOS, Solaris, etc.) - -For mainstream systems with a suitably well defined system call interface -to tty settings, everything works using pure Go. - -For the remainder (right now means only Solaris/illumos) we use POSIX function -calls to manage termios, which implies that CGO is required on those platforms. - -### Windows - -Windows console mode applications are supported. Unfortunately _mintty_ -and other _cygwin_ style applications are not supported. - -Modern console applications like ConEmu, as well as the Windows 10 -console itself, support all the good features (resize, mouse tracking, etc.) - -I haven't figured out how to cleanly resolve the dichotomy between cygwin -style termios and the Windows Console API; it seems that perhaps nobody else -has either. If anyone has suggestions, let me know! Really, if you're -using a Windows application, you should use the native Windows console or a -fully compatible console implementation. - -### Plan9 and Native Client (Nacl) - -The nacl and plan9 platforms won't work, but compilation stubs are supplied -for folks that want to include parts of this in software targetting those -platforms. The Simulation screen works, but as Tcell doesn't know how to -allocate a real screen object on those platforms, `NewScreen()` will fail. - -If anyone has wisdom about how to improve support for either of these, -please let me know. PRs are especially welcome. - -### Commercial Support - -_Tcell_ is absolutely free, but if you want to obtain commercial, professional support, there are options. - -[cols="2",align="center",frame="none", grid="none"] -|=== -^.^| -image:logos/tidelift.png[100,100] -a| -https://tidelift.com/[Tidelift] subscriptions include support for _Tcell_, as well as many other open source packages. - -^.^| -image:logos/staysail.png[100,100] -a| -mailto:info@staysail.tech[Staysail Systems, Inc.] offers direct support, and custom development around _Tcell_ on an hourly basis. - -^.^| -image:logos/patreon.png[100,100] -a|I also welcome donations at https://www.patreon.com/gedamore/[Patreon], if you just want to make a contribution. -|=== diff --git a/vendor/github.com/gdamore/tcell/attr.go b/vendor/github.com/gdamore/tcell/attr.go deleted file mode 100644 index 866c0ebd..00000000 --- a/vendor/github.com/gdamore/tcell/attr.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// AttrMask represents a mask of text attributes, apart from color. -// Note that support for attributes may vary widely across terminals. -type AttrMask int - -// Attributes are not colors, but affect the display of text. They can -// be combined. -const ( - AttrBold AttrMask = 1 << (25 + iota) - AttrBlink - AttrReverse - AttrUnderline - AttrDim - AttrNone AttrMask = 0 // Just normal text. -) - -const attrAll = AttrBold | AttrBlink | AttrReverse | AttrUnderline | AttrDim diff --git a/vendor/github.com/gdamore/tcell/cell.go b/vendor/github.com/gdamore/tcell/cell.go deleted file mode 100644 index c7f8f1ad..00000000 --- a/vendor/github.com/gdamore/tcell/cell.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - runewidth "github.com/mattn/go-runewidth" -) - -type cell struct { - currMain rune - currComb []rune - currStyle Style - lastMain rune - lastStyle Style - lastComb []rune - width int -} - -// CellBuffer represents a two dimensional array of character cells. -// This is primarily intended for use by Screen implementors; it -// contains much of the common code they need. To create one, just -// declare a variable of its type; no explicit initialization is necessary. -// -// CellBuffer is not thread safe. -type CellBuffer struct { - w int - h int - cells []cell -} - -// SetContent sets the contents (primary rune, combining runes, -// and style) for a cell at a given location. -func (cb *CellBuffer) SetContent(x int, y int, - mainc rune, combc []rune, style Style) { - - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - - c.currComb = append([]rune{}, combc...) - - if c.currMain != mainc { - c.width = runewidth.RuneWidth(mainc) - } - c.currMain = mainc - c.currStyle = style - } -} - -// GetContent returns the contents of a character cell, including the -// primary rune, any combining character runes (which will usually be -// nil), the style, and the display width in cells. (The width can be -// either 1, normally, or 2 for East Asian full-width characters.) -func (cb *CellBuffer) GetContent(x, y int) (rune, []rune, Style, int) { - var mainc rune - var combc []rune - var style Style - var width int - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - mainc, combc, style = c.currMain, c.currComb, c.currStyle - if width = c.width; width == 0 || mainc < ' ' { - width = 1 - mainc = ' ' - } - } - return mainc, combc, style, width -} - -// Size returns the (width, height) in cells of the buffer. -func (cb *CellBuffer) Size() (int, int) { - return cb.w, cb.h -} - -// Invalidate marks all characters within the buffer as dirty. -func (cb *CellBuffer) Invalidate() { - for i := range cb.cells { - cb.cells[i].lastMain = rune(0) - } -} - -// Dirty checks if a character at the given location needs an -// to be refreshed on the physical display. This returns true -// if the cell content is different since the last time it was -// marked clean. -func (cb *CellBuffer) Dirty(x, y int) bool { - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - if c.lastMain == rune(0) { - return true - } - if c.lastMain != c.currMain { - return true - } - if c.lastStyle != c.currStyle { - return true - } - if len(c.lastComb) != len(c.currComb) { - return true - } - for i := range c.lastComb { - if c.lastComb[i] != c.currComb[i] { - return true - } - } - } - return false -} - -// SetDirty is normally used to indicate that a cell has -// been displayed (in which case dirty is false), or to manually -// force a cell to be marked dirty. -func (cb *CellBuffer) SetDirty(x, y int, dirty bool) { - if x >= 0 && y >= 0 && x < cb.w && y < cb.h { - c := &cb.cells[(y*cb.w)+x] - if dirty { - c.lastMain = rune(0) - } else { - if c.currMain == rune(0) { - c.currMain = ' ' - } - c.lastMain = c.currMain - c.lastComb = c.currComb - c.lastStyle = c.currStyle - } - } -} - -// Resize is used to resize the cells array, with different dimensions, -// while preserving the original contents. The cells will be invalidated -// so that they can be redrawn. -func (cb *CellBuffer) Resize(w, h int) { - - if cb.h == h && cb.w == w { - return - } - - newc := make([]cell, w*h) - for y := 0; y < h && y < cb.h; y++ { - for x := 0; x < w && x < cb.w; x++ { - oc := &cb.cells[(y*cb.w)+x] - nc := &newc[(y*w)+x] - nc.currMain = oc.currMain - nc.currComb = oc.currComb - nc.currStyle = oc.currStyle - nc.width = oc.width - nc.lastMain = rune(0) - } - } - cb.cells = newc - cb.h = h - cb.w = w -} - -// Fill fills the entire cell buffer array with the specified character -// and style. Normally choose ' ' to clear the screen. This API doesn't -// support combining characters, or characters with a width larger than one. -func (cb *CellBuffer) Fill(r rune, style Style) { - for i := range cb.cells { - c := &cb.cells[i] - c.currMain = r - c.currComb = nil - c.currStyle = style - c.width = 1 - } -} diff --git a/vendor/github.com/gdamore/tcell/charset_stub.go b/vendor/github.com/gdamore/tcell/charset_stub.go deleted file mode 100644 index c1c1594c..00000000 --- a/vendor/github.com/gdamore/tcell/charset_stub.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build plan9 nacl - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -func getCharset() string { - return "" -} diff --git a/vendor/github.com/gdamore/tcell/charset_unix.go b/vendor/github.com/gdamore/tcell/charset_unix.go deleted file mode 100644 index d9f9d8e1..00000000 --- a/vendor/github.com/gdamore/tcell/charset_unix.go +++ /dev/null @@ -1,49 +0,0 @@ -// +build !windows,!nacl,!plan9 - -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "strings" -) - -func getCharset() string { - // Determine the character set. This can help us later. - // Per POSIX, we search for LC_ALL first, then LC_CTYPE, and - // finally LANG. First one set wins. - locale := "" - if locale = os.Getenv("LC_ALL"); locale == "" { - if locale = os.Getenv("LC_CTYPE"); locale == "" { - locale = os.Getenv("LANG") - } - } - if locale == "POSIX" || locale == "C" { - return "US-ASCII" - } - if i := strings.IndexRune(locale, '@'); i >= 0 { - locale = locale[:i] - } - if i := strings.IndexRune(locale, '.'); i >= 0 { - locale = locale[i+1:] - } else { - // Default assumption, and on Linux we can see LC_ALL - // without a character set, which we assume implies UTF-8. - return "UTF-8" - } - // XXX: add support for aliases - return locale -} diff --git a/vendor/github.com/gdamore/tcell/charset_windows.go b/vendor/github.com/gdamore/tcell/charset_windows.go deleted file mode 100644 index 2400aa8a..00000000 --- a/vendor/github.com/gdamore/tcell/charset_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -func getCharset() string { - return "UTF-16" -} diff --git a/vendor/github.com/gdamore/tcell/color.go b/vendor/github.com/gdamore/tcell/color.go deleted file mode 100644 index 2e096c70..00000000 --- a/vendor/github.com/gdamore/tcell/color.go +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import "strconv" - -// Color represents a color. The low numeric values are the same as used -// by ECMA-48, and beyond that XTerm. A 24-bit RGB value may be used by -// adding in the ColorIsRGB flag. For Color names we use the W3C approved -// color names. -// -// Note that on various terminals colors may be approximated however, or -// not supported at all. If no suitable representation for a color is known, -// the library will simply not set any color, deferring to whatever default -// attributes the terminal uses. -type Color int32 - -const ( - // ColorDefault is used to leave the Color unchanged from whatever - // system or teminal default may exist. - ColorDefault Color = -1 - - // ColorIsRGB is used to indicate that the numeric value is not - // a known color constant, but rather an RGB value. The lower - // order 3 bytes are RGB. - ColorIsRGB Color = 1 << 24 -) - -// Note that the order of these options is important -- it follows the -// definitions used by ECMA and XTerm. Hence any further named colors -// must begin at a value not less than 256. -const ( - ColorBlack Color = iota - ColorMaroon - ColorGreen - ColorOlive - ColorNavy - ColorPurple - ColorTeal - ColorSilver - ColorGray - ColorRed - ColorLime - ColorYellow - ColorBlue - ColorFuchsia - ColorAqua - ColorWhite - Color16 - Color17 - Color18 - Color19 - Color20 - Color21 - Color22 - Color23 - Color24 - Color25 - Color26 - Color27 - Color28 - Color29 - Color30 - Color31 - Color32 - Color33 - Color34 - Color35 - Color36 - Color37 - Color38 - Color39 - Color40 - Color41 - Color42 - Color43 - Color44 - Color45 - Color46 - Color47 - Color48 - Color49 - Color50 - Color51 - Color52 - Color53 - Color54 - Color55 - Color56 - Color57 - Color58 - Color59 - Color60 - Color61 - Color62 - Color63 - Color64 - Color65 - Color66 - Color67 - Color68 - Color69 - Color70 - Color71 - Color72 - Color73 - Color74 - Color75 - Color76 - Color77 - Color78 - Color79 - Color80 - Color81 - Color82 - Color83 - Color84 - Color85 - Color86 - Color87 - Color88 - Color89 - Color90 - Color91 - Color92 - Color93 - Color94 - Color95 - Color96 - Color97 - Color98 - Color99 - Color100 - Color101 - Color102 - Color103 - Color104 - Color105 - Color106 - Color107 - Color108 - Color109 - Color110 - Color111 - Color112 - Color113 - Color114 - Color115 - Color116 - Color117 - Color118 - Color119 - Color120 - Color121 - Color122 - Color123 - Color124 - Color125 - Color126 - Color127 - Color128 - Color129 - Color130 - Color131 - Color132 - Color133 - Color134 - Color135 - Color136 - Color137 - Color138 - Color139 - Color140 - Color141 - Color142 - Color143 - Color144 - Color145 - Color146 - Color147 - Color148 - Color149 - Color150 - Color151 - Color152 - Color153 - Color154 - Color155 - Color156 - Color157 - Color158 - Color159 - Color160 - Color161 - Color162 - Color163 - Color164 - Color165 - Color166 - Color167 - Color168 - Color169 - Color170 - Color171 - Color172 - Color173 - Color174 - Color175 - Color176 - Color177 - Color178 - Color179 - Color180 - Color181 - Color182 - Color183 - Color184 - Color185 - Color186 - Color187 - Color188 - Color189 - Color190 - Color191 - Color192 - Color193 - Color194 - Color195 - Color196 - Color197 - Color198 - Color199 - Color200 - Color201 - Color202 - Color203 - Color204 - Color205 - Color206 - Color207 - Color208 - Color209 - Color210 - Color211 - Color212 - Color213 - Color214 - Color215 - Color216 - Color217 - Color218 - Color219 - Color220 - Color221 - Color222 - Color223 - Color224 - Color225 - Color226 - Color227 - Color228 - Color229 - Color230 - Color231 - Color232 - Color233 - Color234 - Color235 - Color236 - Color237 - Color238 - Color239 - Color240 - Color241 - Color242 - Color243 - Color244 - Color245 - Color246 - Color247 - Color248 - Color249 - Color250 - Color251 - Color252 - Color253 - Color254 - Color255 - ColorAliceBlue - ColorAntiqueWhite - ColorAquaMarine - ColorAzure - ColorBeige - ColorBisque - ColorBlanchedAlmond - ColorBlueViolet - ColorBrown - ColorBurlyWood - ColorCadetBlue - ColorChartreuse - ColorChocolate - ColorCoral - ColorCornflowerBlue - ColorCornsilk - ColorCrimson - ColorDarkBlue - ColorDarkCyan - ColorDarkGoldenrod - ColorDarkGray - ColorDarkGreen - ColorDarkKhaki - ColorDarkMagenta - ColorDarkOliveGreen - ColorDarkOrange - ColorDarkOrchid - ColorDarkRed - ColorDarkSalmon - ColorDarkSeaGreen - ColorDarkSlateBlue - ColorDarkSlateGray - ColorDarkTurquoise - ColorDarkViolet - ColorDeepPink - ColorDeepSkyBlue - ColorDimGray - ColorDodgerBlue - ColorFireBrick - ColorFloralWhite - ColorForestGreen - ColorGainsboro - ColorGhostWhite - ColorGold - ColorGoldenrod - ColorGreenYellow - ColorHoneydew - ColorHotPink - ColorIndianRed - ColorIndigo - ColorIvory - ColorKhaki - ColorLavender - ColorLavenderBlush - ColorLawnGreen - ColorLemonChiffon - ColorLightBlue - ColorLightCoral - ColorLightCyan - ColorLightGoldenrodYellow - ColorLightGray - ColorLightGreen - ColorLightPink - ColorLightSalmon - ColorLightSeaGreen - ColorLightSkyBlue - ColorLightSlateGray - ColorLightSteelBlue - ColorLightYellow - ColorLimeGreen - ColorLinen - ColorMediumAquamarine - ColorMediumBlue - ColorMediumOrchid - ColorMediumPurple - ColorMediumSeaGreen - ColorMediumSlateBlue - ColorMediumSpringGreen - ColorMediumTurquoise - ColorMediumVioletRed - ColorMidnightBlue - ColorMintCream - ColorMistyRose - ColorMoccasin - ColorNavajoWhite - ColorOldLace - ColorOliveDrab - ColorOrange - ColorOrangeRed - ColorOrchid - ColorPaleGoldenrod - ColorPaleGreen - ColorPaleTurquoise - ColorPaleVioletRed - ColorPapayaWhip - ColorPeachPuff - ColorPeru - ColorPink - ColorPlum - ColorPowderBlue - ColorRebeccaPurple - ColorRosyBrown - ColorRoyalBlue - ColorSaddleBrown - ColorSalmon - ColorSandyBrown - ColorSeaGreen - ColorSeashell - ColorSienna - ColorSkyblue - ColorSlateBlue - ColorSlateGray - ColorSnow - ColorSpringGreen - ColorSteelBlue - ColorTan - ColorThistle - ColorTomato - ColorTurquoise - ColorViolet - ColorWheat - ColorWhiteSmoke - ColorYellowGreen -) - -// These are aliases for the color gray, because some of us spell -// it as grey. -const ( - ColorGrey = ColorGray - ColorDimGrey = ColorDimGray - ColorDarkGrey = ColorDarkGray - ColorDarkSlateGrey = ColorDarkSlateGray - ColorLightGrey = ColorLightGray - ColorLightSlateGrey = ColorLightSlateGray - ColorSlateGrey = ColorSlateGray -) - -// ColorValues maps color constants to their RGB values. -var ColorValues = map[Color]int32{ - ColorBlack: 0x000000, - ColorMaroon: 0x800000, - ColorGreen: 0x008000, - ColorOlive: 0x808000, - ColorNavy: 0x000080, - ColorPurple: 0x800080, - ColorTeal: 0x008080, - ColorSilver: 0xC0C0C0, - ColorGray: 0x808080, - ColorRed: 0xFF0000, - ColorLime: 0x00FF00, - ColorYellow: 0xFFFF00, - ColorBlue: 0x0000FF, - ColorFuchsia: 0xFF00FF, - ColorAqua: 0x00FFFF, - ColorWhite: 0xFFFFFF, - Color16: 0x000000, // black - Color17: 0x00005F, - Color18: 0x000087, - Color19: 0x0000AF, - Color20: 0x0000D7, - Color21: 0x0000FF, // blue - Color22: 0x005F00, - Color23: 0x005F5F, - Color24: 0x005F87, - Color25: 0x005FAF, - Color26: 0x005FD7, - Color27: 0x005FFF, - Color28: 0x008700, - Color29: 0x00875F, - Color30: 0x008787, - Color31: 0x0087Af, - Color32: 0x0087D7, - Color33: 0x0087FF, - Color34: 0x00AF00, - Color35: 0x00AF5F, - Color36: 0x00AF87, - Color37: 0x00AFAF, - Color38: 0x00AFD7, - Color39: 0x00AFFF, - Color40: 0x00D700, - Color41: 0x00D75F, - Color42: 0x00D787, - Color43: 0x00D7AF, - Color44: 0x00D7D7, - Color45: 0x00D7FF, - Color46: 0x00FF00, // lime - Color47: 0x00FF5F, - Color48: 0x00FF87, - Color49: 0x00FFAF, - Color50: 0x00FFd7, - Color51: 0x00FFFF, // aqua - Color52: 0x5F0000, - Color53: 0x5F005F, - Color54: 0x5F0087, - Color55: 0x5F00AF, - Color56: 0x5F00D7, - Color57: 0x5F00FF, - Color58: 0x5F5F00, - Color59: 0x5F5F5F, - Color60: 0x5F5F87, - Color61: 0x5F5FAF, - Color62: 0x5F5FD7, - Color63: 0x5F5FFF, - Color64: 0x5F8700, - Color65: 0x5F875F, - Color66: 0x5F8787, - Color67: 0x5F87AF, - Color68: 0x5F87D7, - Color69: 0x5F87FF, - Color70: 0x5FAF00, - Color71: 0x5FAF5F, - Color72: 0x5FAF87, - Color73: 0x5FAFAF, - Color74: 0x5FAFD7, - Color75: 0x5FAFFF, - Color76: 0x5FD700, - Color77: 0x5FD75F, - Color78: 0x5FD787, - Color79: 0x5FD7AF, - Color80: 0x5FD7D7, - Color81: 0x5FD7FF, - Color82: 0x5FFF00, - Color83: 0x5FFF5F, - Color84: 0x5FFF87, - Color85: 0x5FFFAF, - Color86: 0x5FFFD7, - Color87: 0x5FFFFF, - Color88: 0x870000, - Color89: 0x87005F, - Color90: 0x870087, - Color91: 0x8700AF, - Color92: 0x8700D7, - Color93: 0x8700FF, - Color94: 0x875F00, - Color95: 0x875F5F, - Color96: 0x875F87, - Color97: 0x875FAF, - Color98: 0x875FD7, - Color99: 0x875FFF, - Color100: 0x878700, - Color101: 0x87875F, - Color102: 0x878787, - Color103: 0x8787AF, - Color104: 0x8787D7, - Color105: 0x8787FF, - Color106: 0x87AF00, - Color107: 0x87AF5F, - Color108: 0x87AF87, - Color109: 0x87AFAF, - Color110: 0x87AFD7, - Color111: 0x87AFFF, - Color112: 0x87D700, - Color113: 0x87D75F, - Color114: 0x87D787, - Color115: 0x87D7AF, - Color116: 0x87D7D7, - Color117: 0x87D7FF, - Color118: 0x87FF00, - Color119: 0x87FF5F, - Color120: 0x87FF87, - Color121: 0x87FFAF, - Color122: 0x87FFD7, - Color123: 0x87FFFF, - Color124: 0xAF0000, - Color125: 0xAF005F, - Color126: 0xAF0087, - Color127: 0xAF00AF, - Color128: 0xAF00D7, - Color129: 0xAF00FF, - Color130: 0xAF5F00, - Color131: 0xAF5F5F, - Color132: 0xAF5F87, - Color133: 0xAF5FAF, - Color134: 0xAF5FD7, - Color135: 0xAF5FFF, - Color136: 0xAF8700, - Color137: 0xAF875F, - Color138: 0xAF8787, - Color139: 0xAF87AF, - Color140: 0xAF87D7, - Color141: 0xAF87FF, - Color142: 0xAFAF00, - Color143: 0xAFAF5F, - Color144: 0xAFAF87, - Color145: 0xAFAFAF, - Color146: 0xAFAFD7, - Color147: 0xAFAFFF, - Color148: 0xAFD700, - Color149: 0xAFD75F, - Color150: 0xAFD787, - Color151: 0xAFD7AF, - Color152: 0xAFD7D7, - Color153: 0xAFD7FF, - Color154: 0xAFFF00, - Color155: 0xAFFF5F, - Color156: 0xAFFF87, - Color157: 0xAFFFAF, - Color158: 0xAFFFD7, - Color159: 0xAFFFFF, - Color160: 0xD70000, - Color161: 0xD7005F, - Color162: 0xD70087, - Color163: 0xD700AF, - Color164: 0xD700D7, - Color165: 0xD700FF, - Color166: 0xD75F00, - Color167: 0xD75F5F, - Color168: 0xD75F87, - Color169: 0xD75FAF, - Color170: 0xD75FD7, - Color171: 0xD75FFF, - Color172: 0xD78700, - Color173: 0xD7875F, - Color174: 0xD78787, - Color175: 0xD787AF, - Color176: 0xD787D7, - Color177: 0xD787FF, - Color178: 0xD7AF00, - Color179: 0xD7AF5F, - Color180: 0xD7AF87, - Color181: 0xD7AFAF, - Color182: 0xD7AFD7, - Color183: 0xD7AFFF, - Color184: 0xD7D700, - Color185: 0xD7D75F, - Color186: 0xD7D787, - Color187: 0xD7D7AF, - Color188: 0xD7D7D7, - Color189: 0xD7D7FF, - Color190: 0xD7FF00, - Color191: 0xD7FF5F, - Color192: 0xD7FF87, - Color193: 0xD7FFAF, - Color194: 0xD7FFD7, - Color195: 0xD7FFFF, - Color196: 0xFF0000, // red - Color197: 0xFF005F, - Color198: 0xFF0087, - Color199: 0xFF00AF, - Color200: 0xFF00D7, - Color201: 0xFF00FF, // fuchsia - Color202: 0xFF5F00, - Color203: 0xFF5F5F, - Color204: 0xFF5F87, - Color205: 0xFF5FAF, - Color206: 0xFF5FD7, - Color207: 0xFF5FFF, - Color208: 0xFF8700, - Color209: 0xFF875F, - Color210: 0xFF8787, - Color211: 0xFF87AF, - Color212: 0xFF87D7, - Color213: 0xFF87FF, - Color214: 0xFFAF00, - Color215: 0xFFAF5F, - Color216: 0xFFAF87, - Color217: 0xFFAFAF, - Color218: 0xFFAFD7, - Color219: 0xFFAFFF, - Color220: 0xFFD700, - Color221: 0xFFD75F, - Color222: 0xFFD787, - Color223: 0xFFD7AF, - Color224: 0xFFD7D7, - Color225: 0xFFD7FF, - Color226: 0xFFFF00, // yellow - Color227: 0xFFFF5F, - Color228: 0xFFFF87, - Color229: 0xFFFFAF, - Color230: 0xFFFFD7, - Color231: 0xFFFFFF, // white - Color232: 0x080808, - Color233: 0x121212, - Color234: 0x1C1C1C, - Color235: 0x262626, - Color236: 0x303030, - Color237: 0x3A3A3A, - Color238: 0x444444, - Color239: 0x4E4E4E, - Color240: 0x585858, - Color241: 0x626262, - Color242: 0x6C6C6C, - Color243: 0x767676, - Color244: 0x808080, // grey - Color245: 0x8A8A8A, - Color246: 0x949494, - Color247: 0x9E9E9E, - Color248: 0xA8A8A8, - Color249: 0xB2B2B2, - Color250: 0xBCBCBC, - Color251: 0xC6C6C6, - Color252: 0xD0D0D0, - Color253: 0xDADADA, - Color254: 0xE4E4E4, - Color255: 0xEEEEEE, - ColorAliceBlue: 0xF0F8FF, - ColorAntiqueWhite: 0xFAEBD7, - ColorAquaMarine: 0x7FFFD4, - ColorAzure: 0xF0FFFF, - ColorBeige: 0xF5F5DC, - ColorBisque: 0xFFE4C4, - ColorBlanchedAlmond: 0xFFEBCD, - ColorBlueViolet: 0x8A2BE2, - ColorBrown: 0xA52A2A, - ColorBurlyWood: 0xDEB887, - ColorCadetBlue: 0x5F9EA0, - ColorChartreuse: 0x7FFF00, - ColorChocolate: 0xD2691E, - ColorCoral: 0xFF7F50, - ColorCornflowerBlue: 0x6495ED, - ColorCornsilk: 0xFFF8DC, - ColorCrimson: 0xDC143C, - ColorDarkBlue: 0x00008B, - ColorDarkCyan: 0x008B8B, - ColorDarkGoldenrod: 0xB8860B, - ColorDarkGray: 0xA9A9A9, - ColorDarkGreen: 0x006400, - ColorDarkKhaki: 0xBDB76B, - ColorDarkMagenta: 0x8B008B, - ColorDarkOliveGreen: 0x556B2F, - ColorDarkOrange: 0xFF8C00, - ColorDarkOrchid: 0x9932CC, - ColorDarkRed: 0x8B0000, - ColorDarkSalmon: 0xE9967A, - ColorDarkSeaGreen: 0x8FBC8F, - ColorDarkSlateBlue: 0x483D8B, - ColorDarkSlateGray: 0x2F4F4F, - ColorDarkTurquoise: 0x00CED1, - ColorDarkViolet: 0x9400D3, - ColorDeepPink: 0xFF1493, - ColorDeepSkyBlue: 0x00BFFF, - ColorDimGray: 0x696969, - ColorDodgerBlue: 0x1E90FF, - ColorFireBrick: 0xB22222, - ColorFloralWhite: 0xFFFAF0, - ColorForestGreen: 0x228B22, - ColorGainsboro: 0xDCDCDC, - ColorGhostWhite: 0xF8F8FF, - ColorGold: 0xFFD700, - ColorGoldenrod: 0xDAA520, - ColorGreenYellow: 0xADFF2F, - ColorHoneydew: 0xF0FFF0, - ColorHotPink: 0xFF69B4, - ColorIndianRed: 0xCD5C5C, - ColorIndigo: 0x4B0082, - ColorIvory: 0xFFFFF0, - ColorKhaki: 0xF0E68C, - ColorLavender: 0xE6E6FA, - ColorLavenderBlush: 0xFFF0F5, - ColorLawnGreen: 0x7CFC00, - ColorLemonChiffon: 0xFFFACD, - ColorLightBlue: 0xADD8E6, - ColorLightCoral: 0xF08080, - ColorLightCyan: 0xE0FFFF, - ColorLightGoldenrodYellow: 0xFAFAD2, - ColorLightGray: 0xD3D3D3, - ColorLightGreen: 0x90EE90, - ColorLightPink: 0xFFB6C1, - ColorLightSalmon: 0xFFA07A, - ColorLightSeaGreen: 0x20B2AA, - ColorLightSkyBlue: 0x87CEFA, - ColorLightSlateGray: 0x778899, - ColorLightSteelBlue: 0xB0C4DE, - ColorLightYellow: 0xFFFFE0, - ColorLimeGreen: 0x32CD32, - ColorLinen: 0xFAF0E6, - ColorMediumAquamarine: 0x66CDAA, - ColorMediumBlue: 0x0000CD, - ColorMediumOrchid: 0xBA55D3, - ColorMediumPurple: 0x9370DB, - ColorMediumSeaGreen: 0x3CB371, - ColorMediumSlateBlue: 0x7B68EE, - ColorMediumSpringGreen: 0x00FA9A, - ColorMediumTurquoise: 0x48D1CC, - ColorMediumVioletRed: 0xC71585, - ColorMidnightBlue: 0x191970, - ColorMintCream: 0xF5FFFA, - ColorMistyRose: 0xFFE4E1, - ColorMoccasin: 0xFFE4B5, - ColorNavajoWhite: 0xFFDEAD, - ColorOldLace: 0xFDF5E6, - ColorOliveDrab: 0x6B8E23, - ColorOrange: 0xFFA500, - ColorOrangeRed: 0xFF4500, - ColorOrchid: 0xDA70D6, - ColorPaleGoldenrod: 0xEEE8AA, - ColorPaleGreen: 0x98FB98, - ColorPaleTurquoise: 0xAFEEEE, - ColorPaleVioletRed: 0xDB7093, - ColorPapayaWhip: 0xFFEFD5, - ColorPeachPuff: 0xFFDAB9, - ColorPeru: 0xCD853F, - ColorPink: 0xFFC0CB, - ColorPlum: 0xDDA0DD, - ColorPowderBlue: 0xB0E0E6, - ColorRebeccaPurple: 0x663399, - ColorRosyBrown: 0xBC8F8F, - ColorRoyalBlue: 0x4169E1, - ColorSaddleBrown: 0x8B4513, - ColorSalmon: 0xFA8072, - ColorSandyBrown: 0xF4A460, - ColorSeaGreen: 0x2E8B57, - ColorSeashell: 0xFFF5EE, - ColorSienna: 0xA0522D, - ColorSkyblue: 0x87CEEB, - ColorSlateBlue: 0x6A5ACD, - ColorSlateGray: 0x708090, - ColorSnow: 0xFFFAFA, - ColorSpringGreen: 0x00FF7F, - ColorSteelBlue: 0x4682B4, - ColorTan: 0xD2B48C, - ColorThistle: 0xD8BFD8, - ColorTomato: 0xFF6347, - ColorTurquoise: 0x40E0D0, - ColorViolet: 0xEE82EE, - ColorWheat: 0xF5DEB3, - ColorWhiteSmoke: 0xF5F5F5, - ColorYellowGreen: 0x9ACD32, -} - -// ColorNames holds the written names of colors. Useful to present a list of -// recognized named colors. -var ColorNames = map[string]Color{ - "black": ColorBlack, - "maroon": ColorMaroon, - "green": ColorGreen, - "olive": ColorOlive, - "navy": ColorNavy, - "purple": ColorPurple, - "teal": ColorTeal, - "silver": ColorSilver, - "gray": ColorGray, - "red": ColorRed, - "lime": ColorLime, - "yellow": ColorYellow, - "blue": ColorBlue, - "fuchsia": ColorFuchsia, - "aqua": ColorAqua, - "white": ColorWhite, - "aliceblue": ColorAliceBlue, - "antiquewhite": ColorAntiqueWhite, - "aquamarine": ColorAquaMarine, - "azure": ColorAzure, - "beige": ColorBeige, - "bisque": ColorBisque, - "blanchedalmond": ColorBlanchedAlmond, - "blueviolet": ColorBlueViolet, - "brown": ColorBrown, - "burlywood": ColorBurlyWood, - "cadetblue": ColorCadetBlue, - "chartreuse": ColorChartreuse, - "chocolate": ColorChocolate, - "coral": ColorCoral, - "cornflowerblue": ColorCornflowerBlue, - "cornsilk": ColorCornsilk, - "crimson": ColorCrimson, - "darkblue": ColorDarkBlue, - "darkcyan": ColorDarkCyan, - "darkgoldenrod": ColorDarkGoldenrod, - "darkgray": ColorDarkGray, - "darkgreen": ColorDarkGreen, - "darkkhaki": ColorDarkKhaki, - "darkmagenta": ColorDarkMagenta, - "darkolivegreen": ColorDarkOliveGreen, - "darkorange": ColorDarkOrange, - "darkorchid": ColorDarkOrchid, - "darkred": ColorDarkRed, - "darksalmon": ColorDarkSalmon, - "darkseagreen": ColorDarkSeaGreen, - "darkslateblue": ColorDarkSlateBlue, - "darkslategray": ColorDarkSlateGray, - "darkturquoise": ColorDarkTurquoise, - "darkviolet": ColorDarkViolet, - "deeppink": ColorDeepPink, - "deepskyblue": ColorDeepSkyBlue, - "dimgray": ColorDimGray, - "dodgerblue": ColorDodgerBlue, - "firebrick": ColorFireBrick, - "floralwhite": ColorFloralWhite, - "forestgreen": ColorForestGreen, - "gainsboro": ColorGainsboro, - "ghostwhite": ColorGhostWhite, - "gold": ColorGold, - "goldenrod": ColorGoldenrod, - "greenyellow": ColorGreenYellow, - "honeydew": ColorHoneydew, - "hotpink": ColorHotPink, - "indianred": ColorIndianRed, - "indigo": ColorIndigo, - "ivory": ColorIvory, - "khaki": ColorKhaki, - "lavender": ColorLavender, - "lavenderblush": ColorLavenderBlush, - "lawngreen": ColorLawnGreen, - "lemonchiffon": ColorLemonChiffon, - "lightblue": ColorLightBlue, - "lightcoral": ColorLightCoral, - "lightcyan": ColorLightCyan, - "lightgoldenrodyellow": ColorLightGoldenrodYellow, - "lightgray": ColorLightGray, - "lightgreen": ColorLightGreen, - "lightpink": ColorLightPink, - "lightsalmon": ColorLightSalmon, - "lightseagreen": ColorLightSeaGreen, - "lightskyblue": ColorLightSkyBlue, - "lightslategray": ColorLightSlateGray, - "lightsteelblue": ColorLightSteelBlue, - "lightyellow": ColorLightYellow, - "limegreen": ColorLimeGreen, - "linen": ColorLinen, - "mediumaquamarine": ColorMediumAquamarine, - "mediumblue": ColorMediumBlue, - "mediumorchid": ColorMediumOrchid, - "mediumpurple": ColorMediumPurple, - "mediumseagreen": ColorMediumSeaGreen, - "mediumslateblue": ColorMediumSlateBlue, - "mediumspringgreen": ColorMediumSpringGreen, - "mediumturquoise": ColorMediumTurquoise, - "mediumvioletred": ColorMediumVioletRed, - "midnightblue": ColorMidnightBlue, - "mintcream": ColorMintCream, - "mistyrose": ColorMistyRose, - "moccasin": ColorMoccasin, - "navajowhite": ColorNavajoWhite, - "oldlace": ColorOldLace, - "olivedrab": ColorOliveDrab, - "orange": ColorOrange, - "orangered": ColorOrangeRed, - "orchid": ColorOrchid, - "palegoldenrod": ColorPaleGoldenrod, - "palegreen": ColorPaleGreen, - "paleturquoise": ColorPaleTurquoise, - "palevioletred": ColorPaleVioletRed, - "papayawhip": ColorPapayaWhip, - "peachpuff": ColorPeachPuff, - "peru": ColorPeru, - "pink": ColorPink, - "plum": ColorPlum, - "powderblue": ColorPowderBlue, - "rebeccapurple": ColorRebeccaPurple, - "rosybrown": ColorRosyBrown, - "royalblue": ColorRoyalBlue, - "saddlebrown": ColorSaddleBrown, - "salmon": ColorSalmon, - "sandybrown": ColorSandyBrown, - "seagreen": ColorSeaGreen, - "seashell": ColorSeashell, - "sienna": ColorSienna, - "skyblue": ColorSkyblue, - "slateblue": ColorSlateBlue, - "slategray": ColorSlateGray, - "snow": ColorSnow, - "springgreen": ColorSpringGreen, - "steelblue": ColorSteelBlue, - "tan": ColorTan, - "thistle": ColorThistle, - "tomato": ColorTomato, - "turquoise": ColorTurquoise, - "violet": ColorViolet, - "wheat": ColorWheat, - "whitesmoke": ColorWhiteSmoke, - "yellowgreen": ColorYellowGreen, - "grey": ColorGray, - "dimgrey": ColorDimGray, - "darkgrey": ColorDarkGray, - "darkslategrey": ColorDarkSlateGray, - "lightgrey": ColorLightGray, - "lightslategrey": ColorLightSlateGray, - "slategrey": ColorSlateGray, -} - -// Hex returns the color's hexadecimal RGB 24-bit value with each component -// consisting of a single byte, ala R << 16 | G << 8 | B. If the color -// is unknown or unset, -1 is returned. -func (c Color) Hex() int32 { - if c&ColorIsRGB != 0 { - return (int32(c) & 0xffffff) - } - if v, ok := ColorValues[c]; ok { - return v - } - return -1 -} - -// RGB returns the red, green, and blue components of the color, with -// each component represented as a value 0-255. In the event that the -// color cannot be broken up (not set usually), -1 is returned for each value. -func (c Color) RGB() (int32, int32, int32) { - v := c.Hex() - if v < 0 { - return -1, -1, -1 - } - return (v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff -} - -// NewRGBColor returns a new color with the given red, green, and blue values. -// Each value must be represented in the range 0-255. -func NewRGBColor(r, g, b int32) Color { - return NewHexColor(((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) -} - -// NewHexColor returns a color using the given 24-bit RGB value. -func NewHexColor(v int32) Color { - return ColorIsRGB | Color(v) -} - -// GetColor creates a Color from a color name (W3C name). A hex value may -// be supplied as a string in the format "#ffffff". -func GetColor(name string) Color { - if c, ok := ColorNames[name]; ok { - return c - } - if len(name) == 7 && name[0] == '#' { - if v, e := strconv.ParseInt(name[1:], 16, 32); e == nil { - return NewHexColor(int32(v)) - } - } - return ColorDefault -} diff --git a/vendor/github.com/gdamore/tcell/colorfit.go b/vendor/github.com/gdamore/tcell/colorfit.go deleted file mode 100644 index b7740b8a..00000000 --- a/vendor/github.com/gdamore/tcell/colorfit.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "github.com/lucasb-eyer/go-colorful" - "math" -) - -// FindColor attempts to find a given color, or the best match possible for it, -// from the palette given. This is an expensive operation, so results should -// be cached by the caller. -func FindColor(c Color, palette []Color) Color { - match := ColorDefault - dist := float64(0) - r, g, b := c.RGB() - c1 := colorful.Color{ - R: float64(r) / 255.0, - G: float64(g) / 255.0, - B: float64(b) / 255.0, - } - for _, d := range palette { - r, g, b = d.RGB() - c2 := colorful.Color{ - R: float64(r) / 255.0, - G: float64(g) / 255.0, - B: float64(b) / 255.0, - } - // CIE94 is more accurate, but really really expensive. - nd := c1.DistanceCIE76(c2) - if math.IsNaN(nd) { - nd = math.Inf(1) - } - if match == ColorDefault || nd < dist { - match = d - dist = nd - } - } - return match -} diff --git a/vendor/github.com/gdamore/tcell/console_stub.go b/vendor/github.com/gdamore/tcell/console_stub.go deleted file mode 100644 index fda2f092..00000000 --- a/vendor/github.com/gdamore/tcell/console_stub.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// NewConsoleScreen returns a console based screen. This platform -// doesn't have support for any, so it returns nil and a suitable error. -func NewConsoleScreen() (Screen, error) { - return nil, ErrNoScreen -} diff --git a/vendor/github.com/gdamore/tcell/console_win.go b/vendor/github.com/gdamore/tcell/console_win.go deleted file mode 100644 index 3ebcc713..00000000 --- a/vendor/github.com/gdamore/tcell/console_win.go +++ /dev/null @@ -1,1033 +0,0 @@ -// +build windows - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - "sync" - "syscall" - "unicode/utf16" - "unsafe" -) - -type cScreen struct { - in syscall.Handle - out syscall.Handle - cancelflag syscall.Handle - scandone chan struct{} - evch chan Event - quit chan struct{} - curx int - cury int - style Style - clear bool - fini bool - - w int - h int - - oscreen consoleInfo - ocursor cursorInfo - oimode uint32 - oomode uint32 - cells CellBuffer - colors map[Color]Color - - sync.Mutex -} - -var winLock sync.Mutex - -var winPalette = []Color{ - ColorBlack, - ColorMaroon, - ColorGreen, - ColorNavy, - ColorOlive, - ColorPurple, - ColorTeal, - ColorSilver, - ColorGray, - ColorRed, - ColorLime, - ColorBlue, - ColorYellow, - ColorFuchsia, - ColorAqua, - ColorWhite, -} - -var winColors = map[Color]Color{ - ColorBlack: ColorBlack, - ColorMaroon: ColorMaroon, - ColorGreen: ColorGreen, - ColorNavy: ColorNavy, - ColorOlive: ColorOlive, - ColorPurple: ColorPurple, - ColorTeal: ColorTeal, - ColorSilver: ColorSilver, - ColorGray: ColorGray, - ColorRed: ColorRed, - ColorLime: ColorLime, - ColorBlue: ColorBlue, - ColorYellow: ColorYellow, - ColorFuchsia: ColorFuchsia, - ColorAqua: ColorAqua, - ColorWhite: ColorWhite, -} - -var k32 = syscall.NewLazyDLL("kernel32.dll") - -// We have to bring in the kernel32.dll directly, so we can get access to some -// system calls that the core Go API lacks. -// -// Note that Windows appends some functions with W to indicate that wide -// characters (Unicode) are in use. The documentation refers to them -// without this suffix, as the resolution is made via preprocessor. -var ( - procReadConsoleInput = k32.NewProc("ReadConsoleInputW") - procWaitForMultipleObjects = k32.NewProc("WaitForMultipleObjects") - procCreateEvent = k32.NewProc("CreateEventW") - procSetEvent = k32.NewProc("SetEvent") - procGetConsoleCursorInfo = k32.NewProc("GetConsoleCursorInfo") - procSetConsoleCursorInfo = k32.NewProc("SetConsoleCursorInfo") - procSetConsoleCursorPosition = k32.NewProc("SetConsoleCursorPosition") - procSetConsoleMode = k32.NewProc("SetConsoleMode") - procGetConsoleMode = k32.NewProc("GetConsoleMode") - procGetConsoleScreenBufferInfo = k32.NewProc("GetConsoleScreenBufferInfo") - procFillConsoleOutputAttribute = k32.NewProc("FillConsoleOutputAttribute") - procFillConsoleOutputCharacter = k32.NewProc("FillConsoleOutputCharacterW") - procSetConsoleWindowInfo = k32.NewProc("SetConsoleWindowInfo") - procSetConsoleScreenBufferSize = k32.NewProc("SetConsoleScreenBufferSize") - procSetConsoleTextAttribute = k32.NewProc("SetConsoleTextAttribute") -) - -const ( - w32Infinite = ^uintptr(0) - w32WaitObject0 = uintptr(0) -) - -// NewConsoleScreen returns a Screen for the Windows console associated -// with the current process. The Screen makes use of the Windows Console -// API to display content and read events. -func NewConsoleScreen() (Screen, error) { - return &cScreen{}, nil -} - -func (s *cScreen) Init() error { - s.evch = make(chan Event, 10) - s.quit = make(chan struct{}) - s.scandone = make(chan struct{}) - - in, e := syscall.Open("CONIN$", syscall.O_RDWR, 0) - if e != nil { - return e - } - s.in = in - out, e := syscall.Open("CONOUT$", syscall.O_RDWR, 0) - if e != nil { - syscall.Close(s.in) - return e - } - s.out = out - - cf, _, e := procCreateEvent.Call( - uintptr(0), - uintptr(1), - uintptr(0), - uintptr(0)) - if cf == uintptr(0) { - return e - } - s.cancelflag = syscall.Handle(cf) - - s.Lock() - - s.curx = -1 - s.cury = -1 - s.style = StyleDefault - s.getCursorInfo(&s.ocursor) - s.getConsoleInfo(&s.oscreen) - s.getOutMode(&s.oomode) - s.getInMode(&s.oimode) - s.resize() - - s.fini = false - s.setInMode(modeResizeEn) - s.setOutMode(0) - s.clearScreen(s.style) - s.hideCursor() - s.Unlock() - go s.scanInput() - - return nil -} - -func (s *cScreen) CharacterSet() string { - // We are always UTF-16LE on Windows - return "UTF-16LE" -} - -func (s *cScreen) EnableMouse() { - s.setInMode(modeResizeEn | modeMouseEn | modeExtndFlg) -} - -func (s *cScreen) DisableMouse() { - s.setInMode(modeResizeEn) -} - -func (s *cScreen) Fini() { - s.Lock() - s.style = StyleDefault - s.curx = -1 - s.cury = -1 - s.fini = true - s.Unlock() - - s.setCursorInfo(&s.ocursor) - s.setInMode(s.oimode) - s.setOutMode(s.oomode) - s.setBufferSize(int(s.oscreen.size.x), int(s.oscreen.size.y)) - s.clearScreen(StyleDefault) - s.setCursorPos(0, 0) - procSetConsoleTextAttribute.Call( - uintptr(s.out), - uintptr(s.mapStyle(StyleDefault))) - - close(s.quit) - procSetEvent.Call(uintptr(s.cancelflag)) - // Block until scanInput returns; this prevents a race condition on Win 8+ - // which causes syscall.Close to block until another keypress is read. - <-s.scandone - syscall.Close(s.in) - syscall.Close(s.out) -} - -func (s *cScreen) PostEventWait(ev Event) { - s.evch <- ev -} - -func (s *cScreen) PostEvent(ev Event) error { - select { - case s.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (s *cScreen) PollEvent() Event { - select { - case <-s.quit: - return nil - case ev := <-s.evch: - return ev - } -} - -type cursorInfo struct { - size uint32 - visible uint32 -} - -type coord struct { - x int16 - y int16 -} - -func (c coord) uintptr() uintptr { - // little endian, put x first - return uintptr(c.x) | (uintptr(c.y) << 16) -} - -type rect struct { - left int16 - top int16 - right int16 - bottom int16 -} - -func (s *cScreen) showCursor() { - s.setCursorInfo(&cursorInfo{size: 100, visible: 1}) -} - -func (s *cScreen) hideCursor() { - s.setCursorInfo(&cursorInfo{size: 1, visible: 0}) -} - -func (s *cScreen) ShowCursor(x, y int) { - s.Lock() - if !s.fini { - s.curx = x - s.cury = y - } - s.doCursor() - s.Unlock() -} - -func (s *cScreen) doCursor() { - x, y := s.curx, s.cury - - if x < 0 || y < 0 || x >= s.w || y >= s.h { - s.hideCursor() - } else { - s.setCursorPos(x, y) - s.showCursor() - } -} - -func (s *cScreen) HideCursor() { - s.ShowCursor(-1, -1) -} - -type charInfo struct { - ch uint16 - attr uint16 -} - -type inputRecord struct { - typ uint16 - _ uint16 - data [16]byte -} - -const ( - keyEvent uint16 = 1 - mouseEvent uint16 = 2 - resizeEvent uint16 = 4 - menuEvent uint16 = 8 // don't use - focusEvent uint16 = 16 // don't use -) - -type mouseRecord struct { - x int16 - y int16 - btns uint32 - mod uint32 - flags uint32 -} - -const ( - mouseDoubleClick uint32 = 0x2 - mouseHWheeled uint32 = 0x8 - mouseVWheeled uint32 = 0x4 - mouseMoved uint32 = 0x1 -) - -type resizeRecord struct { - x int16 - y int16 -} - -type keyRecord struct { - isdown int32 - repeat uint16 - kcode uint16 - scode uint16 - ch uint16 - mod uint32 -} - -const ( - // Constants per Microsoft. We don't put the modifiers - // here. - vkCancel = 0x03 - vkBack = 0x08 // Backspace - vkTab = 0x09 - vkClear = 0x0c - vkReturn = 0x0d - vkPause = 0x13 - vkEscape = 0x1b - vkSpace = 0x20 - vkPrior = 0x21 // PgUp - vkNext = 0x22 // PgDn - vkEnd = 0x23 - vkHome = 0x24 - vkLeft = 0x25 - vkUp = 0x26 - vkRight = 0x27 - vkDown = 0x28 - vkPrint = 0x2a - vkPrtScr = 0x2c - vkInsert = 0x2d - vkDelete = 0x2e - vkHelp = 0x2f - vkF1 = 0x70 - vkF2 = 0x71 - vkF3 = 0x72 - vkF4 = 0x73 - vkF5 = 0x74 - vkF6 = 0x75 - vkF7 = 0x76 - vkF8 = 0x77 - vkF9 = 0x78 - vkF10 = 0x79 - vkF11 = 0x7a - vkF12 = 0x7b - vkF13 = 0x7c - vkF14 = 0x7d - vkF15 = 0x7e - vkF16 = 0x7f - vkF17 = 0x80 - vkF18 = 0x81 - vkF19 = 0x82 - vkF20 = 0x83 - vkF21 = 0x84 - vkF22 = 0x85 - vkF23 = 0x86 - vkF24 = 0x87 -) - -var vkKeys = map[uint16]Key{ - vkCancel: KeyCancel, - vkBack: KeyBackspace, - vkTab: KeyTab, - vkClear: KeyClear, - vkPause: KeyPause, - vkPrint: KeyPrint, - vkPrtScr: KeyPrint, - vkPrior: KeyPgUp, - vkNext: KeyPgDn, - vkReturn: KeyEnter, - vkEnd: KeyEnd, - vkHome: KeyHome, - vkLeft: KeyLeft, - vkUp: KeyUp, - vkRight: KeyRight, - vkDown: KeyDown, - vkInsert: KeyInsert, - vkDelete: KeyDelete, - vkHelp: KeyHelp, - vkF1: KeyF1, - vkF2: KeyF2, - vkF3: KeyF3, - vkF4: KeyF4, - vkF5: KeyF5, - vkF6: KeyF6, - vkF7: KeyF7, - vkF8: KeyF8, - vkF9: KeyF9, - vkF10: KeyF10, - vkF11: KeyF11, - vkF12: KeyF12, - vkF13: KeyF13, - vkF14: KeyF14, - vkF15: KeyF15, - vkF16: KeyF16, - vkF17: KeyF17, - vkF18: KeyF18, - vkF19: KeyF19, - vkF20: KeyF20, - vkF21: KeyF21, - vkF22: KeyF22, - vkF23: KeyF23, - vkF24: KeyF24, -} - -// NB: All Windows platforms are little endian. We assume this -// never, ever change. The following code is endian safe. and does -// not use unsafe pointers. -func getu32(v []byte) uint32 { - return uint32(v[0]) + (uint32(v[1]) << 8) + (uint32(v[2]) << 16) + (uint32(v[3]) << 24) -} -func geti32(v []byte) int32 { - return int32(getu32(v)) -} -func getu16(v []byte) uint16 { - return uint16(v[0]) + (uint16(v[1]) << 8) -} -func geti16(v []byte) int16 { - return int16(getu16(v)) -} - -// Convert windows dwControlKeyState to modifier mask -func mod2mask(cks uint32) ModMask { - mm := ModNone - // Left or right control - if (cks & (0x0008 | 0x0004)) != 0 { - mm |= ModCtrl - } - // Left or right alt - if (cks & (0x0002 | 0x0001)) != 0 { - mm |= ModAlt - } - // Any shift - if (cks & 0x0010) != 0 { - mm |= ModShift - } - return mm -} - -func mrec2btns(mbtns, flags uint32) ButtonMask { - btns := ButtonNone - if mbtns&0x1 != 0 { - btns |= Button1 - } - if mbtns&0x2 != 0 { - btns |= Button2 - } - if mbtns&0x4 != 0 { - btns |= Button3 - } - if mbtns&0x8 != 0 { - btns |= Button4 - } - if mbtns&0x10 != 0 { - btns |= Button5 - } - if mbtns&0x20 != 0 { - btns |= Button6 - } - if mbtns&0x40 != 0 { - btns |= Button7 - } - if mbtns&0x80 != 0 { - btns |= Button8 - } - - if flags&mouseVWheeled != 0 { - if mbtns&0x80000000 == 0 { - btns |= WheelUp - } else { - btns |= WheelDown - } - } - if flags&mouseHWheeled != 0 { - if mbtns&0x80000000 == 0 { - btns |= WheelRight - } else { - btns |= WheelLeft - } - } - return btns -} - -func (s *cScreen) getConsoleInput() error { - // cancelFlag comes first as WaitForMultipleObjects returns the lowest index - // in the event that both events are signalled. - waitObjects := []syscall.Handle{s.cancelflag, s.in} - // As arrays are contiguous in memory, a pointer to the first object is the - // same as a pointer to the array itself. - pWaitObjects := unsafe.Pointer(&waitObjects[0]) - - rv, _, er := procWaitForMultipleObjects.Call( - uintptr(len(waitObjects)), - uintptr(pWaitObjects), - uintptr(0), - w32Infinite) - // WaitForMultipleObjects returns WAIT_OBJECT_0 + the index. - switch rv { - case w32WaitObject0: // s.cancelFlag - return errors.New("cancelled") - case w32WaitObject0 + 1: // s.in - rec := &inputRecord{} - var nrec int32 - rv, _, er := procReadConsoleInput.Call( - uintptr(s.in), - uintptr(unsafe.Pointer(rec)), - uintptr(1), - uintptr(unsafe.Pointer(&nrec))) - if rv == 0 { - return er - } - if nrec != 1 { - return nil - } - switch rec.typ { - case keyEvent: - krec := &keyRecord{} - krec.isdown = geti32(rec.data[0:]) - krec.repeat = getu16(rec.data[4:]) - krec.kcode = getu16(rec.data[6:]) - krec.scode = getu16(rec.data[8:]) - krec.ch = getu16(rec.data[10:]) - krec.mod = getu32(rec.data[12:]) - - if krec.isdown == 0 || krec.repeat < 1 { - // its a key release event, ignore it - return nil - } - if krec.ch != 0 { - // synthesized key code - for krec.repeat > 0 { - // convert shift+tab to backtab - if mod2mask(krec.mod) == ModShift && krec.ch == vkTab { - s.PostEvent(NewEventKey(KeyBacktab, 0, - ModNone)) - } else { - s.PostEvent(NewEventKey(KeyRune, rune(krec.ch), - mod2mask(krec.mod))) - } - krec.repeat-- - } - return nil - } - key := KeyNUL // impossible on Windows - ok := false - if key, ok = vkKeys[krec.kcode]; !ok { - return nil - } - for krec.repeat > 0 { - s.PostEvent(NewEventKey(key, rune(krec.ch), - mod2mask(krec.mod))) - krec.repeat-- - } - - case mouseEvent: - var mrec mouseRecord - mrec.x = geti16(rec.data[0:]) - mrec.y = geti16(rec.data[2:]) - mrec.btns = getu32(rec.data[4:]) - mrec.mod = getu32(rec.data[8:]) - mrec.flags = getu32(rec.data[12:]) - btns := mrec2btns(mrec.btns, mrec.flags) - // we ignore double click, events are delivered normally - s.PostEvent(NewEventMouse(int(mrec.x), int(mrec.y), btns, - mod2mask(mrec.mod))) - - case resizeEvent: - var rrec resizeRecord - rrec.x = geti16(rec.data[0:]) - rrec.y = geti16(rec.data[2:]) - s.PostEvent(NewEventResize(int(rrec.x), int(rrec.y))) - - default: - } - default: - return er - } - - return nil -} - -func (s *cScreen) scanInput() { - for { - if e := s.getConsoleInput(); e != nil { - close(s.scandone) - return - } - } -} - -// Windows console can display 8 characters, in either low or high intensity -func (s *cScreen) Colors() int { - return 16 -} - -var vgaColors = map[Color]uint16{ - ColorBlack: 0, - ColorMaroon: 0x4, - ColorGreen: 0x2, - ColorNavy: 0x1, - ColorOlive: 0x6, - ColorPurple: 0x5, - ColorTeal: 0x3, - ColorSilver: 0x7, - ColorGrey: 0x8, - ColorRed: 0xc, - ColorLime: 0xa, - ColorBlue: 0x9, - ColorYellow: 0xe, - ColorFuchsia: 0xd, - ColorAqua: 0xb, - ColorWhite: 0xf, -} - -// Windows uses RGB signals -func mapColor2RGB(c Color) uint16 { - winLock.Lock() - if v, ok := winColors[c]; ok { - c = v - } else { - v = FindColor(c, winPalette) - winColors[c] = v - c = v - } - winLock.Unlock() - - if vc, ok := vgaColors[c]; ok { - return vc - } - return 0 -} - -// Map a tcell style to Windows attributes -func (s *cScreen) mapStyle(style Style) uint16 { - f, b, a := style.Decompose() - fa := s.oscreen.attrs & 0xf - ba := (s.oscreen.attrs) >> 4 & 0xf - if f != ColorDefault { - fa = mapColor2RGB(f) - } - if b != ColorDefault { - ba = mapColor2RGB(b) - } - var attr uint16 - // We simulate reverse by doing the color swap ourselves. - // Apparently windows cannot really do this except in DBCS - // views. - if a&AttrReverse != 0 { - attr = ba - attr |= (fa << 4) - } else { - attr = fa - attr |= (ba << 4) - } - if a&AttrBold != 0 { - attr |= 0x8 - } - if a&AttrDim != 0 { - attr &^= 0x8 - } - if a&AttrUnderline != 0 { - // Best effort -- doesn't seem to work though. - attr |= 0x8000 - } - // Blink is unsupported - return attr -} - -func (s *cScreen) SetCell(x, y int, style Style, ch ...rune) { - if len(ch) > 0 { - s.SetContent(x, y, ch[0], ch[1:], style) - } else { - s.SetContent(x, y, ' ', nil, style) - } -} - -func (s *cScreen) SetContent(x, y int, mainc rune, combc []rune, style Style) { - s.Lock() - if !s.fini { - s.cells.SetContent(x, y, mainc, combc, style) - } - s.Unlock() -} - -func (s *cScreen) GetContent(x, y int) (rune, []rune, Style, int) { - s.Lock() - mainc, combc, style, width := s.cells.GetContent(x, y) - s.Unlock() - return mainc, combc, style, width -} - -func (s *cScreen) writeString(x, y int, style Style, ch []uint16) { - // we assume the caller has hidden the cursor - if len(ch) == 0 { - return - } - nw := uint32(len(ch)) - procSetConsoleTextAttribute.Call( - uintptr(s.out), - uintptr(s.mapStyle(style))) - s.setCursorPos(x, y) - syscall.WriteConsole(s.out, &ch[0], nw, &nw, nil) -} - -func (s *cScreen) draw() { - // allocate a scratch line bit enough for no combining chars. - // if you have combining characters, you may pay for extra allocs. - if s.clear { - s.clearScreen(s.style) - s.clear = false - s.cells.Invalidate() - } - buf := make([]uint16, 0, s.w) - wcs := buf[:] - lstyle := Style(-1) // invalid attribute - - lx, ly := -1, -1 - ra := make([]rune, 1) - - for y := 0; y < int(s.h); y++ { - for x := 0; x < int(s.w); x++ { - mainc, combc, style, width := s.cells.GetContent(x, y) - dirty := s.cells.Dirty(x, y) - if style == StyleDefault { - style = s.style - } - - if !dirty || style != lstyle { - // write out any data queued thus far - // because we are going to skip over some - // cells, or because we need to change styles - s.writeString(lx, ly, lstyle, wcs) - wcs = buf[0:0] - lstyle = Style(-1) - if !dirty { - continue - } - } - if x > s.w-width { - mainc = ' ' - combc = nil - width = 1 - } - if len(wcs) == 0 { - lstyle = style - lx = x - ly = y - } - ra[0] = mainc - wcs = append(wcs, utf16.Encode(ra)...) - if len(combc) != 0 { - wcs = append(wcs, utf16.Encode(combc)...) - } - for dx := 0; dx < width; dx++ { - s.cells.SetDirty(x+dx, y, false) - } - x += width - 1 - } - s.writeString(lx, ly, lstyle, wcs) - wcs = buf[0:0] - lstyle = Style(-1) - } -} - -func (s *cScreen) Show() { - s.Lock() - if !s.fini { - s.hideCursor() - s.resize() - s.draw() - s.doCursor() - } - s.Unlock() -} - -func (s *cScreen) Sync() { - s.Lock() - if !s.fini { - s.cells.Invalidate() - s.hideCursor() - s.resize() - s.draw() - s.doCursor() - } - s.Unlock() -} - -type consoleInfo struct { - size coord - pos coord - attrs uint16 - win rect - maxsz coord -} - -func (s *cScreen) getConsoleInfo(info *consoleInfo) { - procGetConsoleScreenBufferInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) getCursorInfo(info *cursorInfo) { - procGetConsoleCursorInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) setCursorInfo(info *cursorInfo) { - procSetConsoleCursorInfo.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(info))) -} - -func (s *cScreen) setCursorPos(x, y int) { - procSetConsoleCursorPosition.Call( - uintptr(s.out), - coord{int16(x), int16(y)}.uintptr()) -} - -func (s *cScreen) setBufferSize(x, y int) { - procSetConsoleScreenBufferSize.Call( - uintptr(s.out), - coord{int16(x), int16(y)}.uintptr()) -} - -func (s *cScreen) Size() (int, int) { - s.Lock() - w, h := s.w, s.h - s.Unlock() - - return w, h -} - -func (s *cScreen) resize() { - info := consoleInfo{} - s.getConsoleInfo(&info) - - w := int((info.win.right - info.win.left) + 1) - h := int((info.win.bottom - info.win.top) + 1) - - if s.w == w && s.h == h { - return - } - - s.cells.Resize(w, h) - s.w = w - s.h = h - - s.setBufferSize(w, h) - - r := rect{0, 0, int16(w - 1), int16(h - 1)} - procSetConsoleWindowInfo.Call( - uintptr(s.out), - uintptr(1), - uintptr(unsafe.Pointer(&r))) - - s.PostEvent(NewEventResize(w, h)) -} - -func (s *cScreen) Clear() { - s.Fill(' ', s.style) -} - -func (s *cScreen) Fill(r rune, style Style) { - s.Lock() - if !s.fini { - s.cells.Fill(r, style) - s.clear = true - } - s.Unlock() -} - -func (s *cScreen) clearScreen(style Style) { - pos := coord{0, 0} - attr := s.mapStyle(style) - x, y := s.w, s.h - scratch := uint32(0) - count := uint32(x * y) - - procFillConsoleOutputAttribute.Call( - uintptr(s.out), - uintptr(attr), - uintptr(count), - pos.uintptr(), - uintptr(unsafe.Pointer(&scratch))) - procFillConsoleOutputCharacter.Call( - uintptr(s.out), - uintptr(' '), - uintptr(count), - pos.uintptr(), - uintptr(unsafe.Pointer(&scratch))) -} - -const ( - modeExtndFlg uint32 = 0x0080 - modeMouseEn uint32 = 0x0010 - modeResizeEn uint32 = 0x0008 - modeWrapEOL uint32 = 0x0002 - modeCooked uint32 = 0x0001 -) - -func (s *cScreen) setInMode(mode uint32) error { - rv, _, err := procSetConsoleMode.Call( - uintptr(s.in), - uintptr(mode)) - if rv == 0 { - return err - } - return nil -} - -func (s *cScreen) setOutMode(mode uint32) error { - rv, _, err := procSetConsoleMode.Call( - uintptr(s.out), - uintptr(mode)) - if rv == 0 { - return err - } - return nil -} - -func (s *cScreen) getInMode(v *uint32) { - procGetConsoleMode.Call( - uintptr(s.in), - uintptr(unsafe.Pointer(v))) -} - -func (s *cScreen) getOutMode(v *uint32) { - procGetConsoleMode.Call( - uintptr(s.out), - uintptr(unsafe.Pointer(v))) -} - -func (s *cScreen) SetStyle(style Style) { - s.Lock() - s.style = style - s.Unlock() -} - -// No fallback rune support, since we have Unicode. Yay! - -func (s *cScreen) RegisterRuneFallback(r rune, subst string) { -} - -func (s *cScreen) UnregisterRuneFallback(r rune) { -} - -func (s *cScreen) CanDisplay(r rune, checkFallbacks bool) bool { - // We presume we can display anything -- we're Unicode. - // (Sadly this not precisely true. Combinings are especially - // poorly supported under Windows.) - return true -} - -func (s *cScreen) HasMouse() bool { - return true -} - -func (s *cScreen) Resize(int, int, int, int) {} - -func (s *cScreen) HasKey(k Key) bool { - // Microsoft has codes for some keys, but they are unusual, - // so we don't include them. We include all the typical - // 101, 105 key layout keys. - valid := map[Key]bool{ - KeyBackspace: true, - KeyTab: true, - KeyEscape: true, - KeyPause: true, - KeyPrint: true, - KeyPgUp: true, - KeyPgDn: true, - KeyEnter: true, - KeyEnd: true, - KeyHome: true, - KeyLeft: true, - KeyUp: true, - KeyRight: true, - KeyDown: true, - KeyInsert: true, - KeyDelete: true, - KeyF1: true, - KeyF2: true, - KeyF3: true, - KeyF4: true, - KeyF5: true, - KeyF6: true, - KeyF7: true, - KeyF8: true, - KeyF9: true, - KeyF10: true, - KeyF11: true, - KeyF12: true, - KeyRune: true, - } - - return valid[k] -} diff --git a/vendor/github.com/gdamore/tcell/doc.go b/vendor/github.com/gdamore/tcell/doc.go deleted file mode 100644 index b6719613..00000000 --- a/vendor/github.com/gdamore/tcell/doc.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package tcell provides a lower-level, portable API for building -// programs that interact with terminals or consoles. It works with -// both common (and many uncommon!) terminals or terminal emulators, -// and Windows console implementations. -// -// It provides support for up to 256 colors, text attributes, and box drawing -// elements. A database of terminals built from a real terminfo database -// is provided, along with code to generate new database entries. -// -// Tcell offers very rich support for mice, dependent upon the terminal -// of course. (Windows, XTerm, and iTerm 2 are known to work very well.) -// -// If the environment is not Unicode by default, such as an ISO8859 based -// locale or GB18030, Tcell can convert input and output, so that your -// terminal can operate in whatever locale is most convenient, while the -// application program can just assume "everything is UTF-8". Reasonable -// defaults are used for updating characters to something suitable for -// display. Unicode box drawing characters will be converted to use the -// alternate character set of your terminal, if native conversions are -// not available. If no ACS is available, then some ASCII fallbacks will -// be used. -// -// Note that support for non-UTF-8 locales (other than C) must be enabled -// by the application using RegisterEncoding() -- we don't have them all -// enabled by default to avoid bloating the application unneccessarily. -// (These days UTF-8 is good enough for almost everyone, and nobody should -// be using legacy locales anymore.) Also, actual glyphs for various code -// point will only be displayed if your terminal or emulator (or the font -// the emulator is using) supports them. -// -// A rich set of keycodes is supported, with support for up to 65 function -// keys, and various other special keys. -// -package tcell diff --git a/vendor/github.com/gdamore/tcell/encoding.go b/vendor/github.com/gdamore/tcell/encoding.go deleted file mode 100644 index 596a6e80..00000000 --- a/vendor/github.com/gdamore/tcell/encoding.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "strings" - "sync" - - "golang.org/x/text/encoding" - - gencoding "github.com/gdamore/encoding" -) - -var encodings map[string]encoding.Encoding -var encodingLk sync.Mutex -var encodingFallback EncodingFallback = EncodingFallbackFail - -// RegisterEncoding may be called by the application to register an encoding. -// The presence of additional encodings will facilitate application usage with -// terminal environments where the I/O subsystem does not support Unicode. -// -// Windows systems use Unicode natively, and do not need any of the encoding -// subsystem when using Windows Console screens. -// -// Please see the Go documentation for golang.org/x/text/encoding -- most of -// the common ones exist already as stock variables. For example, ISO8859-15 -// can be registered using the following code: -// -// import "golang.org/x/text/encoding/charmap" -// -// ... -// RegisterEncoding("ISO8859-15", charmap.ISO8859_15) -// -// Aliases can be registered as well, for example "8859-15" could be an alias -// for "ISO8859-15". -// -// For POSIX systems, the tcell package will check the environment variables -// LC_ALL, LC_CTYPE, and LANG (in that order) to determine the character set. -// These are expected to have the following pattern: -// -// $language[.$codeset[@$variant] -// -// We extract only the $codeset part, which will usually be something like -// UTF-8 or ISO8859-15 or KOI8-R. Note that if the locale is either "POSIX" -// or "C", then we assume US-ASCII (the POSIX 'portable character set' -// and assume all other characters are somehow invalid.) -// -// Modern POSIX systems and terminal emulators may use UTF-8, and for those -// systems, this API is also unnecessary. For example, Darwin (MacOS X) and -// modern Linux running modern xterm generally will out of the box without -// any of this. Use of UTF-8 is recommended when possible, as it saves -// quite a lot processing overhead. -// -// Note that some encodings are quite large (for example GB18030 which is a -// superset of Unicode) and so the application size can be expected ot -// increase quite a bit as each encoding is added. The East Asian encodings -// have been seen to add 100-200K per encoding to the application size. -// -func RegisterEncoding(charset string, enc encoding.Encoding) { - encodingLk.Lock() - charset = strings.ToLower(charset) - encodings[charset] = enc - encodingLk.Unlock() -} - -// EncodingFallback describes how the system behavees when the locale -// requires a character set that we do not support. The system always -// supports UTF-8 and US-ASCII. On Windows consoles, UTF-16LE is also -// supported automatically. Other character sets must be added using the -// RegisterEncoding API. (A large group of nearly all of them can be -// added using the RegisterAll function in the encoding sub package.) -type EncodingFallback int - -const ( - // EncodingFallbackFail behavior causes GetEncoding to fail - // when it cannot find an encoding. - EncodingFallbackFail = iota - - // EncodingFallbackASCII behaviore causes GetEncoding to fall back - // to a 7-bit ASCII encoding, if no other encoding can be found. - EncodingFallbackASCII - - // EncodingFallbackUTF8 behavior causes GetEncoding to assume - // UTF8 can pass unmodified upon failure. Note that this behavior - // is not recommended, unless you are sure your terminal can cope - // with real UTF8 sequences. - EncodingFallbackUTF8 -) - -// SetEncodingFallback changes the behavior of GetEncoding when a suitable -// encoding is not found. The default is EncodingFallbackFail, which -// causes GetEncoding to simply return nil. -func SetEncodingFallback(fb EncodingFallback) { - encodingLk.Lock() - encodingFallback = fb - encodingLk.Unlock() -} - -// GetEncoding is used by Screen implementors who want to locate an encoding -// for the given character set name. Note that this will return nil for -// either the Unicode (UTF-8) or ASCII encodings, since we don't use -// encodings for them but instead have our own native methods. -func GetEncoding(charset string) encoding.Encoding { - charset = strings.ToLower(charset) - encodingLk.Lock() - defer encodingLk.Unlock() - if enc, ok := encodings[charset]; ok { - return enc - } - switch encodingFallback { - case EncodingFallbackASCII: - return gencoding.ASCII - case EncodingFallbackUTF8: - return encoding.Nop - } - return nil -} - -func init() { - // We always support UTF-8 and ASCII. - encodings = make(map[string]encoding.Encoding) - encodings["utf-8"] = gencoding.UTF8 - encodings["utf8"] = gencoding.UTF8 - encodings["us-ascii"] = gencoding.ASCII - encodings["ascii"] = gencoding.ASCII - encodings["iso646"] = gencoding.ASCII -} diff --git a/vendor/github.com/gdamore/tcell/errors.go b/vendor/github.com/gdamore/tcell/errors.go deleted file mode 100644 index 920b64b2..00000000 --- a/vendor/github.com/gdamore/tcell/errors.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - "time" - - "github.com/gdamore/tcell/terminfo" -) - -var ( - // ErrTermNotFound indicates that a suitable terminal entry could - // not be found. This can result from either not having TERM set, - // or from the TERM failing to support certain minimal functionality, - // in particular absolute cursor addressability (the cup capability) - // is required. For example, legacy "adm3" lacks this capability, - // whereas the slightly newer "adm3a" supports it. This failure - // occurs most often with "dumb". - ErrTermNotFound = terminfo.ErrTermNotFound - - // ErrNoScreen indicates that no suitable screen could be found. - // This may result from attempting to run on a platform where there - // is no support for either termios or console I/O (such as nacl), - // or from running in an environment where there is no access to - // a suitable console/terminal device. (For example, running on - // without a controlling TTY or with no /dev/tty on POSIX platforms.) - ErrNoScreen = errors.New("no suitable screen available") - - // ErrNoCharset indicates that the locale environment the - // program is not supported by the program, because no suitable - // encoding was found for it. This problem never occurs if - // the environment is UTF-8 or UTF-16. - ErrNoCharset = errors.New("character set not supported") - - // ErrEventQFull indicates that the event queue is full, and - // cannot accept more events. - ErrEventQFull = errors.New("event queue full") -) - -// An EventError is an event representing some sort of error, and carries -// an error payload. -type EventError struct { - t time.Time - err error -} - -// When returns the time when the event was created. -func (ev *EventError) When() time.Time { - return ev.t -} - -// Error implements the error. -func (ev *EventError) Error() string { - return ev.err.Error() -} - -// NewEventError creates an ErrorEvent with the given error payload. -func NewEventError(err error) *EventError { - return &EventError{t: time.Now(), err: err} -} diff --git a/vendor/github.com/gdamore/tcell/event.go b/vendor/github.com/gdamore/tcell/event.go deleted file mode 100644 index a3b77006..00000000 --- a/vendor/github.com/gdamore/tcell/event.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// Event is a generic interface used for passing around Events. -// Concrete types follow. -type Event interface { - // When reports the time when the event was generated. - When() time.Time -} - -// EventTime is a simple base event class, suitable for easy reuse. -// It can be used to deliver actual timer events as well. -type EventTime struct { - when time.Time -} - -// When returns the time stamp when the event occurred. -func (e *EventTime) When() time.Time { - return e.when -} - -// SetEventTime sets the time of occurrence for the event. -func (e *EventTime) SetEventTime(t time.Time) { - e.when = t -} - -// SetEventNow sets the time of occurrence for the event to the current time. -func (e *EventTime) SetEventNow() { - e.SetEventTime(time.Now()) -} - -// EventHandler is anything that handles events. If the handler has -// consumed the event, it should return true. False otherwise. -type EventHandler interface { - HandleEvent(Event) bool -} diff --git a/vendor/github.com/gdamore/tcell/go.mod b/vendor/github.com/gdamore/tcell/go.mod deleted file mode 100644 index 7d403eba..00000000 --- a/vendor/github.com/gdamore/tcell/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/gdamore/tcell - -go 1.12 - -require ( - github.com/gdamore/encoding v1.0.0 - github.com/lucasb-eyer/go-colorful v1.0.2 - github.com/mattn/go-runewidth v0.0.4 - golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 - golang.org/x/text v0.3.0 -) diff --git a/vendor/github.com/gdamore/tcell/go.sum b/vendor/github.com/gdamore/tcell/go.sum deleted file mode 100644 index ff470da8..00000000 --- a/vendor/github.com/gdamore/tcell/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/lucasb-eyer/go-colorful v1.0.2 h1:mCMFu6PgSozg9tDNMMK3g18oJBX7oYGrC09mS6CXfO4= -github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/vendor/github.com/gdamore/tcell/interrupt.go b/vendor/github.com/gdamore/tcell/interrupt.go deleted file mode 100644 index 70dddfce..00000000 --- a/vendor/github.com/gdamore/tcell/interrupt.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventInterrupt is a generic wakeup event. Its can be used to -// to request a redraw. It can carry an arbitrary payload, as well. -type EventInterrupt struct { - t time.Time - v interface{} -} - -// When returns the time when this event was created. -func (ev *EventInterrupt) When() time.Time { - return ev.t -} - -// Data is used to obtain the opaque event payload. -func (ev *EventInterrupt) Data() interface{} { - return ev.v -} - -// NewEventInterrupt creates an EventInterrupt with the given payload. -func NewEventInterrupt(data interface{}) *EventInterrupt { - return &EventInterrupt{t: time.Now(), v: data} -} diff --git a/vendor/github.com/gdamore/tcell/key.go b/vendor/github.com/gdamore/tcell/key.go deleted file mode 100644 index 3545215a..00000000 --- a/vendor/github.com/gdamore/tcell/key.go +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "fmt" - "strings" - "time" -) - -// EventKey represents a key press. Usually this is a key press followed -// by a key release, but since terminal programs don't have a way to report -// key release events, we usually get just one event. If a key is held down -// then the terminal may synthesize repeated key presses at some predefined -// rate. We have no control over that, nor visibility into it. -// -// In some cases, we can have a modifier key, such as ModAlt, that can be -// generated with a key press. (This usually is represented by having the -// high bit set, or in some cases, by sending an ESC prior to the rune.) -// -// If the value of Key() is KeyRune, then the actual key value will be -// available with the Rune() method. This will be the case for most keys. -// In most situations, the modifiers will not be set. For example, if the -// rune is 'A', this will be reported without the ModShift bit set, since -// really can't tell if the Shift key was pressed (it might have been CAPSLOCK, -// or a terminal that only can send capitals, or keyboard with separate -// capital letters from lower case letters). -// -// Generally, terminal applications have far less visibility into keyboard -// activity than graphical applications. Hence, they should avoid depending -// overly much on availability of modifiers, or the availability of any -// specific keys. -type EventKey struct { - t time.Time - mod ModMask - key Key - ch rune -} - -// When returns the time when this Event was created, which should closely -// match the time when the key was pressed. -func (ev *EventKey) When() time.Time { - return ev.t -} - -// Rune returns the rune corresponding to the key press, if it makes sense. -// The result is only defined if the value of Key() is KeyRune. -func (ev *EventKey) Rune() rune { - return ev.ch -} - -// Key returns a virtual key code. We use this to identify specific key -// codes, such as KeyEnter, etc. Most control and function keys are reported -// with unique Key values. Normal alphanumeric and punctuation keys will -// generally return KeyRune here; the specific key can be further decoded -// using the Rune() function. -func (ev *EventKey) Key() Key { - return ev.key -} - -// Modifiers returns the modifiers that were present with the key press. Note -// that not all platforms and terminals support this equally well, and some -// cases we will not not know for sure. Hence, applications should avoid -// using this in most circumstances. -func (ev *EventKey) Modifiers() ModMask { - return ev.mod -} - -// KeyNames holds the written names of special keys. Useful to echo back a key -// name, or to look up a key from a string value. -var KeyNames = map[Key]string{ - KeyEnter: "Enter", - KeyBackspace: "Backspace", - KeyTab: "Tab", - KeyBacktab: "Backtab", - KeyEsc: "Esc", - KeyBackspace2: "Backspace2", - KeyDelete: "Delete", - KeyInsert: "Insert", - KeyUp: "Up", - KeyDown: "Down", - KeyLeft: "Left", - KeyRight: "Right", - KeyHome: "Home", - KeyEnd: "End", - KeyUpLeft: "UpLeft", - KeyUpRight: "UpRight", - KeyDownLeft: "DownLeft", - KeyDownRight: "DownRight", - KeyCenter: "Center", - KeyPgDn: "PgDn", - KeyPgUp: "PgUp", - KeyClear: "Clear", - KeyExit: "Exit", - KeyCancel: "Cancel", - KeyPause: "Pause", - KeyPrint: "Print", - KeyF1: "F1", - KeyF2: "F2", - KeyF3: "F3", - KeyF4: "F4", - KeyF5: "F5", - KeyF6: "F6", - KeyF7: "F7", - KeyF8: "F8", - KeyF9: "F9", - KeyF10: "F10", - KeyF11: "F11", - KeyF12: "F12", - KeyF13: "F13", - KeyF14: "F14", - KeyF15: "F15", - KeyF16: "F16", - KeyF17: "F17", - KeyF18: "F18", - KeyF19: "F19", - KeyF20: "F20", - KeyF21: "F21", - KeyF22: "F22", - KeyF23: "F23", - KeyF24: "F24", - KeyF25: "F25", - KeyF26: "F26", - KeyF27: "F27", - KeyF28: "F28", - KeyF29: "F29", - KeyF30: "F30", - KeyF31: "F31", - KeyF32: "F32", - KeyF33: "F33", - KeyF34: "F34", - KeyF35: "F35", - KeyF36: "F36", - KeyF37: "F37", - KeyF38: "F38", - KeyF39: "F39", - KeyF40: "F40", - KeyF41: "F41", - KeyF42: "F42", - KeyF43: "F43", - KeyF44: "F44", - KeyF45: "F45", - KeyF46: "F46", - KeyF47: "F47", - KeyF48: "F48", - KeyF49: "F49", - KeyF50: "F50", - KeyF51: "F51", - KeyF52: "F52", - KeyF53: "F53", - KeyF54: "F54", - KeyF55: "F55", - KeyF56: "F56", - KeyF57: "F57", - KeyF58: "F58", - KeyF59: "F59", - KeyF60: "F60", - KeyF61: "F61", - KeyF62: "F62", - KeyF63: "F63", - KeyF64: "F64", - KeyCtrlA: "Ctrl-A", - KeyCtrlB: "Ctrl-B", - KeyCtrlC: "Ctrl-C", - KeyCtrlD: "Ctrl-D", - KeyCtrlE: "Ctrl-E", - KeyCtrlF: "Ctrl-F", - KeyCtrlG: "Ctrl-G", - KeyCtrlJ: "Ctrl-J", - KeyCtrlK: "Ctrl-K", - KeyCtrlL: "Ctrl-L", - KeyCtrlN: "Ctrl-N", - KeyCtrlO: "Ctrl-O", - KeyCtrlP: "Ctrl-P", - KeyCtrlQ: "Ctrl-Q", - KeyCtrlR: "Ctrl-R", - KeyCtrlS: "Ctrl-S", - KeyCtrlT: "Ctrl-T", - KeyCtrlU: "Ctrl-U", - KeyCtrlV: "Ctrl-V", - KeyCtrlW: "Ctrl-W", - KeyCtrlX: "Ctrl-X", - KeyCtrlY: "Ctrl-Y", - KeyCtrlZ: "Ctrl-Z", - KeyCtrlSpace: "Ctrl-Space", - KeyCtrlUnderscore: "Ctrl-_", - KeyCtrlRightSq: "Ctrl-]", - KeyCtrlBackslash: "Ctrl-\\", - KeyCtrlCarat: "Ctrl-^", -} - -// Name returns a printable value or the key stroke. This can be used -// when printing the event, for example. -func (ev *EventKey) Name() string { - s := "" - m := []string{} - if ev.mod&ModShift != 0 { - m = append(m, "Shift") - } - if ev.mod&ModAlt != 0 { - m = append(m, "Alt") - } - if ev.mod&ModMeta != 0 { - m = append(m, "Meta") - } - if ev.mod&ModCtrl != 0 { - m = append(m, "Ctrl") - } - - ok := false - if s, ok = KeyNames[ev.key]; !ok { - if ev.key == KeyRune { - s = "Rune[" + string(ev.ch) + "]" - } else { - s = fmt.Sprintf("Key[%d,%d]", ev.key, int(ev.ch)) - } - } - if len(m) != 0 { - if ev.mod&ModCtrl != 0 && strings.HasPrefix(s, "Ctrl-") { - s = s[5:] - } - return fmt.Sprintf("%s+%s", strings.Join(m, "+"), s) - } - return s -} - -// NewEventKey attempts to create a suitable event. It parses the various -// ASCII control sequences if KeyRune is passed for Key, but if the caller -// has more precise information it should set that specifically. Callers -// that aren't sure about modifier state (most) should just pass ModNone. -func NewEventKey(k Key, ch rune, mod ModMask) *EventKey { - if k == KeyRune && (ch < ' ' || ch == 0x7f) { - // Turn specials into proper key codes. This is for - // control characters and the DEL. - k = Key(ch) - if mod == ModNone && ch < ' ' { - switch Key(ch) { - case KeyBackspace, KeyTab, KeyEsc, KeyEnter: - // these keys are directly typeable without CTRL - default: - // most likely entered with a CTRL keypress - mod = ModCtrl - } - } - } - return &EventKey{t: time.Now(), key: k, ch: ch, mod: mod} -} - -// ModMask is a mask of modifier keys. Note that it will not always be -// possible to report modifier keys. -type ModMask int16 - -// These are the modifiers keys that can be sent either with a key press, -// or a mouse event. Note that as of now, due to the confusion associated -// with Meta, and the lack of support for it on many/most platforms, the -// current implementations never use it. Instead, they use ModAlt, even for -// events that could possibly have been distinguished from ModAlt. -const ( - ModShift ModMask = 1 << iota - ModCtrl - ModAlt - ModMeta - ModNone ModMask = 0 -) - -// Key is a generic value for representing keys, and especially special -// keys (function keys, cursor movement keys, etc.) For normal keys, like -// ASCII letters, we use KeyRune, and then expect the application to -// inspect the Rune() member of the EventKey. -type Key int16 - -// This is the list of named keys. KeyRune is special however, in that it is -// a place holder key indicating that a printable character was sent. The -// actual value of the rune will be transported in the Rune of the associated -// EventKey. -const ( - KeyRune Key = iota + 256 - KeyUp - KeyDown - KeyRight - KeyLeft - KeyUpLeft - KeyUpRight - KeyDownLeft - KeyDownRight - KeyCenter - KeyPgUp - KeyPgDn - KeyHome - KeyEnd - KeyInsert - KeyDelete - KeyHelp - KeyExit - KeyClear - KeyCancel - KeyPrint - KeyPause - KeyBacktab - KeyF1 - KeyF2 - KeyF3 - KeyF4 - KeyF5 - KeyF6 - KeyF7 - KeyF8 - KeyF9 - KeyF10 - KeyF11 - KeyF12 - KeyF13 - KeyF14 - KeyF15 - KeyF16 - KeyF17 - KeyF18 - KeyF19 - KeyF20 - KeyF21 - KeyF22 - KeyF23 - KeyF24 - KeyF25 - KeyF26 - KeyF27 - KeyF28 - KeyF29 - KeyF30 - KeyF31 - KeyF32 - KeyF33 - KeyF34 - KeyF35 - KeyF36 - KeyF37 - KeyF38 - KeyF39 - KeyF40 - KeyF41 - KeyF42 - KeyF43 - KeyF44 - KeyF45 - KeyF46 - KeyF47 - KeyF48 - KeyF49 - KeyF50 - KeyF51 - KeyF52 - KeyF53 - KeyF54 - KeyF55 - KeyF56 - KeyF57 - KeyF58 - KeyF59 - KeyF60 - KeyF61 - KeyF62 - KeyF63 - KeyF64 -) - -// These are the control keys. Note that they overlap with other keys, -// perhaps. For example, KeyCtrlH is the same as KeyBackspace. -const ( - KeyCtrlSpace Key = iota - KeyCtrlA - KeyCtrlB - KeyCtrlC - KeyCtrlD - KeyCtrlE - KeyCtrlF - KeyCtrlG - KeyCtrlH - KeyCtrlI - KeyCtrlJ - KeyCtrlK - KeyCtrlL - KeyCtrlM - KeyCtrlN - KeyCtrlO - KeyCtrlP - KeyCtrlQ - KeyCtrlR - KeyCtrlS - KeyCtrlT - KeyCtrlU - KeyCtrlV - KeyCtrlW - KeyCtrlX - KeyCtrlY - KeyCtrlZ - KeyCtrlLeftSq // Escape - KeyCtrlBackslash - KeyCtrlRightSq - KeyCtrlCarat - KeyCtrlUnderscore -) - -// Special values - these are fixed in an attempt to make it more likely -// that aliases will encode the same way. - -// These are the defined ASCII values for key codes. They generally match -// with KeyCtrl values. -const ( - KeyNUL Key = iota - KeySOH - KeySTX - KeyETX - KeyEOT - KeyENQ - KeyACK - KeyBEL - KeyBS - KeyTAB - KeyLF - KeyVT - KeyFF - KeyCR - KeySO - KeySI - KeyDLE - KeyDC1 - KeyDC2 - KeyDC3 - KeyDC4 - KeyNAK - KeySYN - KeyETB - KeyCAN - KeyEM - KeySUB - KeyESC - KeyFS - KeyGS - KeyRS - KeyUS - KeyDEL Key = 0x7F -) - -// These keys are aliases for other names. -const ( - KeyBackspace = KeyBS - KeyTab = KeyTAB - KeyEsc = KeyESC - KeyEscape = KeyESC - KeyEnter = KeyCR - KeyBackspace2 = KeyDEL -) diff --git a/vendor/github.com/gdamore/tcell/mouse.go b/vendor/github.com/gdamore/tcell/mouse.go deleted file mode 100644 index 8c51c98e..00000000 --- a/vendor/github.com/gdamore/tcell/mouse.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventMouse is a mouse event. It is sent on either mouse up or mouse down -// events. It is also sent on mouse motion events - if the terminal supports -// it. We make every effort to ensure that mouse release events are delivered. -// Hence, click drag can be identified by a motion event with the mouse down, -// without any intervening button release. On some terminals only the initiating -// press and terminating release event will be delivered. -// -// Mouse wheel events, when reported, may appear on their own as individual -// impulses; that is, there will normally not be a release event delivered -// for mouse wheel movements. -// -// Most terminals cannot report the state of more than one button at a time -- -// and some cannot report motion events unless a button is pressed. -// -// Applications can inspect the time between events to resolve double or -// triple clicks. -type EventMouse struct { - t time.Time - btn ButtonMask - mod ModMask - x int - y int -} - -// When returns the time when this EventMouse was created. -func (ev *EventMouse) When() time.Time { - return ev.t -} - -// Buttons returns the list of buttons that were pressed or wheel motions. -func (ev *EventMouse) Buttons() ButtonMask { - return ev.btn -} - -// Modifiers returns a list of keyboard modifiers that were pressed -// with the mouse button(s). -func (ev *EventMouse) Modifiers() ModMask { - return ev.mod -} - -// Position returns the mouse position in character cells. The origin -// 0, 0 is at the upper left corner. -func (ev *EventMouse) Position() (int, int) { - return ev.x, ev.y -} - -// NewEventMouse is used to create a new mouse event. Applications -// shouldn't need to use this; its mostly for screen implementors. -func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse { - return &EventMouse{t: time.Now(), x: x, y: y, btn: btn, mod: mod} -} - -// ButtonMask is a mask of mouse buttons and wheel events. Mouse button presses -// are normally delivered as both press and release events. Mouse wheel events -// are normally just single impulse events. Windows supports up to eight -// separate buttons plus all four wheel directions, but XTerm can only support -// mouse buttons 1-3 and wheel up/down. Its not unheard of for terminals -// to support only one or two buttons (think Macs). Old terminals, and true -// emulations (such as vt100) won't support mice at all, of course. -type ButtonMask int16 - -// These are the actual button values. -const ( - Button1 ButtonMask = 1 << iota // Usually left mouse button. - Button2 // Usually the middle mouse button. - Button3 // Usually the right mouse button. - Button4 // Often a side button (thumb/next). - Button5 // Often a side button (thumb/prev). - Button6 - Button7 - Button8 - WheelUp // Wheel motion up/away from user. - WheelDown // Wheel motion down/towards user. - WheelLeft // Wheel motion to left. - WheelRight // Wheel motion to right. - ButtonNone ButtonMask = 0 // No button or wheel events. -) diff --git a/vendor/github.com/gdamore/tcell/resize.go b/vendor/github.com/gdamore/tcell/resize.go deleted file mode 100644 index 0385673c..00000000 --- a/vendor/github.com/gdamore/tcell/resize.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "time" -) - -// EventResize is sent when the window size changes. -type EventResize struct { - t time.Time - w int - h int -} - -// NewEventResize creates an EventResize with the new updated window size, -// which is given in character cells. -func NewEventResize(width, height int) *EventResize { - return &EventResize{t: time.Now(), w: width, h: height} -} - -// When returns the time when the Event was created. -func (ev *EventResize) When() time.Time { - return ev.t -} - -// Size returns the new window size as width, height in character cells. -func (ev *EventResize) Size() (int, int) { - return ev.w, ev.h -} diff --git a/vendor/github.com/gdamore/tcell/runes.go b/vendor/github.com/gdamore/tcell/runes.go deleted file mode 100644 index ed9c63b5..00000000 --- a/vendor/github.com/gdamore/tcell/runes.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// The names of these constants are chosen to match Terminfo names, -// modulo case, and changing the prefix from ACS_ to Rune. These are -// the runes we provide extra special handling for, with ASCII fallbacks -// for terminals that lack them. -const ( - RuneSterling = '£' - RuneDArrow = '↓' - RuneLArrow = '←' - RuneRArrow = '→' - RuneUArrow = '↑' - RuneBullet = '·' - RuneBoard = '░' - RuneCkBoard = '▒' - RuneDegree = '°' - RuneDiamond = '◆' - RuneGEqual = '≥' - RunePi = 'π' - RuneHLine = '─' - RuneLantern = '§' - RunePlus = '┼' - RuneLEqual = '≤' - RuneLLCorner = '└' - RuneLRCorner = '┘' - RuneNEqual = '≠' - RunePlMinus = '±' - RuneS1 = '⎺' - RuneS3 = '⎻' - RuneS7 = '⎼' - RuneS9 = '⎽' - RuneBlock = '█' - RuneTTee = '┬' - RuneRTee = '┤' - RuneLTee = '├' - RuneBTee = '┴' - RuneULCorner = '┌' - RuneURCorner = '┐' - RuneVLine = '│' -) - -// RuneFallbacks is the default map of fallback strings that will be -// used to replace a rune when no other more appropriate transformation -// is available, and the rune cannot be displayed directly. -// -// New entries may be added to this map over time, as it becomes clear -// that such is desirable. Characters that represent either letters or -// numbers should not be added to this list unless it is certain that -// the meaning will still convey unambiguously. -// -// As an example, it would be appropriate to add an ASCII mapping for -// the full width form of the letter 'A', but it would not be appropriate -// to do so a glyph representing the country China. -// -// Programs that desire richer fallbacks may register additional ones, -// or change or even remove these mappings with Screen.RegisterRuneFallback -// Screen.UnregisterRuneFallback methods. -// -// Note that Unicode is presumed to be able to display all glyphs. -// This is a pretty poor assumption, but there is no easy way to -// figure out which glyphs are supported in a given font. Hence, -// some care in selecting the characters you support in your application -// is still appropriate. -var RuneFallbacks = map[rune]string{ - RuneSterling: "f", - RuneDArrow: "v", - RuneLArrow: "<", - RuneRArrow: ">", - RuneUArrow: "^", - RuneBullet: "o", - RuneBoard: "#", - RuneCkBoard: ":", - RuneDegree: "\\", - RuneDiamond: "+", - RuneGEqual: ">", - RunePi: "*", - RuneHLine: "-", - RuneLantern: "#", - RunePlus: "+", - RuneLEqual: "<", - RuneLLCorner: "+", - RuneLRCorner: "+", - RuneNEqual: "!", - RunePlMinus: "#", - RuneS1: "~", - RuneS3: "-", - RuneS7: "-", - RuneS9: "_", - RuneBlock: "#", - RuneTTee: "+", - RuneRTee: "+", - RuneLTee: "+", - RuneBTee: "+", - RuneULCorner: "+", - RuneURCorner: "+", - RuneVLine: "|", -} diff --git a/vendor/github.com/gdamore/tcell/screen.go b/vendor/github.com/gdamore/tcell/screen.go deleted file mode 100644 index 99816a01..00000000 --- a/vendor/github.com/gdamore/tcell/screen.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// Screen represents the physical (or emulated) screen. -// This can be a terminal window or a physical console. Platforms implement -// this differerently. -type Screen interface { - // Init initializes the screen for use. - Init() error - - // Fini finalizes the screen also releasing resources. - Fini() - - // Clear erases the screen. The contents of any screen buffers - // will also be cleared. This has the logical effect of - // filling the screen with spaces, using the global default style. - Clear() - - // Fill fills the screen with the given character and style. - Fill(rune, Style) - - // SetCell is an older API, and will be removed. Please use - // SetContent instead; SetCell is implemented in terms of SetContent. - SetCell(x int, y int, style Style, ch ...rune) - - // GetContent returns the contents at the given location. If the - // coordinates are out of range, then the values will be 0, nil, - // StyleDefault. Note that the contents returned are logical contents - // and may not actually be what is displayed, but rather are what will - // be displayed if Show() or Sync() is called. The width is the width - // in screen cells; most often this will be 1, but some East Asian - // characters require two cells. - GetContent(x, y int) (mainc rune, combc []rune, style Style, width int) - - // SetContent sets the contents of the given cell location. If - // the coordinates are out of range, then the operation is ignored. - // - // The first rune is the primary non-zero width rune. The array - // that follows is a possible list of combining characters to append, - // and will usually be nil (no combining characters.) - // - // The results are not displayd until Show() or Sync() is called. - // - // Note that wide (East Asian full width) runes occupy two cells, - // and attempts to place character at next cell to the right will have - // undefined effects. Wide runes that are printed in the - // last column will be replaced with a single width space on output. - SetContent(x int, y int, mainc rune, combc []rune, style Style) - - // SetStyle sets the default style to use when clearing the screen - // or when StyleDefault is specified. If it is also StyleDefault, - // then whatever system/terminal default is relevant will be used. - SetStyle(style Style) - - // ShowCursor is used to display the cursor at a given location. - // If the coordinates -1, -1 are given or are otherwise outside the - // dimensions of the screen, the cursor will be hidden. - ShowCursor(x int, y int) - - // HideCursor is used to hide the cursor. Its an alias for - // ShowCursor(-1, -1). - HideCursor() - - // Size returns the screen size as width, height. This changes in - // response to a call to Clear or Flush. - Size() (int, int) - - // PollEvent waits for events to arrive. Main application loops - // must spin on this to prevent the application from stalling. - // Furthermore, this will return nil if the Screen is finalized. - PollEvent() Event - - // PostEvent tries to post an event into the event stream. This - // can fail if the event queue is full. In that case, the event - // is dropped, and ErrEventQFull is returned. - PostEvent(ev Event) error - - // PostEventWait is like PostEvent, but if the queue is full, it - // blocks until there is space in the queue, making delivery - // reliable. However, it is VERY important that this function - // never be called from within whatever event loop is polling - // with PollEvent(), otherwise a deadlock may arise. - // - // For this reason, when using this function, the use of a - // Goroutine is recommended to ensure no deadlock can occur. - PostEventWait(ev Event) - - // EnableMouse enables the mouse. (If your terminal supports it.) - EnableMouse() - - // DisableMouse disables the mouse. - DisableMouse() - - // HasMouse returns true if the terminal (apparently) supports a - // mouse. Note that the a return value of true doesn't guarantee that - // a mouse/pointing device is present; a false return definitely - // indicates no mouse support is available. - HasMouse() bool - - // Colors returns the number of colors. All colors are assumed to - // use the ANSI color map. If a terminal is monochrome, it will - // return 0. - Colors() int - - // Show makes all the content changes made using SetContent() visible - // on the display. - // - // It does so in the most efficient and least visually disruptive - // manner possible. - Show() - - // Sync works like Show(), but it updates every visible cell on the - // physical display, assuming that it is not synchronized with any - // internal model. This may be both expensive and visually jarring, - // so it should only be used when believed to actually be necessary. - // - // Typically this is called as a result of a user-requested redraw - // (e.g. to clear up on screen corruption caused by some other program), - // or during a resize event. - Sync() - - // CharacterSet returns information about the character set. - // This isn't the full locale, but it does give us the input/output - // character set. Note that this is just for diagnostic purposes, - // we normally translate input/output to/from UTF-8, regardless of - // what the user's environment is. - CharacterSet() string - - // RegisterRuneFallback adds a fallback for runes that are not - // part of the character set -- for example one coudld register - // o as a fallback for ø. This should be done cautiously for - // characters that might be displayed ordinarily in language - // specific text -- characters that could change the meaning of - // of written text would be dangerous. The intention here is to - // facilitate fallback characters in pseudo-graphical applications. - // - // If the terminal has fallbacks already in place via an alternate - // character set, those are used in preference. Also, standard - // fallbacks for graphical characters in the ACSC terminfo string - // are registered implicitly. - - // The display string should be the same width as original rune. - // This makes it possible to register two character replacements - // for full width East Asian characters, for example. - // - // It is recommended that replacement strings consist only of - // 7-bit ASCII, since other characters may not display everywhere. - RegisterRuneFallback(r rune, subst string) - - // UnregisterRuneFallback unmaps a replacement. It will unmap - // the implicit ASCII replacements for alternate characters as well. - // When an unmapped char needs to be displayed, but no suitable - // glyph is available, '?' is emitted instead. It is not possible - // to "disable" the use of alternate characters that are supported - // by your terminal except by changing the terminal database. - UnregisterRuneFallback(r rune) - - // CanDisplay returns true if the given rune can be displayed on - // this screen. Note that this is a best guess effort -- whether - // your fonts support the character or not may be questionable. - // Mostly this is for folks who work outside of Unicode. - // - // If checkFallbacks is true, then if any (possibly imperfect) - // fallbacks are registered, this will return true. This will - // also return true if the terminal can replace the glyph with - // one that is visually indistinguishable from the one requested. - CanDisplay(r rune, checkFallbacks bool) bool - - // Resize does nothing, since its generally not possible to - // ask a screen to resize, but it allows the Screen to implement - // the View interface. - Resize(int, int, int, int) - - // HasKey returns true if the keyboard is believed to have the - // key. In some cases a keyboard may have keys with this name - // but no support for them, while in others a key may be reported - // as supported but not actually be usable (such as some emulators - // that hijack certain keys). Its best not to depend to strictly - // on this function, but it can be used for hinting when building - // menus, displayed hot-keys, etc. Note that KeyRune (literal - // runes) is always true. - HasKey(Key) bool -} - -// NewScreen returns a default Screen suitable for the user's terminal -// environment. -func NewScreen() (Screen, error) { - // Windows is happier if we try for a console screen first. - if s, _ := NewConsoleScreen(); s != nil { - return s, nil - } else if s, e := NewTerminfoScreen(); s != nil { - return s, nil - } else { - return nil, e - } -} diff --git a/vendor/github.com/gdamore/tcell/simulation.go b/vendor/github.com/gdamore/tcell/simulation.go deleted file mode 100644 index 850a7b3d..00000000 --- a/vendor/github.com/gdamore/tcell/simulation.go +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright 2016 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "sync" - "unicode/utf8" - - "golang.org/x/text/transform" -) - -// NewSimulationScreen returns a SimulationScreen. Note that -// SimulationScreen is also a Screen. -func NewSimulationScreen(charset string) SimulationScreen { - if charset == "" { - charset = "UTF-8" - } - s := &simscreen{charset: charset} - return s -} - -// SimulationScreen represents a screen simulation. This is intended to -// be a superset of normal Screens, but also adds some important interfaces -// for testing. -type SimulationScreen interface { - // InjectKeyBytes injects a stream of bytes corresponding to - // the native encoding (see charset). It turns true if the entire - // set of bytes were processed and delivered as KeyEvents, false - // if any bytes were not fully understood. Any bytes that are not - // fully converted are discarded. - InjectKeyBytes(buf []byte) bool - - // InjectKey injects a key event. The rune is a UTF-8 rune, post - // any translation. - InjectKey(key Key, r rune, mod ModMask) - - // InjectMouse injects a mouse event. - InjectMouse(x, y int, buttons ButtonMask, mod ModMask) - - // SetSize resizes the underlying physical screen. It also causes - // a resize event to be injected during the next Show() or Sync(). - // A new physical contents array will be allocated (with data from - // the old copied), so any prior value obtained with GetContents - // won't be used anymore - SetSize(width, height int) - - // GetContents returns screen contents as an array of - // cells, along with the physical width & height. Note that the - // physical contents will be used until the next time SetSize() - // is called. - GetContents() (cells []SimCell, width int, height int) - - // GetCursor returns the cursor details. - GetCursor() (x int, y int, visible bool) - - Screen -} - -// SimCell represents a simulated screen cell. The purpose of this -// is to track on screen content. -type SimCell struct { - // Bytes is the actual character bytes. Normally this is - // rune data, but it could be be data in another encoding system. - Bytes []byte - - // Style is the style used to display the data. - Style Style - - // Runes is the list of runes, unadulterated, in UTF-8. - Runes []rune -} - -type simscreen struct { - physw int - physh int - fini bool - style Style - evch chan Event - quit chan struct{} - - front []SimCell - back CellBuffer - clear bool - cursorx int - cursory int - cursorvis bool - mouse bool - charset string - encoder transform.Transformer - decoder transform.Transformer - fillchar rune - fillstyle Style - fallback map[rune]string - - sync.Mutex -} - -func (s *simscreen) Init() error { - s.evch = make(chan Event, 10) - s.quit = make(chan struct{}) - s.fillchar = 'X' - s.fillstyle = StyleDefault - s.mouse = false - s.physw = 80 - s.physh = 25 - s.cursorx = -1 - s.cursory = -1 - s.style = StyleDefault - - if enc := GetEncoding(s.charset); enc != nil { - s.encoder = enc.NewEncoder() - s.decoder = enc.NewDecoder() - } else { - return ErrNoCharset - } - - s.front = make([]SimCell, s.physw*s.physh) - s.back.Resize(80, 25) - - // default fallbacks - s.fallback = make(map[rune]string) - for k, v := range RuneFallbacks { - s.fallback[k] = v - } - return nil -} - -func (s *simscreen) Fini() { - s.Lock() - s.fini = true - s.back.Resize(0, 0) - s.Unlock() - if s.quit != nil { - close(s.quit) - } - s.physw = 0 - s.physh = 0 - s.front = nil -} - -func (s *simscreen) SetStyle(style Style) { - s.Lock() - s.style = style - s.Unlock() -} - -func (s *simscreen) Clear() { - s.Fill(' ', s.style) -} - -func (s *simscreen) Fill(r rune, style Style) { - s.Lock() - s.back.Fill(r, style) - s.Unlock() -} - -func (s *simscreen) SetCell(x, y int, style Style, ch ...rune) { - - if len(ch) > 0 { - s.SetContent(x, y, ch[0], ch[1:], style) - } else { - s.SetContent(x, y, ' ', nil, style) - } -} - -func (s *simscreen) SetContent(x, y int, mainc rune, combc []rune, st Style) { - - s.Lock() - s.back.SetContent(x, y, mainc, combc, st) - s.Unlock() -} - -func (s *simscreen) GetContent(x, y int) (rune, []rune, Style, int) { - var mainc rune - var combc []rune - var style Style - var width int - s.Lock() - mainc, combc, style, width = s.back.GetContent(x, y) - s.Unlock() - return mainc, combc, style, width -} - -func (s *simscreen) drawCell(x, y int) int { - - mainc, combc, style, width := s.back.GetContent(x, y) - if !s.back.Dirty(x, y) { - return width - } - if x >= s.physw || y >= s.physh || x < 0 || y < 0 { - return width - } - simc := &s.front[(y*s.physw)+x] - - if style == StyleDefault { - style = s.style - } - simc.Style = style - simc.Runes = append([]rune{mainc}, combc...) - - // now emit runes - taking care to not overrun width with a - // wide character, and to ensure that we emit exactly one regular - // character followed up by any residual combing characters - - simc.Bytes = nil - - if x > s.physw-width { - simc.Runes = []rune{' '} - simc.Bytes = []byte{' '} - return width - } - - lbuf := make([]byte, 12) - ubuf := make([]byte, 12) - nout := 0 - - for _, r := range simc.Runes { - - l := utf8.EncodeRune(ubuf, r) - - nout, _, _ = s.encoder.Transform(lbuf, ubuf[:l], true) - - if nout == 0 || lbuf[0] == '\x1a' { - - // skip combining - - if subst, ok := s.fallback[r]; ok { - simc.Bytes = append(simc.Bytes, - []byte(subst)...) - - } else if r >= ' ' && r <= '~' { - simc.Bytes = append(simc.Bytes, byte(r)) - - } else if simc.Bytes == nil { - simc.Bytes = append(simc.Bytes, '?') - } - } else { - simc.Bytes = append(simc.Bytes, lbuf[:nout]...) - } - } - s.back.SetDirty(x, y, false) - return width -} - -func (s *simscreen) ShowCursor(x, y int) { - s.Lock() - s.cursorx, s.cursory = x, y - s.showCursor() - s.Unlock() -} - -func (s *simscreen) HideCursor() { - s.ShowCursor(-1, -1) -} - -func (s *simscreen) showCursor() { - - x, y := s.cursorx, s.cursory - if x < 0 || y < 0 || x >= s.physw || y >= s.physh { - s.cursorvis = false - } else { - s.cursorvis = true - } -} - -func (s *simscreen) hideCursor() { - // does not update cursor position - s.cursorvis = false -} - -func (s *simscreen) Show() { - s.Lock() - s.resize() - s.draw() - s.Unlock() -} - -func (s *simscreen) clearScreen() { - // We emulate a hardware clear by filling with a specific pattern - for i := range s.front { - s.front[i].Style = s.fillstyle - s.front[i].Runes = []rune{s.fillchar} - s.front[i].Bytes = []byte{byte(s.fillchar)} - } - s.clear = false -} - -func (s *simscreen) draw() { - s.hideCursor() - if s.clear { - s.clearScreen() - } - - w, h := s.back.Size() - for y := 0; y < h; y++ { - for x := 0; x < w; x++ { - width := s.drawCell(x, y) - x += width - 1 - } - } - s.showCursor() -} - -func (s *simscreen) EnableMouse() { - s.mouse = true -} - -func (s *simscreen) DisableMouse() { - s.mouse = false -} - -func (s *simscreen) Size() (int, int) { - s.Lock() - w, h := s.back.Size() - s.Unlock() - return w, h -} - -func (s *simscreen) resize() { - w, h := s.physw, s.physh - ow, oh := s.back.Size() - if w != ow || h != oh { - s.back.Resize(w, h) - ev := NewEventResize(w, h) - s.PostEvent(ev) - } -} - -func (s *simscreen) Colors() int { - return 256 -} - -func (s *simscreen) PollEvent() Event { - select { - case <-s.quit: - return nil - case ev := <-s.evch: - return ev - } -} - -func (s *simscreen) PostEventWait(ev Event) { - s.evch <- ev -} - -func (s *simscreen) PostEvent(ev Event) error { - select { - case s.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (s *simscreen) InjectMouse(x, y int, buttons ButtonMask, mod ModMask) { - ev := NewEventMouse(x, y, buttons, mod) - s.PostEvent(ev) -} - -func (s *simscreen) InjectKey(key Key, r rune, mod ModMask) { - ev := NewEventKey(key, r, mod) - s.PostEvent(ev) -} - -func (s *simscreen) InjectKeyBytes(b []byte) bool { - failed := false - -outer: - for len(b) > 0 { - if b[0] >= ' ' && b[0] <= 0x7F { - // printable ASCII easy to deal with -- no encodings - ev := NewEventKey(KeyRune, rune(b[0]), ModNone) - s.PostEvent(ev) - b = b[1:] - continue - } - - if b[0] < 0x80 { - mod := ModNone - // No encodings start with low numbered values - if Key(b[0]) >= KeyCtrlA && Key(b[0]) <= KeyCtrlZ { - mod = ModCtrl - } - ev := NewEventKey(Key(b[0]), 0, mod) - s.PostEvent(ev) - continue - } - - utfb := make([]byte, len(b)*4) // worst case - for l := 1; l < len(b); l++ { - s.decoder.Reset() - nout, nin, _ := s.decoder.Transform(utfb, b[:l], true) - - if nout != 0 { - r, _ := utf8.DecodeRune(utfb[:nout]) - if r != utf8.RuneError { - ev := NewEventKey(KeyRune, r, ModNone) - s.PostEvent(ev) - } - b = b[nin:] - continue outer - } - } - failed = true - b = b[1:] - continue - } - - return !failed -} - -func (s *simscreen) Sync() { - s.Lock() - s.clear = true - s.resize() - s.back.Invalidate() - s.draw() - s.Unlock() -} - -func (s *simscreen) CharacterSet() string { - return s.charset -} - -func (s *simscreen) SetSize(w, h int) { - s.Lock() - newc := make([]SimCell, w*h) - for row := 0; row < h && row < s.physh; row++ { - for col := 0; col < w && col < s.physw; col++ { - newc[(row*w)+col] = s.front[(row*s.physw)+col] - } - } - s.cursorx, s.cursory = -1, -1 - s.physw, s.physh = w, h - s.front = newc - s.back.Resize(w, h) - s.Unlock() -} - -func (s *simscreen) GetContents() ([]SimCell, int, int) { - s.Lock() - cells, w, h := s.front, s.physw, s.physh - s.Unlock() - return cells, w, h -} - -func (s *simscreen) GetCursor() (int, int, bool) { - s.Lock() - x, y, vis := s.cursorx, s.cursory, s.cursorvis - s.Unlock() - return x, y, vis -} - -func (s *simscreen) RegisterRuneFallback(r rune, subst string) { - s.Lock() - s.fallback[r] = subst - s.Unlock() -} - -func (s *simscreen) UnregisterRuneFallback(r rune) { - s.Lock() - delete(s.fallback, r) - s.Unlock() -} - -func (s *simscreen) CanDisplay(r rune, checkFallbacks bool) bool { - - if enc := s.encoder; enc != nil { - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - - enc.Reset() - dst, _, err := enc.Transform(nb, ob[:num], true) - if dst != 0 && err == nil && nb[0] != '\x1A' { - return true - } - } - if !checkFallbacks { - return false - } - if _, ok := s.fallback[r]; ok { - return true - } - return false -} - -func (s *simscreen) HasMouse() bool { - return false -} - -func (s *simscreen) Resize(int, int, int, int) {} - -func (s *simscreen) HasKey(Key) bool { - return true -} diff --git a/vendor/github.com/gdamore/tcell/style.go b/vendor/github.com/gdamore/tcell/style.go deleted file mode 100644 index c4ee9351..00000000 --- a/vendor/github.com/gdamore/tcell/style.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// Style represents a complete text style, including both foreground -// and background color. We encode it in a 64-bit int for efficiency. -// The coding is (MSB): <7b flags><1b><24b fgcolor><7b attr><1b><24b bgcolor>. -// The <1b> is set true to indicate that the color is an RGB color, rather -// than a named index. -// -// This gives 24bit color options, if it ever becomes truly necessary. -// However, applications must not rely on this encoding. -// -// Note that not all terminals can display all colors or attributes, and -// many might have specific incompatibilities between specific attributes -// and color combinations. -// -// The intention is to extend styles to support paletting, in which case -// some flag bit(s) would be set, and the foreground and background colors -// would be replaced with a palette number and palette index. -// -// To use Style, just declare a variable of its type. -type Style int64 - -// StyleDefault represents a default style, based upon the context. -// It is the zero value. -const StyleDefault Style = 0 - -// styleFlags -- used internally for now. -const ( - styleBgSet = 1 << (iota + 57) - styleFgSet - stylePalette -) - -// Foreground returns a new style based on s, with the foreground color set -// as requested. ColorDefault can be used to select the global default. -func (s Style) Foreground(c Color) Style { - if c == ColorDefault { - return (s &^ (0x1ffffff00000000 | styleFgSet)) - } - return (s &^ Style(0x1ffffff00000000)) | - ((Style(c) & 0x1ffffff) << 32) | styleFgSet -} - -// Background returns a new style based on s, with the background color set -// as requested. ColorDefault can be used to select the global default. -func (s Style) Background(c Color) Style { - if c == ColorDefault { - return (s &^ (0x1ffffff | styleBgSet)) - } - return (s &^ (0x1ffffff)) | (Style(c) & 0x1ffffff) | styleBgSet -} - -// Decompose breaks a style up, returning the foreground, background, -// and other attributes. -func (s Style) Decompose() (fg Color, bg Color, attr AttrMask) { - if s&styleFgSet != 0 { - fg = Color(s>>32) & 0x1ffffff - } else { - fg = ColorDefault - } - if s&styleBgSet != 0 { - bg = Color(s & 0x1ffffff) - } else { - bg = ColorDefault - } - attr = AttrMask(s) & attrAll - - return fg, bg, attr -} - -func (s Style) setAttrs(attrs Style, on bool) Style { - if on { - return s | attrs - } - return s &^ attrs -} - -// Normal returns the style with all attributes disabled. -func (s Style) Normal() Style { - return s &^ Style(attrAll) -} - -// Bold returns a new style based on s, with the bold attribute set -// as requested. -func (s Style) Bold(on bool) Style { - return s.setAttrs(Style(AttrBold), on) -} - -// Blink returns a new style based on s, with the blink attribute set -// as requested. -func (s Style) Blink(on bool) Style { - return s.setAttrs(Style(AttrBlink), on) -} - -// Dim returns a new style based on s, with the dim attribute set -// as requested. -func (s Style) Dim(on bool) Style { - return s.setAttrs(Style(AttrDim), on) -} - -// Reverse returns a new style based on s, with the reverse attribute set -// as requested. (Reverse usually changes the foreground and background -// colors.) -func (s Style) Reverse(on bool) Style { - return s.setAttrs(Style(AttrReverse), on) -} - -// Underline returns a new style based on s, with the underline attribute set -// as requested. -func (s Style) Underline(on bool) Style { - return s.setAttrs(Style(AttrUnderline), on) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/.gitignore b/vendor/github.com/gdamore/tcell/terminfo/.gitignore deleted file mode 100644 index 74f3c04f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -mkinfo diff --git a/vendor/github.com/gdamore/tcell/terminfo/README.md b/vendor/github.com/gdamore/tcell/terminfo/README.md deleted file mode 100644 index 20ae937f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/README.md +++ /dev/null @@ -1,25 +0,0 @@ -This package represents the parent for all terminals. - -In older versions of tcell we had (a couple of) different -external file formats for the terminal database. Those are -now removed. All terminal definitions are supplied by -one of two methods: - -1. Compiled Go code - -2. For systems with terminfo and infocmp, dynamically - generated at runtime. - -The Go code can be generated using the mkinfo utility in -this directory. The database entry should be generated -into a package in a directory named as the first character -of the package name. (This permits us to group them all -without having a huge directory of little packages.) - -It may be desirable to add new packages to the extended -package, or -- rarely -- the base package. - -Applications which want to have the large set of terminal -descriptions built into the binary can simply import the -extended package. Otherwise a smaller reasonable default -set (the base package) will be included instead. diff --git a/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md b/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md deleted file mode 100644 index 85c1e61c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/TERMINALS.md +++ /dev/null @@ -1,7 +0,0 @@ -TERMINALS -========= - -The best way to populate terminals on Debian is to install ncurses, -ncurses-term, screen, tmux, rxvt-unicode, and dvtm. This populates the -the terminfo database so that we can have a reasonable set of starting -terminals. diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go deleted file mode 100644 index dd8cf0f4..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/adm3a/term.go +++ /dev/null @@ -1,25 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package adm3a - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // lsi adm3a - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "adm3a", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a$<1/>", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go deleted file mode 100644 index 9dc082c8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/aixterm/term.go +++ /dev/null @@ -1,81 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package aixterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // IBM Aixterm Terminal Emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "aixterm", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "jjkkllmmnnqqttuuvvwwxx", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[139q", - KeyDelete: "\x1b[P", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyEnd: "\x1b[146q", - KeyPgUp: "\x1b[150q", - KeyPgDn: "\x1b[154q", - KeyF1: "\x1b[001q", - KeyF2: "\x1b[002q", - KeyF3: "\x1b[003q", - KeyF4: "\x1b[004q", - KeyF5: "\x1b[005q", - KeyF6: "\x1b[006q", - KeyF7: "\x1b[007q", - KeyF8: "\x1b[008q", - KeyF9: "\x1b[009q", - KeyF10: "\x1b[010q", - KeyF11: "\x1b[011q", - KeyF12: "\x1b[012q", - KeyF13: "\x1b[013q", - KeyF14: "\x1b[014q", - KeyF15: "\x1b[015q", - KeyF16: "\x1b[016q", - KeyF17: "\x1b[017q", - KeyF18: "\x1b[018q", - KeyF19: "\x1b[019q", - KeyF20: "\x1b[020q", - KeyF21: "\x1b[021q", - KeyF22: "\x1b[022q", - KeyF23: "\x1b[023q", - KeyF24: "\x1b[024q", - KeyF25: "\x1b[025q", - KeyF26: "\x1b[026q", - KeyF27: "\x1b[027q", - KeyF28: "\x1b[028q", - KeyF29: "\x1b[029q", - KeyF30: "\x1b[030q", - KeyF31: "\x1b[031q", - KeyF32: "\x1b[032q", - KeyF33: "\x1b[033q", - KeyF34: "\x1b[034q", - KeyF35: "\x1b[035q", - KeyF36: "\x1b[036q", - KeyClear: "\x1b[144q", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go deleted file mode 100644 index e65a8833..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/alacritty/term.go +++ /dev/null @@ -1,156 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package alacritty - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // alacritty terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "alacritty", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go deleted file mode 100644 index 4500c17c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/ansi/term.go +++ /dev/null @@ -1,41 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package ansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ansi/pc-term compatible with color - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "ansi", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[L", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go deleted file mode 100644 index 429d29e6..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/a/aterm/term.go +++ /dev/null @@ -1,110 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package aterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // AfterStep terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "aterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go deleted file mode 100644 index 184d0467..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/b/beterm/term.go +++ /dev/null @@ -1,54 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package beterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // BeOS Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "beterm", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?4h", - ExitKeypad: "\x1b[?4l", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[16~", - KeyF7: "\x1b[17~", - KeyF8: "\x1b[18~", - KeyF9: "\x1b[19~", - KeyF10: "\x1b[20~", - KeyF11: "\x1b[21~", - KeyF12: "\x1b[22~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go b/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go deleted file mode 100644 index 3174cc7d..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/b/bsdos_pc/term.go +++ /dev/null @@ -1,42 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package bsdos_pc - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // IBM PC BSD/OS Console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "bsdos-pc", - Columns: 80, - Lines: 25, - Colors: 8, - Bell: "\a", - Clear: "\x1bc", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[L", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyPgUp: "\x1b[I", - KeyPgDn: "\x1b[G", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/base/base.go b/vendor/github.com/gdamore/tcell/terminfo/base/base.go deleted file mode 100644 index 49e6c013..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/base/base.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This is just a "minimalist" set of the base terminal descriptions. -// It should be sufficient for most applications. - -// Package base contains the base terminal descriptions that are likely -// to be needed by any stock application. It is imported by default in the -// terminfo package, so terminal types listed here will be available to any -// tcell application. -package base - -import ( - // The following imports just register themselves -- - // thse are the terminal types we aggregate in this package. - _ "github.com/gdamore/tcell/terminfo/a/ansi" - _ "github.com/gdamore/tcell/terminfo/v/vt100" - _ "github.com/gdamore/tcell/terminfo/v/vt102" - _ "github.com/gdamore/tcell/terminfo/v/vt220" - _ "github.com/gdamore/tcell/terminfo/x/xterm" -) diff --git a/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go b/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go deleted file mode 100644 index e734ef5c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/c/cygwin/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package cygwin - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ansi emulation for Cygwin - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "cygwin", - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[11m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[[A", - KeyF2: "\x1b[[B", - KeyF3: "\x1b[[C", - KeyF4: "\x1b[[D", - KeyF5: "\x1b[[E", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go deleted file mode 100644 index 5950d5c8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/d200/term.go +++ /dev/null @@ -1,97 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package d200 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Data General DASHER D200 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "d200", - Aliases: []string{"d200-dg"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\f", - AttrOff: "\x0f\x15\x1d\x1eE", - Underline: "\x14", - Bold: "\x1eD\x14", - Dim: "\x1c", - Blink: "\x0e", - Reverse: "\x1eD", - PadChar: "\x00", - SetCursor: "\x10%p2%c%p1%c", - CursorBack1: "\x19", - CursorUp1: "\x17", - KeyUp: "\x17", - KeyDown: "\x1a", - KeyRight: "\x18", - KeyLeft: "\x19", - KeyHome: "\b", - KeyF1: "\x1eq", - KeyF2: "\x1er", - KeyF3: "\x1es", - KeyF4: "\x1et", - KeyF5: "\x1eu", - KeyF6: "\x1ev", - KeyF7: "\x1ew", - KeyF8: "\x1ex", - KeyF9: "\x1ey", - KeyF10: "\x1ez", - KeyF11: "\x1e{", - KeyF12: "\x1e|", - KeyF13: "\x1e}", - KeyF14: "\x1e~", - KeyF15: "\x1ep", - KeyF16: "\x1ea", - KeyF17: "\x1eb", - KeyF18: "\x1ec", - KeyF19: "\x1ed", - KeyF20: "\x1ee", - KeyF21: "\x1ef", - KeyF22: "\x1eg", - KeyF23: "\x1eh", - KeyF24: "\x1ei", - KeyF25: "\x1ej", - KeyF26: "\x1ek", - KeyF27: "\x1el", - KeyF28: "\x1em", - KeyF29: "\x1en", - KeyF30: "\x1e`", - KeyF31: "\x1e1", - KeyF32: "\x1e2", - KeyF33: "\x1e3", - KeyF34: "\x1e4", - KeyF35: "\x1e5", - KeyF36: "\x1e6", - KeyF37: "\x1e7", - KeyF38: "\x1e8", - KeyF39: "\x1e9", - KeyF40: "\x1e:", - KeyF41: "\x1e;", - KeyF42: "\x1e<", - KeyF43: "\x1e=", - KeyF44: "\x1e>", - KeyF45: "\x1e0", - KeyF46: "\x1e!", - KeyF47: "\x1e\"", - KeyF48: "\x1e#", - KeyF49: "\x1e$", - KeyF50: "\x1e%%", - KeyF51: "\x1e&", - KeyF52: "\x1e'", - KeyF53: "\x1e(", - KeyF54: "\x1e)", - KeyF55: "\x1e*", - KeyF56: "\x1e+", - KeyF57: "\x1e,", - KeyF58: "\x1e-", - KeyF59: "\x1e.", - KeyF60: "\x1e ", - KeyClear: "\f", - KeyShfLeft: "\x1e\x19", - KeyShfRight: "\x1e\x18", - KeyShfHome: "\x1e\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go deleted file mode 100644 index 13a56cce..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/d210/term.go +++ /dev/null @@ -1,95 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package d210 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Data General DASHER D210 series - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "d210", - Aliases: []string{"d214"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[2J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[4;7m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyHome: "\x1b[H", - KeyF1: "\x1b[001z", - KeyF2: "\x1b[002z", - KeyF3: "\x1b[003z", - KeyF4: "\x1b[004z", - KeyF5: "\x1b[005z", - KeyF6: "\x1b[006z", - KeyF7: "\x1b[007z", - KeyF8: "\x1b[008z", - KeyF9: "\x1b[009z", - KeyF10: "\x1b[010z", - KeyF11: "\x1b[011z", - KeyF12: "\x1b[012z", - KeyF13: "\x1b[013z", - KeyF14: "\x1b[014z", - KeyF15: "\x1b[000z", - KeyF16: "\x1b[101z", - KeyF17: "\x1b[102z", - KeyF18: "\x1b[103z", - KeyF19: "\x1b[104z", - KeyF20: "\x1b[105z", - KeyF21: "\x1b[106z", - KeyF22: "\x1b[107z", - KeyF23: "\x1b[108z", - KeyF24: "\x1b[109z", - KeyF25: "\x1b[110z", - KeyF26: "\x1b[111z", - KeyF27: "\x1b[112z", - KeyF28: "\x1b[113z", - KeyF29: "\x1b[114z", - KeyF30: "\x1b[100z", - KeyF31: "\x1b[201z", - KeyF32: "\x1b[202z", - KeyF33: "\x1b[203z", - KeyF34: "\x1b[204z", - KeyF35: "\x1b[205z", - KeyF36: "\x1b[206z", - KeyF37: "\x1b[207z", - KeyF38: "\x1b[208z", - KeyF39: "\x1b[209z", - KeyF40: "\x1b[210z", - KeyF41: "\x1b[211z", - KeyF42: "\x1b[212z", - KeyF43: "\x1b[213z", - KeyF44: "\x1b[214z", - KeyF45: "\x1b[200z", - KeyF46: "\x1b[301z", - KeyF47: "\x1b[302z", - KeyF48: "\x1b[303z", - KeyF49: "\x1b[304z", - KeyF50: "\x1b[305z", - KeyF51: "\x1b[306z", - KeyF52: "\x1b[307z", - KeyF53: "\x1b[308z", - KeyF54: "\x1b[309z", - KeyF55: "\x1b[310z", - KeyF56: "\x1b[311z", - KeyF57: "\x1b[312z", - KeyF58: "\x1b[313z", - KeyF59: "\x1b[314z", - KeyF60: "\x1b[300z", - KeyPrint: "\x1b[i", - KeyClear: "\x1b[2J", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go deleted file mode 100644 index a6366f22..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/d/dtterm/term.go +++ /dev/null @@ -1,67 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package dtterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // CDE desktop terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "dtterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyHelp: "\x1b[28~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go b/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go deleted file mode 100644 index 71de2080..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/dynamic/dynamic.go +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The dynamic package is used to generate a terminal description dynamically, -// using infocmp. This is really a method of last resort, as the performance -// will be slow, and it requires a working infocmp. But, the hope is that it -// will assist folks who have to deal with a terminal description that isn't -// already built in. This requires infocmp to be in the user's path, and to -// support reasonably the -1 option. - -package dynamic - -import ( - "bytes" - "errors" - "os/exec" - "regexp" - "strconv" - "strings" - - "github.com/gdamore/tcell/terminfo" -) - -type termcap struct { - name string - desc string - aliases []string - bools map[string]bool - nums map[string]int - strs map[string]string -} - -func (tc *termcap) getnum(s string) int { - return (tc.nums[s]) -} - -func (tc *termcap) getflag(s string) bool { - return (tc.bools[s]) -} - -func (tc *termcap) getstr(s string) string { - return (tc.strs[s]) -} - -const ( - none = iota - control - escaped -) - -var errNotAddressable = errors.New("terminal not cursor addressable") - -func unescape(s string) string { - // Various escapes are in \x format. Control codes are - // encoded as ^M (carat followed by ASCII equivalent). - // escapes are: \e, \E - escape - // \0 NULL, \n \l \r \t \b \f \s for equivalent C escape. - buf := &bytes.Buffer{} - esc := none - - for i := 0; i < len(s); i++ { - c := s[i] - switch esc { - case none: - switch c { - case '\\': - esc = escaped - case '^': - esc = control - default: - buf.WriteByte(c) - } - case control: - buf.WriteByte(c - 0x40) - esc = none - case escaped: - switch c { - case 'E', 'e': - buf.WriteByte(0x1b) - case '0', '1', '2', '3', '4', '5', '6', '7': - if i+2 < len(s) && s[i+1] >= '0' && s[i+1] <= '7' && s[i+2] >= '0' && s[i+2] <= '7' { - buf.WriteByte(((c - '0') * 64) + ((s[i+1] - '0') * 8) + (s[i+2] - '0')) - i = i + 2 - } else if c == '0' { - buf.WriteByte(0) - } - case 'n': - buf.WriteByte('\n') - case 'r': - buf.WriteByte('\r') - case 't': - buf.WriteByte('\t') - case 'b': - buf.WriteByte('\b') - case 'f': - buf.WriteByte('\f') - case 's': - buf.WriteByte(' ') - default: - buf.WriteByte(c) - } - esc = none - } - } - return (buf.String()) -} - -func (tc *termcap) setupterm(name string) error { - cmd := exec.Command("infocmp", "-1", name) - output := &bytes.Buffer{} - cmd.Stdout = output - - tc.strs = make(map[string]string) - tc.bools = make(map[string]bool) - tc.nums = make(map[string]int) - - if err := cmd.Run(); err != nil { - return err - } - - // Now parse the output. - // We get comment lines (starting with "#"), followed by - // a header line that looks like "||...|" - // then capabilities, one per line, starting with a tab and ending - // with a comma and newline. - lines := strings.Split(output.String(), "\n") - for len(lines) > 0 && strings.HasPrefix(lines[0], "#") { - lines = lines[1:] - } - - // Ditch trailing empty last line - if lines[len(lines)-1] == "" { - lines = lines[:len(lines)-1] - } - header := lines[0] - if strings.HasSuffix(header, ",") { - header = header[:len(header)-1] - } - names := strings.Split(header, "|") - tc.name = names[0] - names = names[1:] - if len(names) > 0 { - tc.desc = names[len(names)-1] - names = names[:len(names)-1] - } - tc.aliases = names - for _, val := range lines[1:] { - if (!strings.HasPrefix(val, "\t")) || - (!strings.HasSuffix(val, ",")) { - return (errors.New("malformed infocmp: " + val)) - } - - val = val[1:] - val = val[:len(val)-1] - - if k := strings.SplitN(val, "=", 2); len(k) == 2 { - tc.strs[k[0]] = unescape(k[1]) - } else if k := strings.SplitN(val, "#", 2); len(k) == 2 { - u, err := strconv.ParseUint(k[1], 0, 0) - if err != nil { - return (err) - } - tc.nums[k[0]] = int(u) - } else { - tc.bools[val] = true - } - } - return nil -} - -// LoadTerminfo creates a Terminfo by for named terminal by attempting to parse -// the output from infocmp. This returns the terminfo entry, a description of -// the terminal, and either nil or an error. -func LoadTerminfo(name string) (*terminfo.Terminfo, string, error) { - var tc termcap - if err := tc.setupterm(name); err != nil { - if err != nil { - return nil, "", err - } - } - t := &terminfo.Terminfo{} - // If this is an alias record, then just emit the alias - t.Name = tc.name - if t.Name != name { - return t, "", nil - } - t.Aliases = tc.aliases - t.Colors = tc.getnum("colors") - t.Columns = tc.getnum("cols") - t.Lines = tc.getnum("lines") - t.Bell = tc.getstr("bel") - t.Clear = tc.getstr("clear") - t.EnterCA = tc.getstr("smcup") - t.ExitCA = tc.getstr("rmcup") - t.ShowCursor = tc.getstr("cnorm") - t.HideCursor = tc.getstr("civis") - t.AttrOff = tc.getstr("sgr0") - t.Underline = tc.getstr("smul") - t.Bold = tc.getstr("bold") - t.Blink = tc.getstr("blink") - t.Dim = tc.getstr("dim") - t.Reverse = tc.getstr("rev") - t.EnterKeypad = tc.getstr("smkx") - t.ExitKeypad = tc.getstr("rmkx") - t.SetFg = tc.getstr("setaf") - t.SetBg = tc.getstr("setab") - t.SetCursor = tc.getstr("cup") - t.CursorBack1 = tc.getstr("cub1") - t.CursorUp1 = tc.getstr("cuu1") - t.KeyF1 = tc.getstr("kf1") - t.KeyF2 = tc.getstr("kf2") - t.KeyF3 = tc.getstr("kf3") - t.KeyF4 = tc.getstr("kf4") - t.KeyF5 = tc.getstr("kf5") - t.KeyF6 = tc.getstr("kf6") - t.KeyF7 = tc.getstr("kf7") - t.KeyF8 = tc.getstr("kf8") - t.KeyF9 = tc.getstr("kf9") - t.KeyF10 = tc.getstr("kf10") - t.KeyF11 = tc.getstr("kf11") - t.KeyF12 = tc.getstr("kf12") - t.KeyF13 = tc.getstr("kf13") - t.KeyF14 = tc.getstr("kf14") - t.KeyF15 = tc.getstr("kf15") - t.KeyF16 = tc.getstr("kf16") - t.KeyF17 = tc.getstr("kf17") - t.KeyF18 = tc.getstr("kf18") - t.KeyF19 = tc.getstr("kf19") - t.KeyF20 = tc.getstr("kf20") - t.KeyF21 = tc.getstr("kf21") - t.KeyF22 = tc.getstr("kf22") - t.KeyF23 = tc.getstr("kf23") - t.KeyF24 = tc.getstr("kf24") - t.KeyF25 = tc.getstr("kf25") - t.KeyF26 = tc.getstr("kf26") - t.KeyF27 = tc.getstr("kf27") - t.KeyF28 = tc.getstr("kf28") - t.KeyF29 = tc.getstr("kf29") - t.KeyF30 = tc.getstr("kf30") - t.KeyF31 = tc.getstr("kf31") - t.KeyF32 = tc.getstr("kf32") - t.KeyF33 = tc.getstr("kf33") - t.KeyF34 = tc.getstr("kf34") - t.KeyF35 = tc.getstr("kf35") - t.KeyF36 = tc.getstr("kf36") - t.KeyF37 = tc.getstr("kf37") - t.KeyF38 = tc.getstr("kf38") - t.KeyF39 = tc.getstr("kf39") - t.KeyF40 = tc.getstr("kf40") - t.KeyF41 = tc.getstr("kf41") - t.KeyF42 = tc.getstr("kf42") - t.KeyF43 = tc.getstr("kf43") - t.KeyF44 = tc.getstr("kf44") - t.KeyF45 = tc.getstr("kf45") - t.KeyF46 = tc.getstr("kf46") - t.KeyF47 = tc.getstr("kf47") - t.KeyF48 = tc.getstr("kf48") - t.KeyF49 = tc.getstr("kf49") - t.KeyF50 = tc.getstr("kf50") - t.KeyF51 = tc.getstr("kf51") - t.KeyF52 = tc.getstr("kf52") - t.KeyF53 = tc.getstr("kf53") - t.KeyF54 = tc.getstr("kf54") - t.KeyF55 = tc.getstr("kf55") - t.KeyF56 = tc.getstr("kf56") - t.KeyF57 = tc.getstr("kf57") - t.KeyF58 = tc.getstr("kf58") - t.KeyF59 = tc.getstr("kf59") - t.KeyF60 = tc.getstr("kf60") - t.KeyF61 = tc.getstr("kf61") - t.KeyF62 = tc.getstr("kf62") - t.KeyF63 = tc.getstr("kf63") - t.KeyF64 = tc.getstr("kf64") - t.KeyInsert = tc.getstr("kich1") - t.KeyDelete = tc.getstr("kdch1") - t.KeyBackspace = tc.getstr("kbs") - t.KeyHome = tc.getstr("khome") - t.KeyEnd = tc.getstr("kend") - t.KeyUp = tc.getstr("kcuu1") - t.KeyDown = tc.getstr("kcud1") - t.KeyRight = tc.getstr("kcuf1") - t.KeyLeft = tc.getstr("kcub1") - t.KeyPgDn = tc.getstr("knp") - t.KeyPgUp = tc.getstr("kpp") - t.KeyBacktab = tc.getstr("kcbt") - t.KeyExit = tc.getstr("kext") - t.KeyCancel = tc.getstr("kcan") - t.KeyPrint = tc.getstr("kprt") - t.KeyHelp = tc.getstr("khlp") - t.KeyClear = tc.getstr("kclr") - t.AltChars = tc.getstr("acsc") - t.EnterAcs = tc.getstr("smacs") - t.ExitAcs = tc.getstr("rmacs") - t.EnableAcs = tc.getstr("enacs") - t.Mouse = tc.getstr("kmous") - t.KeyShfRight = tc.getstr("kRIT") - t.KeyShfLeft = tc.getstr("kLFT") - t.KeyShfHome = tc.getstr("kHOM") - t.KeyShfEnd = tc.getstr("kEND") - - // Terminfo lacks descriptions for a bunch of modified keys, - // but modern XTerm and emulators often have them. Let's add them, - // if the shifted right and left arrows are defined. - if t.KeyShfRight == "\x1b[1;2C" && t.KeyShfLeft == "\x1b[1;2D" { - t.KeyShfUp = "\x1b[1;2A" - t.KeyShfDown = "\x1b[1;2B" - t.KeyMetaUp = "\x1b[1;9A" - t.KeyMetaDown = "\x1b[1;9B" - t.KeyMetaRight = "\x1b[1;9C" - t.KeyMetaLeft = "\x1b[1;9D" - t.KeyAltUp = "\x1b[1;3A" - t.KeyAltDown = "\x1b[1;3B" - t.KeyAltRight = "\x1b[1;3C" - t.KeyAltLeft = "\x1b[1;3D" - t.KeyCtrlUp = "\x1b[1;5A" - t.KeyCtrlDown = "\x1b[1;5B" - t.KeyCtrlRight = "\x1b[1;5C" - t.KeyCtrlLeft = "\x1b[1;5D" - t.KeyAltShfUp = "\x1b[1;4A" - t.KeyAltShfDown = "\x1b[1;4B" - t.KeyAltShfRight = "\x1b[1;4C" - t.KeyAltShfLeft = "\x1b[1;4D" - - t.KeyMetaShfUp = "\x1b[1;10A" - t.KeyMetaShfDown = "\x1b[1;10B" - t.KeyMetaShfRight = "\x1b[1;10C" - t.KeyMetaShfLeft = "\x1b[1;10D" - - t.KeyCtrlShfUp = "\x1b[1;6A" - t.KeyCtrlShfDown = "\x1b[1;6B" - t.KeyCtrlShfRight = "\x1b[1;6C" - t.KeyCtrlShfLeft = "\x1b[1;6D" - } - // And also for Home and End - if t.KeyShfHome == "\x1b[1;2H" && t.KeyShfEnd == "\x1b[1;2F" { - t.KeyCtrlHome = "\x1b[1;5H" - t.KeyCtrlEnd = "\x1b[1;5F" - t.KeyAltHome = "\x1b[1;9H" - t.KeyAltEnd = "\x1b[1;9F" - t.KeyCtrlShfHome = "\x1b[1;6H" - t.KeyCtrlShfEnd = "\x1b[1;6F" - t.KeyAltShfHome = "\x1b[1;4H" - t.KeyAltShfEnd = "\x1b[1;4F" - t.KeyMetaShfHome = "\x1b[1;10H" - t.KeyMetaShfEnd = "\x1b[1;10F" - } - - // And the same thing for rxvt and workalikes (Eterm, aterm, etc.) - // It seems that urxvt at least send escaped as ALT prefix for these, - // although some places seem to indicate a separate ALT key sesquence. - if t.KeyShfRight == "\x1b[c" && t.KeyShfLeft == "\x1b[d" { - t.KeyShfUp = "\x1b[a" - t.KeyShfDown = "\x1b[b" - t.KeyCtrlUp = "\x1b[Oa" - t.KeyCtrlDown = "\x1b[Ob" - t.KeyCtrlRight = "\x1b[Oc" - t.KeyCtrlLeft = "\x1b[Od" - } - if t.KeyShfHome == "\x1b[7$" && t.KeyShfEnd == "\x1b[8$" { - t.KeyCtrlHome = "\x1b[7^" - t.KeyCtrlEnd = "\x1b[8^" - } - - // If the kmous entry is present, then we need to record the - // the codes to enter and exit mouse mode. Sadly, this is not - // part of the terminfo databases anywhere that I've found, but - // is an extension. The escapedape codes are documented in the XTerm - // manual, and all terminals that have kmous are expected to - // use these same codes, unless explicitly configured otherwise - // vi XM. Note that in any event, we only known how to parse either - // x11 or SGR mouse events -- if your terminal doesn't support one - // of these two forms, you maybe out of luck. - t.MouseMode = tc.getstr("XM") - if t.Mouse != "" && t.MouseMode == "" { - // we anticipate that all xterm mouse tracking compatible - // terminals understand mouse tracking (1000), but we hope - // that those that don't understand any-event tracking (1003) - // will at least ignore it. Likewise we hope that terminals - // that don't understand SGR reporting (1006) just ignore it. - t.MouseMode = "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;" + - "\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c" - } - - // We only support colors in ANSI 8 or 256 color mode. - if t.Colors < 8 || t.SetFg == "" { - t.Colors = 0 - } - if t.SetCursor == "" { - return nil, "", errNotAddressable - } - - // For padding, we lookup the pad char. If that isn't present, - // and npc is *not* set, then we assume a null byte. - t.PadChar = tc.getstr("pad") - if t.PadChar == "" { - if !tc.getflag("npc") { - t.PadChar = "\u0000" - } - } - - // For terminals that use "standard" SGR sequences, lets combine the - // foreground and background together. - if strings.HasPrefix(t.SetFg, "\x1b[") && - strings.HasPrefix(t.SetBg, "\x1b[") && - strings.HasSuffix(t.SetFg, "m") && - strings.HasSuffix(t.SetBg, "m") { - fg := t.SetFg[:len(t.SetFg)-1] - r := regexp.MustCompile("%p1") - bg := r.ReplaceAllString(t.SetBg[2:], "%p2") - t.SetFgBg = fg + ";" + bg - } - - return t, tc.desc, nil -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go b/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go deleted file mode 100644 index 91418b64..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/e/emacs/term.go +++ /dev/null @@ -1,60 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package emacs - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // gnu emacs term.el terminal emulation - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "eterm", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - }) - - // Emacs term.el terminal emulator term-protocol-version 0.96 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "eterm-color", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%p1%{30}%+%dm", - SetBg: "\x1b[%p1%'('%+%dm", - SetFgBg: "\x1b[%p1%{30}%+%d;%p2%'('%+%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go deleted file mode 100644 index e5bd99fd..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/e/eterm/term.go +++ /dev/null @@ -1,309 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package eterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Eterm with xterm-style color support (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm", - Aliases: []string{"Eterm-color"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // Eterm with 88 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // Eterm with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "Eterm-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyHelp: "\x1b[28~", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go b/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go deleted file mode 100644 index cc0af120..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/extended/extended.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package extended contains an extended set of terminal descriptions. -// Applications desiring to have a better chance of Just Working by -// default should include this package. This will significantly increase -// the size of the program. -package extended - -import ( - // The following imports just register themselves -- - // these are the terminal types we aggregate in this package. - _ "github.com/gdamore/tcell/terminfo/a/adm3a" - _ "github.com/gdamore/tcell/terminfo/a/aixterm" - _ "github.com/gdamore/tcell/terminfo/a/alacritty" - _ "github.com/gdamore/tcell/terminfo/a/ansi" - _ "github.com/gdamore/tcell/terminfo/a/aterm" - _ "github.com/gdamore/tcell/terminfo/b/beterm" - _ "github.com/gdamore/tcell/terminfo/b/bsdos_pc" - _ "github.com/gdamore/tcell/terminfo/c/cygwin" - _ "github.com/gdamore/tcell/terminfo/d/d200" - _ "github.com/gdamore/tcell/terminfo/d/d210" - _ "github.com/gdamore/tcell/terminfo/d/dtterm" - _ "github.com/gdamore/tcell/terminfo/e/emacs" - _ "github.com/gdamore/tcell/terminfo/e/eterm" - _ "github.com/gdamore/tcell/terminfo/g/gnome" - _ "github.com/gdamore/tcell/terminfo/h/hpterm" - _ "github.com/gdamore/tcell/terminfo/h/hz1500" - _ "github.com/gdamore/tcell/terminfo/k/konsole" - _ "github.com/gdamore/tcell/terminfo/k/kterm" - _ "github.com/gdamore/tcell/terminfo/l/linux" - _ "github.com/gdamore/tcell/terminfo/p/pcansi" - _ "github.com/gdamore/tcell/terminfo/r/rxvt" - _ "github.com/gdamore/tcell/terminfo/s/screen" - _ "github.com/gdamore/tcell/terminfo/s/simpleterm" - _ "github.com/gdamore/tcell/terminfo/s/sun" - _ "github.com/gdamore/tcell/terminfo/t/termite" - _ "github.com/gdamore/tcell/terminfo/t/tvi910" - _ "github.com/gdamore/tcell/terminfo/t/tvi912" - _ "github.com/gdamore/tcell/terminfo/t/tvi921" - _ "github.com/gdamore/tcell/terminfo/t/tvi925" - _ "github.com/gdamore/tcell/terminfo/t/tvi950" - _ "github.com/gdamore/tcell/terminfo/t/tvi970" - _ "github.com/gdamore/tcell/terminfo/v/vt100" - _ "github.com/gdamore/tcell/terminfo/v/vt102" - _ "github.com/gdamore/tcell/terminfo/v/vt220" - _ "github.com/gdamore/tcell/terminfo/v/vt320" - _ "github.com/gdamore/tcell/terminfo/v/vt400" - _ "github.com/gdamore/tcell/terminfo/v/vt420" - _ "github.com/gdamore/tcell/terminfo/v/vt52" - _ "github.com/gdamore/tcell/terminfo/w/wy50" - _ "github.com/gdamore/tcell/terminfo/w/wy60" - _ "github.com/gdamore/tcell/terminfo/w/wy99_ansi" - _ "github.com/gdamore/tcell/terminfo/x/xfce" - _ "github.com/gdamore/tcell/terminfo/x/xnuppc" - _ "github.com/gdamore/tcell/terminfo/x/xterm" - _ "github.com/gdamore/tcell/terminfo/x/xterm_kitty" -) diff --git a/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go b/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go deleted file mode 100644 index 08b913eb..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/g/gnome/term.go +++ /dev/null @@ -1,306 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package gnome - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // GNOME Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "gnome", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO1;2P", - KeyF14: "\x1bO1;2Q", - KeyF15: "\x1bO1;2R", - KeyF16: "\x1bO1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO1;5P", - KeyF26: "\x1bO1;5Q", - KeyF27: "\x1bO1;5R", - KeyF28: "\x1bO1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO1;6P", - KeyF38: "\x1bO1;6Q", - KeyF39: "\x1bO1;6R", - KeyF40: "\x1bO1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO1;3P", - KeyF50: "\x1bO1;3Q", - KeyF51: "\x1bO1;3R", - KeyF52: "\x1bO1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO1;4P", - KeyF62: "\x1bO1;4Q", - KeyF63: "\x1bO1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // GNOME Terminal with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "gnome-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[<", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/gen.sh b/vendor/github.com/gdamore/tcell/terminfo/gen.sh deleted file mode 100644 index 2fc06112..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/gen.sh +++ /dev/null @@ -1,18 +0,0 @@ -while read line -do - case "$line" in - *'|'*) - alias=${line#*|} - line=${line%|*} - ;; - *) - alias=${line%%,*} - ;; - esac - - alias=${alias//-/_} - direc=${alias:0:1} - - mkdir -p ${direc}/${alias} - go run mkinfo.go -P ${alias} -go ${direc}/${alias}/term.go ${line//,/ } -done < models.txt diff --git a/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go deleted file mode 100644 index 5e73e044..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/h/hpterm/term.go +++ /dev/null @@ -1,50 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package hpterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // hp X11 terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "hpterm", - Aliases: []string{"X-hpterm"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b&a0y0C\x1bJ", - AttrOff: "\x1b&d@\x0f", - Underline: "\x1b&dD", - Bold: "\x1b&dB", - Dim: "\x1b&dH", - Reverse: "\x1b&dB", - EnterKeypad: "\x1b&s1A", - ExitKeypad: "\x1b&s0A", - PadChar: "\x00", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - SetCursor: "\x1b&a%p1%dy%p2%dC", - CursorBack1: "\b", - CursorUp1: "\x1bA", - KeyUp: "\x1bA", - KeyDown: "\x1bB", - KeyRight: "\x1bC", - KeyLeft: "\x1bD", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bP", - KeyBackspace: "\b", - KeyHome: "\x1bh", - KeyPgUp: "\x1bV", - KeyPgDn: "\x1bU", - KeyF1: "\x1bp", - KeyF2: "\x1bq", - KeyF3: "\x1br", - KeyF4: "\x1bs", - KeyF5: "\x1bt", - KeyF6: "\x1bu", - KeyF7: "\x1bv", - KeyF8: "\x1bw", - KeyClear: "\x1bJ", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go b/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go deleted file mode 100644 index 3ad18109..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/h/hz1500/term.go +++ /dev/null @@ -1,26 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package hz1500 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // hazeltine 1500 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "hz1500", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "~\x1c", - PadChar: "\x00", - SetCursor: "~\x11%p2%p2%?%{30}%>%t%' '%+%;%'`'%+%c%p1%'`'%+%c", - CursorBack1: "\b", - CursorUp1: "~\f", - KeyUp: "~\f", - KeyDown: "\n", - KeyRight: "\x10", - KeyLeft: "\b", - KeyHome: "~\x12", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go b/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go deleted file mode 100644 index 21cd72ae..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/k/konsole/term.go +++ /dev/null @@ -1,304 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package konsole - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // KDE console window - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "konsole", - Columns: 80, - Lines: 24, - Colors: 8, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO2P", - KeyF14: "\x1bO2Q", - KeyF15: "\x1bO2R", - KeyF16: "\x1bO2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO5P", - KeyF26: "\x1bO5Q", - KeyF27: "\x1bO5R", - KeyF28: "\x1bO5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO6P", - KeyF38: "\x1bO6Q", - KeyF39: "\x1bO6R", - KeyF40: "\x1bO6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO3P", - KeyF50: "\x1bO3Q", - KeyF51: "\x1bO3R", - KeyF52: "\x1bO3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO4P", - KeyF62: "\x1bO4Q", - KeyF63: "\x1bO4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // KDE console window with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "konsole-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO2P", - KeyF14: "\x1bO2Q", - KeyF15: "\x1bO2R", - KeyF16: "\x1bO2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO5P", - KeyF26: "\x1bO5Q", - KeyF27: "\x1bO5R", - KeyF28: "\x1bO5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO6P", - KeyF38: "\x1bO6Q", - KeyF39: "\x1bO6R", - KeyF40: "\x1bO6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO3P", - KeyF50: "\x1bO3Q", - KeyF51: "\x1bO3R", - KeyF52: "\x1bO3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO4P", - KeyF62: "\x1bO4Q", - KeyF63: "\x1bO4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go deleted file mode 100644 index f4478404..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/k/kterm/term.go +++ /dev/null @@ -1,67 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package kterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // kterm kanji terminal emulator (X window system) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "kterm", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aajjkkllmmnnooppqqrrssttuuvvwwxx~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go b/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go deleted file mode 100644 index 1702c363..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/l/linux/term.go +++ /dev/null @@ -1,69 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package linux - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // linux console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "linux", - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - ShowCursor: "\x1b[?25h\x1b[?0c", - HideCursor: "\x1b[?25l\x1b[?1c", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "++,,--..00__``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}c~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[[A", - KeyF2: "\x1b[[B", - KeyF3: "\x1b[[C", - KeyF4: "\x1b[[D", - KeyF5: "\x1b[[E", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/models.txt b/vendor/github.com/gdamore/tcell/terminfo/models.txt deleted file mode 100644 index 7ed2adb7..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/models.txt +++ /dev/null @@ -1,43 +0,0 @@ -adm3a -aixterm -ansi -aterm -beterm -bsdos-pc -cygwin -d200 -d210 -dtterm -eterm,eterm-color|emacs -Eterm,Eterm-88color,Eterm-256color|eterm -gnome,gnome-256color -hpterm -hz1500 -konsole,konsole-256color -kterm -linux -pcansi -rxvt,rxvt-256color,rxvt-88color,rxvt-unicode,rxvt-unicode-256color -screen,screen-256color -st,st-256color|simpleterm -sun,sun-color -termite -tvi910 -tvi912 -tvi921 -tvi925 -tvi950 -tvi970 -vt52 -vt100 -vt102 -vt220 -vt320 -vt400 -vt420 -wy50 -wy60 -wy99-ansi,wy99a-ansi -xfce -xnuppc -xterm,xterm-88color,xterm-256color diff --git a/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go deleted file mode 100644 index 84bc400b..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/p/pcansi/term.go +++ /dev/null @@ -1,39 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package pcansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // ibm-pc terminal programs claiming to be ansi - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "pcansi", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[0;10m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", - EnterAcs: "\x1b[12m", - ExitAcs: "\x1b[10m", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go b/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go deleted file mode 100644 index 776f750e..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/r/rxvt/term.go +++ /dev/null @@ -1,466 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package rxvt - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // rxvt terminal emulator (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt 2.7.9 with xterm 256-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt 2.7.9 with xterm 88-colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyF21: "\x1b[23$", - KeyF22: "\x1b[24$", - KeyF23: "\x1b[11^", - KeyF24: "\x1b[12^", - KeyF25: "\x1b[13^", - KeyF26: "\x1b[14^", - KeyF27: "\x1b[15^", - KeyF28: "\x1b[17^", - KeyF29: "\x1b[18^", - KeyF30: "\x1b[19^", - KeyF31: "\x1b[20^", - KeyF32: "\x1b[21^", - KeyF33: "\x1b[23^", - KeyF34: "\x1b[24^", - KeyF35: "\x1b[25^", - KeyF36: "\x1b[26^", - KeyF37: "\x1b[28^", - KeyF38: "\x1b[29^", - KeyF39: "\x1b[31^", - KeyF40: "\x1b[32^", - KeyF41: "\x1b[33^", - KeyF42: "\x1b[34^", - KeyF43: "\x1b[23@", - KeyF44: "\x1b[24@", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt-unicode terminal (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-unicode", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[r\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[38;5;%p1%dm", - SetBg: "\x1b[48;5;%p1%dm", - SetFgBg: "\x1b[38;5;%p1%d;48;5;%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) - - // rxvt-unicode terminal with 256 colors (X Window System) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "rxvt-unicode-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[r\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - SetFg: "\x1b[38;5;%p1%dm", - SetBg: "\x1b[48;5;%p1%dm", - SetFgBg: "\x1b[38;5;%p1%d;48;5;%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[7~", - KeyEnd: "\x1b[8~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1b[11~", - KeyF2: "\x1b[12~", - KeyF3: "\x1b[13~", - KeyF4: "\x1b[14~", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[d", - KeyShfRight: "\x1b[c", - KeyShfUp: "\x1b[a", - KeyShfDown: "\x1b[b", - KeyCtrlLeft: "\x1b[Od", - KeyCtrlRight: "\x1b[Oc", - KeyCtrlUp: "\x1b[Oa", - KeyCtrlDown: "\x1b[Ob", - KeyShfHome: "\x1b[7$", - KeyShfEnd: "\x1b[8$", - KeyCtrlHome: "\x1b[7^", - KeyCtrlEnd: "\x1b[8^", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go deleted file mode 100644 index ab0d8eed..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/screen/term.go +++ /dev/null @@ -1,126 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package screen - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // VT 100/ANSI X3.64 virtual terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "screen", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyBacktab: "\x1b[Z", - }) - - // GNU Screen with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "screen-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - PadChar: "\x00", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyBacktab: "\x1b[Z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go deleted file mode 100644 index ad7c1e81..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/simpleterm/term.go +++ /dev/null @@ -1,308 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package simpleterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // simpleterm - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "st", - Aliases: []string{"stterm"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyClear: "\x1b[3;5~", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // simpleterm with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "st-256color", - Aliases: []string{"stterm-256color"}, - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "+C,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyEnd: "\x1b[4~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyClear: "\x1b[3;5~", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go b/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go deleted file mode 100644 index f83cf957..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/s/sun/term.go +++ /dev/null @@ -1,90 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package sun - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Sun Microsystems Inc. workstation console - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "sun", - Aliases: []string{"sun1", "sun2"}, - Columns: 80, - Lines: 34, - Bell: "\a", - Clear: "\f", - AttrOff: "\x1b[m", - Reverse: "\x1b[7m", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[247z", - KeyDelete: "\xff", - KeyBackspace: "\b", - KeyHome: "\x1b[214z", - KeyEnd: "\x1b[220z", - KeyPgUp: "\x1b[216z", - KeyPgDn: "\x1b[222z", - KeyF1: "\x1b[224z", - KeyF2: "\x1b[225z", - KeyF3: "\x1b[226z", - KeyF4: "\x1b[227z", - KeyF5: "\x1b[228z", - KeyF6: "\x1b[229z", - KeyF7: "\x1b[230z", - KeyF8: "\x1b[231z", - KeyF9: "\x1b[232z", - KeyF10: "\x1b[233z", - KeyF11: "\x1b[234z", - KeyF12: "\x1b[235z", - }) - - // Sun Microsystems Workstation console with color support (IA systems) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "sun-color", - Columns: 80, - Lines: 34, - Colors: 8, - Bell: "\a", - Clear: "\f", - AttrOff: "\x1b[m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[247z", - KeyDelete: "\xff", - KeyBackspace: "\b", - KeyHome: "\x1b[214z", - KeyEnd: "\x1b[220z", - KeyPgUp: "\x1b[216z", - KeyPgDn: "\x1b[222z", - KeyF1: "\x1b[224z", - KeyF2: "\x1b[225z", - KeyF3: "\x1b[226z", - KeyF4: "\x1b[227z", - KeyF5: "\x1b[228z", - KeyF6: "\x1b[229z", - KeyF7: "\x1b[230z", - KeyF8: "\x1b[231z", - KeyF9: "\x1b[232z", - KeyF10: "\x1b[233z", - KeyF11: "\x1b[234z", - KeyF12: "\x1b[235z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go deleted file mode 100644 index 62b1c5b8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/termite/term.go +++ /dev/null @@ -1,154 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package termite - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // VTE-based terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "termite", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go deleted file mode 100644 index 1c5f7a31..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi910/term.go +++ /dev/null @@ -1,39 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi910 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo model 910 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi910", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go deleted file mode 100644 index 5e52f5ce..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi912/term.go +++ /dev/null @@ -1,38 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi912 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // old televideo 912/914/920 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi912", - Aliases: []string{"tvi914", "tvi920"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - Underline: "\x1bl", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go deleted file mode 100644 index 1ec02879..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi921/term.go +++ /dev/null @@ -1,34 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi921 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo model 921 with sysline same as page & real vi function - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi921", - Columns: 80, - Lines: 24, - Clear: "\x1a", - ShowCursor: "\x1b.3", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - EnterAcs: "\x1b$", - ExitAcs: "\x1b%%", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c$<3/>", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyClear: "\x1a", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go deleted file mode 100644 index 2020ccb9..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi925/term.go +++ /dev/null @@ -1,43 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi925 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 925 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi925", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1a", - ShowCursor: "\x1b.4", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyClear: "\x1a", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go deleted file mode 100644 index fc6f2575..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi950/term.go +++ /dev/null @@ -1,46 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi950 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 950 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi950", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b*", - AttrOff: "\x1bG0", - Underline: "\x1bG8", - Reverse: "\x1bG4", - PadChar: "\x00", - AltChars: "b\tc\fd\re\ni\v", - EnterAcs: "\x15", - ExitAcs: "\x18", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\x16", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyClear: "\x1b*", - KeyBacktab: "\x1bI", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go b/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go deleted file mode 100644 index e6a1dfb1..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/t/tvi970/term.go +++ /dev/null @@ -1,40 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package tvi970 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // televideo 970 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "tvi970", - Columns: 80, - Lines: 24, - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?20l\x1b[?7h\x1b[1Q", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - PadChar: "\x00", - EnterAcs: "\x1b(B", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%df", - CursorBack1: "\b", - CursorUp1: "\x1bM", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyBackspace: "\b", - KeyHome: "\x1b[H", - KeyF1: "\x1b?a", - KeyF2: "\x1b?b", - KeyF3: "\x1b?c", - KeyF4: "\x1b?d", - KeyF5: "\x1b?e", - KeyF6: "\x1b?f", - KeyF7: "\x1b?g", - KeyF8: "\x1b?h", - KeyF9: "\x1b?i", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/terminfo.go b/vendor/github.com/gdamore/tcell/terminfo/terminfo.go deleted file mode 100644 index d0f46e93..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/terminfo.go +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package terminfo - -import ( - "bytes" - "errors" - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - "time" -) - -var ( - // ErrTermNotFound indicates that a suitable terminal entry could - // not be found. This can result from either not having TERM set, - // or from the TERM failing to support certain minimal functionality, - // in particular absolute cursor addressability (the cup capability) - // is required. For example, legacy "adm3" lacks this capability, - // whereas the slightly newer "adm3a" supports it. This failure - // occurs most often with "dumb". - ErrTermNotFound = errors.New("terminal entry not found") -) - -// Terminfo represents a terminfo entry. Note that we use friendly names -// in Go, but when we write out JSON, we use the same names as terminfo. -// The name, aliases and smous, rmous fields do not come from terminfo directly. -type Terminfo struct { - Name string - Aliases []string - Columns int // cols - Lines int // lines - Colors int // colors - Bell string // bell - Clear string // clear - EnterCA string // smcup - ExitCA string // rmcup - ShowCursor string // cnorm - HideCursor string // civis - AttrOff string // sgr0 - Underline string // smul - Bold string // bold - Blink string // blink - Reverse string // rev - Dim string // dim - EnterKeypad string // smkx - ExitKeypad string // rmkx - SetFg string // setaf - SetBg string // setab - SetCursor string // cup - CursorBack1 string // cub1 - CursorUp1 string // cuu1 - PadChar string // pad - KeyBackspace string // kbs - KeyF1 string // kf1 - KeyF2 string // kf2 - KeyF3 string // kf3 - KeyF4 string // kf4 - KeyF5 string // kf5 - KeyF6 string // kf6 - KeyF7 string // kf7 - KeyF8 string // kf8 - KeyF9 string // kf9 - KeyF10 string // kf10 - KeyF11 string // kf11 - KeyF12 string // kf12 - KeyF13 string // kf13 - KeyF14 string // kf14 - KeyF15 string // kf15 - KeyF16 string // kf16 - KeyF17 string // kf17 - KeyF18 string // kf18 - KeyF19 string // kf19 - KeyF20 string // kf20 - KeyF21 string // kf21 - KeyF22 string // kf22 - KeyF23 string // kf23 - KeyF24 string // kf24 - KeyF25 string // kf25 - KeyF26 string // kf26 - KeyF27 string // kf27 - KeyF28 string // kf28 - KeyF29 string // kf29 - KeyF30 string // kf30 - KeyF31 string // kf31 - KeyF32 string // kf32 - KeyF33 string // kf33 - KeyF34 string // kf34 - KeyF35 string // kf35 - KeyF36 string // kf36 - KeyF37 string // kf37 - KeyF38 string // kf38 - KeyF39 string // kf39 - KeyF40 string // kf40 - KeyF41 string // kf41 - KeyF42 string // kf42 - KeyF43 string // kf43 - KeyF44 string // kf44 - KeyF45 string // kf45 - KeyF46 string // kf46 - KeyF47 string // kf47 - KeyF48 string // kf48 - KeyF49 string // kf49 - KeyF50 string // kf50 - KeyF51 string // kf51 - KeyF52 string // kf52 - KeyF53 string // kf53 - KeyF54 string // kf54 - KeyF55 string // kf55 - KeyF56 string // kf56 - KeyF57 string // kf57 - KeyF58 string // kf58 - KeyF59 string // kf59 - KeyF60 string // kf60 - KeyF61 string // kf61 - KeyF62 string // kf62 - KeyF63 string // kf63 - KeyF64 string // kf64 - KeyInsert string // kich1 - KeyDelete string // kdch1 - KeyHome string // khome - KeyEnd string // kend - KeyHelp string // khlp - KeyPgUp string // kpp - KeyPgDn string // knp - KeyUp string // kcuu1 - KeyDown string // kcud1 - KeyLeft string // kcub1 - KeyRight string // kcuf1 - KeyBacktab string // kcbt - KeyExit string // kext - KeyClear string // kclr - KeyPrint string // kprt - KeyCancel string // kcan - Mouse string // kmous - MouseMode string // XM - AltChars string // acsc - EnterAcs string // smacs - ExitAcs string // rmacs - EnableAcs string // enacs - KeyShfRight string // kRIT - KeyShfLeft string // kLFT - KeyShfHome string // kHOM - KeyShfEnd string // kEND - - // These are non-standard extensions to terminfo. This includes - // true color support, and some additional keys. Its kind of bizarre - // that shifted variants of left and right exist, but not up and down. - // Terminal support for these are going to vary amongst XTerm - // emulations, so don't depend too much on them in your application. - - SetFgBg string // setfgbg - SetFgBgRGB string // setfgbgrgb - SetFgRGB string // setfrgb - SetBgRGB string // setbrgb - KeyShfUp string // shift-up - KeyShfDown string // shift-down - KeyCtrlUp string // ctrl-up - KeyCtrlDown string // ctrl-left - KeyCtrlRight string // ctrl-right - KeyCtrlLeft string // ctrl-left - KeyMetaUp string // meta-up - KeyMetaDown string // meta-left - KeyMetaRight string // meta-right - KeyMetaLeft string // meta-left - KeyAltUp string // alt-up - KeyAltDown string // alt-left - KeyAltRight string // alt-right - KeyAltLeft string // alt-left - KeyCtrlHome string - KeyCtrlEnd string - KeyMetaHome string - KeyMetaEnd string - KeyAltHome string - KeyAltEnd string - KeyAltShfUp string - KeyAltShfDown string - KeyAltShfLeft string - KeyAltShfRight string - KeyMetaShfUp string - KeyMetaShfDown string - KeyMetaShfLeft string - KeyMetaShfRight string - KeyCtrlShfUp string - KeyCtrlShfDown string - KeyCtrlShfLeft string - KeyCtrlShfRight string - KeyCtrlShfHome string - KeyCtrlShfEnd string - KeyAltShfHome string - KeyAltShfEnd string - KeyMetaShfHome string - KeyMetaShfEnd string -} - -type stackElem struct { - s string - i int - isStr bool - isInt bool -} - -type stack []stackElem - -func (st stack) Push(v string) stack { - e := stackElem{ - s: v, - isStr: true, - } - return append(st, e) -} - -func (st stack) Pop() (string, stack) { - v := "" - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isStr { - v = e.s - } else { - v = strconv.Itoa(e.i) - } - } - return v, st -} - -func (st stack) PopInt() (int, stack) { - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isInt { - return e.i, st - } else if e.isStr { - i, _ := strconv.Atoi(e.s) - return i, st - } - } - return 0, st -} - -func (st stack) PopBool() (bool, stack) { - if len(st) > 0 { - e := st[len(st)-1] - st = st[:len(st)-1] - if e.isStr { - if e.s == "1" { - return true, st - } - return false, st - } else if e.i == 1 { - return true, st - } else { - return false, st - } - } - return false, st -} - -func (st stack) PushInt(i int) stack { - e := stackElem{ - i: i, - isInt: true, - } - return append(st, e) -} - -func (st stack) PushBool(i bool) stack { - if i { - return st.PushInt(1) - } - return st.PushInt(0) -} - -func nextch(s string, index int) (byte, int) { - if index < len(s) { - return s[index], index + 1 - } - return 0, index -} - -// static vars -var svars [26]string - -// paramsBuffer handles some persistent state for TParam. Technically we -// could probably dispense with this, but caching buffer arrays gives us -// a nice little performance boost. Furthermore, we know that TParam is -// rarely (never?) called re-entrantly, so we can just reuse the same -// buffers, making it thread-safe by stashing a lock. -type paramsBuffer struct { - out bytes.Buffer - buf bytes.Buffer - lk sync.Mutex -} - -// Start initializes the params buffer with the initial string data. -// It also locks the paramsBuffer. The caller must call End() when -// finished. -func (pb *paramsBuffer) Start(s string) { - pb.lk.Lock() - pb.out.Reset() - pb.buf.Reset() - pb.buf.WriteString(s) -} - -// End returns the final output from TParam, but it also releases the lock. -func (pb *paramsBuffer) End() string { - s := pb.out.String() - pb.lk.Unlock() - return s -} - -// NextCh returns the next input character to the expander. -func (pb *paramsBuffer) NextCh() (byte, error) { - return pb.buf.ReadByte() -} - -// PutCh "emits" (rather schedules for output) a single byte character. -func (pb *paramsBuffer) PutCh(ch byte) { - pb.out.WriteByte(ch) -} - -// PutString schedules a string for output. -func (pb *paramsBuffer) PutString(s string) { - pb.out.WriteString(s) -} - -var pb = ¶msBuffer{} - -// TParm takes a terminfo parameterized string, such as setaf or cup, and -// evaluates the string, and returns the result with the parameter -// applied. -func (t *Terminfo) TParm(s string, p ...int) string { - var stk stack - var a, b string - var ai, bi int - var ab bool - var dvars [26]string - var params [9]int - - pb.Start(s) - - // make sure we always have 9 parameters -- makes it easier - // later to skip checks - for i := 0; i < len(params) && i < len(p); i++ { - params[i] = p[i] - } - - nest := 0 - - for { - - ch, err := pb.NextCh() - if err != nil { - break - } - - if ch != '%' { - pb.PutCh(ch) - continue - } - - ch, err = pb.NextCh() - if err != nil { - // XXX Error - break - } - - switch ch { - case '%': // quoted % - pb.PutCh(ch) - - case 'i': // increment both parameters (ANSI cup support) - params[0]++ - params[1]++ - - case 'c', 's': - // NB: these, and 'd' below are special cased for - // efficiency. They could be handled by the richer - // format support below, less efficiently. - a, stk = stk.Pop() - pb.PutString(a) - - case 'd': - ai, stk = stk.PopInt() - pb.PutString(strconv.Itoa(ai)) - - case '0', '1', '2', '3', '4', 'x', 'X', 'o', ':': - // This is pretty suboptimal, but this is rarely used. - // None of the mainstream terminals use any of this, - // and it would surprise me if this code is ever - // executed outside of test cases. - f := "%" - if ch == ':' { - ch, _ = pb.NextCh() - } - f += string(ch) - for ch == '+' || ch == '-' || ch == '#' || ch == ' ' { - ch, _ = pb.NextCh() - f += string(ch) - } - for (ch >= '0' && ch <= '9') || ch == '.' { - ch, _ = pb.NextCh() - f += string(ch) - } - switch ch { - case 'd', 'x', 'X', 'o': - ai, stk = stk.PopInt() - pb.PutString(fmt.Sprintf(f, ai)) - case 'c', 's': - a, stk = stk.Pop() - pb.PutString(fmt.Sprintf(f, a)) - } - - case 'p': // push parameter - ch, _ = pb.NextCh() - ai = int(ch - '1') - if ai >= 0 && ai < len(params) { - stk = stk.PushInt(params[ai]) - } else { - stk = stk.PushInt(0) - } - - case 'P': // pop & store variable - ch, _ = pb.NextCh() - if ch >= 'A' && ch <= 'Z' { - svars[int(ch-'A')], stk = stk.Pop() - } else if ch >= 'a' && ch <= 'z' { - dvars[int(ch-'a')], stk = stk.Pop() - } - - case 'g': // recall & push variable - ch, _ = pb.NextCh() - if ch >= 'A' && ch <= 'Z' { - stk = stk.Push(svars[int(ch-'A')]) - } else if ch >= 'a' && ch <= 'z' { - stk = stk.Push(dvars[int(ch-'a')]) - } - - case '\'': // push(char) - ch, _ = pb.NextCh() - pb.NextCh() // must be ' but we don't check - stk = stk.Push(string(ch)) - - case '{': // push(int) - ai = 0 - ch, _ = pb.NextCh() - for ch >= '0' && ch <= '9' { - ai *= 10 - ai += int(ch - '0') - ch, _ = pb.NextCh() - } - // ch must be '}' but no verification - stk = stk.PushInt(ai) - - case 'l': // push(strlen(pop)) - a, stk = stk.Pop() - stk = stk.PushInt(len(a)) - - case '+': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai + bi) - - case '-': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai - bi) - - case '*': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai * bi) - - case '/': - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - if bi != 0 { - stk = stk.PushInt(ai / bi) - } else { - stk = stk.PushInt(0) - } - - case 'm': // push(pop mod pop) - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - if bi != 0 { - stk = stk.PushInt(ai % bi) - } else { - stk = stk.PushInt(0) - } - - case '&': // AND - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai & bi) - - case '|': // OR - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai | bi) - - case '^': // XOR - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushInt(ai ^ bi) - - case '~': // bit complement - ai, stk = stk.PopInt() - stk = stk.PushInt(ai ^ -1) - - case '!': // logical NOT - ai, stk = stk.PopInt() - stk = stk.PushBool(ai != 0) - - case '=': // numeric compare or string compare - b, stk = stk.Pop() - a, stk = stk.Pop() - stk = stk.PushBool(a == b) - - case '>': // greater than, numeric - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushBool(ai > bi) - - case '<': // less than, numeric - bi, stk = stk.PopInt() - ai, stk = stk.PopInt() - stk = stk.PushBool(ai < bi) - - case '?': // start conditional - - case 't': - ab, stk = stk.PopBool() - if ab { - // just keep going - break - } - nest = 0 - ifloop: - // this loop consumes everything until we hit our else, - // or the end of the conditional - for { - ch, err = pb.NextCh() - if err != nil { - break - } - if ch != '%' { - continue - } - ch, _ = pb.NextCh() - switch ch { - case ';': - if nest == 0 { - break ifloop - } - nest-- - case '?': - nest++ - case 'e': - if nest == 0 { - break ifloop - } - } - } - - case 'e': - // if we got here, it means we didn't use the else - // in the 't' case above, and we should skip until - // the end of the conditional - nest = 0 - elloop: - for { - ch, err = pb.NextCh() - if err != nil { - break - } - if ch != '%' { - continue - } - ch, _ = pb.NextCh() - switch ch { - case ';': - if nest == 0 { - break elloop - } - nest-- - case '?': - nest++ - } - } - - case ';': // endif - - } - } - - return pb.End() -} - -// TPuts emits the string to the writer, but expands inline padding -// indications (of the form $<[delay]> where [delay] is msec) to -// a suitable time (unless the terminfo string indicates this isn't needed -// by specifying npc - no padding). All Terminfo based strings should be -// emitted using this function. -func (t *Terminfo) TPuts(w io.Writer, s string) { - for { - beg := strings.Index(s, "$<") - if beg < 0 { - // Most strings don't need padding, which is good news! - io.WriteString(w, s) - return - } - io.WriteString(w, s[:beg]) - s = s[beg+2:] - end := strings.Index(s, ">") - if end < 0 { - // unterminated.. just emit bytes unadulterated - io.WriteString(w, "$<"+s) - return - } - val := s[:end] - s = s[end+1:] - padus := 0 - unit := time.Millisecond - dot := false - loop: - for i := range val { - switch val[i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - padus *= 10 - padus += int(val[i] - '0') - if dot { - unit /= 10 - } - case '.': - if !dot { - dot = true - } else { - break loop - } - default: - break loop - } - } - - // Curses historically uses padding to achieve "fine grained" - // delays. We have much better clocks these days, and so we - // do not rely on padding but simply sleep a bit. - if len(t.PadChar) > 0 { - time.Sleep(unit * time.Duration(padus)) - } - } -} - -// TGoto returns a string suitable for addressing the cursor at the given -// row and column. The origin 0, 0 is in the upper left corner of the screen. -func (t *Terminfo) TGoto(col, row int) string { - return t.TParm(t.SetCursor, row, col) -} - -// TColor returns a string corresponding to the given foreground and background -// colors. Either fg or bg can be set to -1 to elide. -func (t *Terminfo) TColor(fi, bi int) string { - rv := "" - // As a special case, we map bright colors to lower versions if the - // color table only holds 8. For the remaining 240 colors, the user - // is out of luck. Someday we could create a mapping table, but its - // not worth it. - if t.Colors == 8 { - if fi > 7 && fi < 16 { - fi -= 8 - } - if bi > 7 && bi < 16 { - bi -= 8 - } - } - if t.Colors > fi && fi >= 0 { - rv += t.TParm(t.SetFg, fi) - } - if t.Colors > bi && bi >= 0 { - rv += t.TParm(t.SetBg, bi) - } - return rv -} - -var ( - dblock sync.Mutex - terminfos = make(map[string]*Terminfo) - aliases = make(map[string]string) -) - -// AddTerminfo can be called to register a new Terminfo entry. -func AddTerminfo(t *Terminfo) { - dblock.Lock() - terminfos[t.Name] = t - for _, x := range t.Aliases { - terminfos[x] = t - } - dblock.Unlock() -} - -// LookupTerminfo attempts to find a definition for the named $TERM. -func LookupTerminfo(name string) (*Terminfo, error) { - if name == "" { - // else on windows: index out of bounds - // on the name[0] reference below - return nil, ErrTermNotFound - } - - addtruecolor := false - switch os.Getenv("COLORTERM") { - case "truecolor", "24bit", "24-bit": - addtruecolor = true - } - dblock.Lock() - t := terminfos[name] - dblock.Unlock() - - // If the name ends in -truecolor, then fabricate an entry - // from the corresponding -256color, -color, or bare terminal. - if t == nil && strings.HasSuffix(name, "-truecolor") { - - suffixes := []string{ - "-256color", - "-88color", - "-color", - "", - } - base := name[:len(name)-len("-truecolor")] - for _, s := range suffixes { - if t, _ = LookupTerminfo(base + s); t != nil { - addtruecolor = true - break - } - } - } - - if t == nil { - return nil, ErrTermNotFound - } - - switch os.Getenv("TCELL_TRUECOLOR") { - case "": - case "disable": - addtruecolor = false - default: - addtruecolor = true - } - - // If the user has requested 24-bit color with $COLORTERM, then - // amend the value (unless already present). This means we don't - // need to have a value present. - if addtruecolor && - t.SetFgBgRGB == "" && - t.SetFgRGB == "" && - t.SetBgRGB == "" { - - // Supply vanilla ISO 8613-6:1994 24-bit color sequences. - t.SetFgRGB = "\x1b[38;2;%p1%d;%p2%d;%p3%dm" - t.SetBgRGB = "\x1b[48;2;%p1%d;%p2%d;%p3%dm" - t.SetFgBgRGB = "\x1b[38;2;%p1%d;%p2%d;%p3%d;" + - "48;2;%p4%d;%p5%d;%p6%dm" - } - - return t, nil -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go deleted file mode 100644 index 666e8b11..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt100/term.go +++ /dev/null @@ -1,48 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt100 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt100 (w/advanced video) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt100", - Aliases: []string{"vt100-am"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<50>", - AttrOff: "\x1b[m\x0f$<2>", - Underline: "\x1b[4m$<2>", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", - CursorBack1: "\b", - CursorUp1: "\x1b[A$<2>", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1bOt", - KeyF6: "\x1bOu", - KeyF7: "\x1bOv", - KeyF8: "\x1bOl", - KeyF9: "\x1bOw", - KeyF10: "\x1bOx", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go deleted file mode 100644 index 0dfbe61c..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt102/term.go +++ /dev/null @@ -1,47 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt102 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt102 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt102", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<50>", - AttrOff: "\x1b[m\x0f$<2>", - Underline: "\x1b[4m$<2>", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b(B\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", - CursorBack1: "\b", - CursorUp1: "\x1b[A$<2>", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1bOt", - KeyF6: "\x1bOu", - KeyF7: "\x1bOv", - KeyF8: "\x1bOl", - KeyF9: "\x1bOw", - KeyF10: "\x1bOx", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go deleted file mode 100644 index 9104b173..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt220/term.go +++ /dev/null @@ -1,58 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt220 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt220 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt220", - Aliases: []string{"vt200"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0$<2>", - ExitAcs: "\x1b(B$<4>", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - KeyHelp: "\x1b[28~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go deleted file mode 100644 index 29bd0d39..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt320/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt320 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt320 7 bit terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt320", - Aliases: []string{"vt300"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1b[1~", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[25~", - KeyF14: "\x1b[26~", - KeyF15: "\x1b[28~", - KeyF16: "\x1b[29~", - KeyF17: "\x1b[31~", - KeyF18: "\x1b[32~", - KeyF19: "\x1b[33~", - KeyF20: "\x1b[34~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go deleted file mode 100644 index 4c7b8bc0..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt400/term.go +++ /dev/null @@ -1,46 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt400 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt400 24x80 column autowrap - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt400", - Aliases: []string{"vt400-24", "dec-vt400"}, - Columns: 80, - Lines: 24, - Clear: "\x1b[H\x1b[J$<10/>", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go deleted file mode 100644 index 5ec1cef7..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt420/term.go +++ /dev/null @@ -1,53 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt420 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // DEC VT420 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt420", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b[H\x1b[2J$<50>", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x1b(B$<2>", - Underline: "\x1b[4m", - Bold: "\x1b[1m$<2>", - Blink: "\x1b[5m$<2>", - Reverse: "\x1b[7m$<2>", - EnterKeypad: "\x1b=", - ExitKeypad: "\x1b>", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0$<2>", - ExitAcs: "\x1b(B$<4>", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH$<10>", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1b[A", - KeyDown: "\x1b[B", - KeyRight: "\x1b[C", - KeyLeft: "\x1b[D", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\b", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[17~", - KeyF6: "\x1b[18~", - KeyF7: "\x1b[19~", - KeyF8: "\x1b[20~", - KeyF9: "\x1b[21~", - KeyF10: "\x1b[29~", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go b/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go deleted file mode 100644 index c9560aef..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/v/vt52/term.go +++ /dev/null @@ -1,29 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package vt52 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // dec vt52 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "vt52", - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1bH\x1bJ", - PadChar: "\x00", - AltChars: "+h.k0affggolpnqprrss", - EnterAcs: "\x1bF", - ExitAcs: "\x1bG", - SetCursor: "\x1bY%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\x1bD", - CursorUp1: "\x1bA", - KeyUp: "\x1bA", - KeyDown: "\x1bB", - KeyRight: "\x1bC", - KeyLeft: "\x1bD", - KeyBackspace: "\b", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go deleted file mode 100644 index 4521932f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy50/term.go +++ /dev/null @@ -1,59 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy50 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse 50 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy50", - Aliases: []string{"wyse50"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b+$<20>", - ShowCursor: "\x1b`1", - HideCursor: "\x1b`0", - AttrOff: "\x1b(\x1bH\x03", - Dim: "\x1b`7\x1b)", - Reverse: "\x1b`6\x1b)", - PadChar: "\x00", - AltChars: "0wa_h[jukslrmqnxqzttuyv]wpxv", - EnterAcs: "\x1bH\x02", - ExitAcs: "\x1bH\x03", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyPgUp: "\x1bJ", - KeyPgDn: "\x1bK", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyF10: "\x01I\r", - KeyF11: "\x01J\r", - KeyF12: "\x01K\r", - KeyF13: "\x01L\r", - KeyF14: "\x01M\r", - KeyF15: "\x01N\r", - KeyF16: "\x01O\r", - KeyPrint: "\x1bP", - KeyBacktab: "\x1bI", - KeyShfHome: "\x1b{", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go deleted file mode 100644 index ff519408..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy60/term.go +++ /dev/null @@ -1,63 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy60 - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse 60 - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy60", - Aliases: []string{"wyse60"}, - Columns: 80, - Lines: 24, - Bell: "\a", - Clear: "\x1b+$<100>", - EnterCA: "\x1bw0", - ExitCA: "\x1bw1", - ShowCursor: "\x1b`1", - HideCursor: "\x1b`0", - AttrOff: "\x1b(\x1bH\x03\x1bG0\x1bcD", - Underline: "\x1bG8", - Dim: "\x1bGp", - Blink: "\x1bG2", - Reverse: "\x1bG4", - PadChar: "\x00", - AltChars: "+/,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~", - EnterAcs: "\x1bcE", - ExitAcs: "\x1bcD", - SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", - CursorBack1: "\b", - CursorUp1: "\v", - KeyUp: "\v", - KeyDown: "\n", - KeyRight: "\f", - KeyLeft: "\b", - KeyInsert: "\x1bQ", - KeyDelete: "\x1bW", - KeyBackspace: "\b", - KeyHome: "\x1e", - KeyPgUp: "\x1bJ", - KeyPgDn: "\x1bK", - KeyF1: "\x01@\r", - KeyF2: "\x01A\r", - KeyF3: "\x01B\r", - KeyF4: "\x01C\r", - KeyF5: "\x01D\r", - KeyF6: "\x01E\r", - KeyF7: "\x01F\r", - KeyF8: "\x01G\r", - KeyF9: "\x01H\r", - KeyF10: "\x01I\r", - KeyF11: "\x01J\r", - KeyF12: "\x01K\r", - KeyF13: "\x01L\r", - KeyF14: "\x01M\r", - KeyF15: "\x01N\r", - KeyF16: "\x01O\r", - KeyPrint: "\x1bP", - KeyBacktab: "\x1bI", - KeyShfHome: "\x1b{", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go b/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go deleted file mode 100644 index fbe85699..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/w/wy99_ansi/term.go +++ /dev/null @@ -1,114 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package wy99_ansi - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Wyse WY-99GT in ansi mode (int'l PC keyboard) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy99-ansi", - Columns: 80, - Lines: 25, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<200>", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f\x1b[\"q", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooqqssttuuvvwwxx{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b$<1>", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[M", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF17: "\x1b[K", - KeyF18: "\x1b[31~", - KeyF19: "\x1b[32~", - KeyF20: "\x1b[33~", - KeyF21: "\x1b[34~", - KeyF22: "\x1b[35~", - KeyF23: "\x1b[1~", - KeyF24: "\x1b[2~", - KeyBacktab: "\x1b[z", - }) - - // Wyse WY-99GT in ansi mode (US PC keyboard) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "wy99a-ansi", - Columns: 80, - Lines: 25, - Bell: "\a", - Clear: "\x1b[H\x1b[J$<200>", - ShowCursor: "\x1b[34h\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[m\x0f\x1b[\"q", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - PadChar: "\x00", - AltChars: "``aaffggjjkkllmmnnooqqssttuuvvwwxx{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b$<1>", - CursorUp1: "\x1bM", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\b", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[M", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF17: "\x1b[K", - KeyF18: "\x1b[31~", - KeyF19: "\x1b[32~", - KeyF20: "\x1b[33~", - KeyF21: "\x1b[34~", - KeyF22: "\x1b[35~", - KeyF23: "\x1b[1~", - KeyF24: "\x1b[2~", - KeyBacktab: "\x1b[z", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go deleted file mode 100644 index 219cc6fd..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xfce/term.go +++ /dev/null @@ -1,156 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xfce - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Xfce Terminal - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xfce", - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b7\x1b[?47h", - ExitCA: "\x1b[2J\x1b[?47l\x1b8", - ShowCursor: "\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b[0m\x0f", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x0e", - ExitAcs: "\x0f", - EnableAcs: "\x1b)0", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1bO1;2P", - KeyF14: "\x1bO1;2Q", - KeyF15: "\x1bO1;2R", - KeyF16: "\x1bO1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1bO1;5P", - KeyF26: "\x1bO1;5Q", - KeyF27: "\x1bO1;5R", - KeyF28: "\x1bO1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1bO1;6P", - KeyF38: "\x1bO1;6Q", - KeyF39: "\x1bO1;6R", - KeyF40: "\x1bO1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1bO1;3P", - KeyF50: "\x1bO1;3Q", - KeyF51: "\x1bO1;3R", - KeyF52: "\x1bO1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1bO1;4P", - KeyF62: "\x1bO1;4Q", - KeyF63: "\x1bO1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go deleted file mode 100644 index b1f9ad78..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xnuppc/term.go +++ /dev/null @@ -1,34 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xnuppc - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // Darwin PowerPC Console (color) - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xnuppc", - Aliases: []string{"darwin"}, - Colors: 8, - Clear: "\x1b[H\x1b[J", - AttrOff: "\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - PadChar: "\x00", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\x1b[D", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyBackspace: "\xff", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go deleted file mode 100644 index 0e4c175f..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xterm/term.go +++ /dev/null @@ -1,453 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xterm - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // X11 terminal emulator - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm", - Aliases: []string{"xterm-debian"}, - Columns: 80, - Lines: 24, - Colors: 8, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[3%p1%dm", - SetBg: "\x1b[4%p1%dm", - SetFgBg: "\x1b[3%p1%d;4%p2%dm", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // xterm with 88 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-88color", - Columns: 80, - Lines: 24, - Colors: 88, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) - - // xterm with 256 colors - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-256color", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h\x1b[22;0;0t", - ExitCA: "\x1b[?1049l\x1b[23;0;0t", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Blink: "\x1b[5m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h\x1b=", - ExitKeypad: "\x1b[?1l\x1b>", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go b/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go deleted file mode 100644 index 8a8d69b8..00000000 --- a/vendor/github.com/gdamore/tcell/terminfo/x/xterm_kitty/term.go +++ /dev/null @@ -1,155 +0,0 @@ -// Generated automatically. DO NOT HAND-EDIT. - -package xterm_kitty - -import "github.com/gdamore/tcell/terminfo" - -func init() { - - // KovIdTTY - terminfo.AddTerminfo(&terminfo.Terminfo{ - Name: "xterm-kitty", - Columns: 80, - Lines: 24, - Colors: 256, - Bell: "\a", - Clear: "\x1b[H\x1b[2J", - EnterCA: "\x1b[?1049h", - ExitCA: "\x1b[?1049l", - ShowCursor: "\x1b[?12l\x1b[?25h", - HideCursor: "\x1b[?25l", - AttrOff: "\x1b(B\x1b[m", - Underline: "\x1b[4m", - Bold: "\x1b[1m", - Dim: "\x1b[2m", - Reverse: "\x1b[7m", - EnterKeypad: "\x1b[?1h", - ExitKeypad: "\x1b[?1l", - SetFg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m", - SetBg: "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m", - SetFgBg: "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;;%?%p2%{8}%<%t4%p2%d%e%p2%{16}%<%t10%p2%{8}%-%d%e48;5;%p2%d%;m", - AltChars: "++,,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", - EnterAcs: "\x1b(0", - ExitAcs: "\x1b(B", - Mouse: "\x1b[M", - MouseMode: "%?%p1%{1}%=%t%'h'%Pa%e%'l'%Pa%;\x1b[?1000%ga%c\x1b[?1002%ga%c\x1b[?1003%ga%c\x1b[?1006%ga%c", - SetCursor: "\x1b[%i%p1%d;%p2%dH", - CursorBack1: "\b", - CursorUp1: "\x1b[A", - KeyUp: "\x1bOA", - KeyDown: "\x1bOB", - KeyRight: "\x1bOC", - KeyLeft: "\x1bOD", - KeyInsert: "\x1b[2~", - KeyDelete: "\x1b[3~", - KeyBackspace: "\xff", - KeyHome: "\x1bOH", - KeyEnd: "\x1bOF", - KeyPgUp: "\x1b[5~", - KeyPgDn: "\x1b[6~", - KeyF1: "\x1bOP", - KeyF2: "\x1bOQ", - KeyF3: "\x1bOR", - KeyF4: "\x1bOS", - KeyF5: "\x1b[15~", - KeyF6: "\x1b[17~", - KeyF7: "\x1b[18~", - KeyF8: "\x1b[19~", - KeyF9: "\x1b[20~", - KeyF10: "\x1b[21~", - KeyF11: "\x1b[23~", - KeyF12: "\x1b[24~", - KeyF13: "\x1b[1;2P", - KeyF14: "\x1b[1;2Q", - KeyF15: "\x1b[1;2R", - KeyF16: "\x1b[1;2S", - KeyF17: "\x1b[15;2~", - KeyF18: "\x1b[17;2~", - KeyF19: "\x1b[18;2~", - KeyF20: "\x1b[19;2~", - KeyF21: "\x1b[20;2~", - KeyF22: "\x1b[21;2~", - KeyF23: "\x1b[23;2~", - KeyF24: "\x1b[24;2~", - KeyF25: "\x1b[1;5P", - KeyF26: "\x1b[1;5Q", - KeyF27: "\x1b[1;5R", - KeyF28: "\x1b[1;5S", - KeyF29: "\x1b[15;5~", - KeyF30: "\x1b[17;5~", - KeyF31: "\x1b[18;5~", - KeyF32: "\x1b[19;5~", - KeyF33: "\x1b[20;5~", - KeyF34: "\x1b[21;5~", - KeyF35: "\x1b[23;5~", - KeyF36: "\x1b[24;5~", - KeyF37: "\x1b[1;6P", - KeyF38: "\x1b[1;6Q", - KeyF39: "\x1b[1;6R", - KeyF40: "\x1b[1;6S", - KeyF41: "\x1b[15;6~", - KeyF42: "\x1b[17;6~", - KeyF43: "\x1b[18;6~", - KeyF44: "\x1b[19;6~", - KeyF45: "\x1b[20;6~", - KeyF46: "\x1b[21;6~", - KeyF47: "\x1b[23;6~", - KeyF48: "\x1b[24;6~", - KeyF49: "\x1b[1;3P", - KeyF50: "\x1b[1;3Q", - KeyF51: "\x1b[1;3R", - KeyF52: "\x1b[1;3S", - KeyF53: "\x1b[15;3~", - KeyF54: "\x1b[17;3~", - KeyF55: "\x1b[18;3~", - KeyF56: "\x1b[19;3~", - KeyF57: "\x1b[20;3~", - KeyF58: "\x1b[21;3~", - KeyF59: "\x1b[23;3~", - KeyF60: "\x1b[24;3~", - KeyF61: "\x1b[1;4P", - KeyF62: "\x1b[1;4Q", - KeyF63: "\x1b[1;4R", - KeyBacktab: "\x1b[Z", - KeyShfLeft: "\x1b[1;2D", - KeyShfRight: "\x1b[1;2C", - KeyShfUp: "\x1b[1;2A", - KeyShfDown: "\x1b[1;2B", - KeyCtrlLeft: "\x1b[1;5D", - KeyCtrlRight: "\x1b[1;5C", - KeyCtrlUp: "\x1b[1;5A", - KeyCtrlDown: "\x1b[1;5B", - KeyMetaLeft: "\x1b[1;9D", - KeyMetaRight: "\x1b[1;9C", - KeyMetaUp: "\x1b[1;9A", - KeyMetaDown: "\x1b[1;9B", - KeyAltLeft: "\x1b[1;3D", - KeyAltRight: "\x1b[1;3C", - KeyAltUp: "\x1b[1;3A", - KeyAltDown: "\x1b[1;3B", - KeyAltShfLeft: "\x1b[1;4D", - KeyAltShfRight: "\x1b[1;4C", - KeyAltShfUp: "\x1b[1;4A", - KeyAltShfDown: "\x1b[1;4B", - KeyMetaShfLeft: "\x1b[1;10D", - KeyMetaShfRight: "\x1b[1;10C", - KeyMetaShfUp: "\x1b[1;10A", - KeyMetaShfDown: "\x1b[1;10B", - KeyCtrlShfLeft: "\x1b[1;6D", - KeyCtrlShfRight: "\x1b[1;6C", - KeyCtrlShfUp: "\x1b[1;6A", - KeyCtrlShfDown: "\x1b[1;6B", - KeyShfHome: "\x1b[1;2H", - KeyShfEnd: "\x1b[1;2F", - KeyCtrlHome: "\x1b[1;5H", - KeyCtrlEnd: "\x1b[1;5F", - KeyAltHome: "\x1b[1;9H", - KeyAltEnd: "\x1b[1;9F", - KeyCtrlShfHome: "\x1b[1;6H", - KeyCtrlShfEnd: "\x1b[1;6F", - KeyMetaShfHome: "\x1b[1;10H", - KeyMetaShfEnd: "\x1b[1;10F", - KeyAltShfHome: "\x1b[1;4H", - KeyAltShfEnd: "\x1b[1;4F", - }) -} diff --git a/vendor/github.com/gdamore/tcell/terms_default.go b/vendor/github.com/gdamore/tcell/terms_default.go deleted file mode 100644 index cf2dbaab..00000000 --- a/vendor/github.com/gdamore/tcell/terms_default.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !tcell_minimal - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - // This imports the default terminal entries. To disable, use the - // tcell_minimal build tag. - _ "github.com/gdamore/tcell/terminfo/extended" -) diff --git a/vendor/github.com/gdamore/tcell/terms_dynamic.go b/vendor/github.com/gdamore/tcell/terms_dynamic.go deleted file mode 100644 index a06c087c..00000000 --- a/vendor/github.com/gdamore/tcell/terms_dynamic.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build !tcell_minimal,!nacl,!js,!zos,!plan9,!windows,!android - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - // This imports a dynamic version of the terminal database, which - // is built using infocmp. This relies on a working installation - // of infocmp (typically supplied with ncurses). We only do this - // for systems likely to have that -- i.e. UNIX based hosts. We - // also don't support Android here, because you really don't want - // to run external programs there. Generally the android terminals - // will be automatically included anyway. - "github.com/gdamore/tcell/terminfo" - "github.com/gdamore/tcell/terminfo/dynamic" -) - -func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { - ti, _, e := dynamic.LoadTerminfo(term) - if e != nil { - return nil, e - } - return ti, nil -} diff --git a/vendor/github.com/gdamore/tcell/terms_static.go b/vendor/github.com/gdamore/tcell/terms_static.go deleted file mode 100644 index 379dbe1b..00000000 --- a/vendor/github.com/gdamore/tcell/terms_static.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build tcell_minimal nacl js zos plan9 windows android - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "errors" - - "github.com/gdamore/tcell/terminfo" -) - -func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { - return nil, errors.New("terminal type unsupported") -} diff --git a/vendor/github.com/gdamore/tcell/tscreen.go b/vendor/github.com/gdamore/tcell/tscreen.go deleted file mode 100644 index b86a6c47..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen.go +++ /dev/null @@ -1,1434 +0,0 @@ -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "bytes" - "io" - "os" - "strconv" - "sync" - "time" - "unicode/utf8" - - "golang.org/x/text/transform" - - "github.com/gdamore/tcell/terminfo" - - // import the stock terminals - _ "github.com/gdamore/tcell/terminfo/base" -) - -// NewTerminfoScreen returns a Screen that uses the stock TTY interface -// and POSIX termios, combined with a terminfo description taken from -// the $TERM environment variable. It returns an error if the terminal -// is not supported for any reason. -// -// For terminals that do not support dynamic resize events, the $LINES -// $COLUMNS environment variables can be set to the actual window size, -// otherwise defaults taken from the terminal database are used. -func NewTerminfoScreen() (Screen, error) { - ti, e := terminfo.LookupTerminfo(os.Getenv("TERM")) - if e != nil { - ti, e = loadDynamicTerminfo(os.Getenv("TERM")) - if e != nil { - return nil, e - } - terminfo.AddTerminfo(ti) - } - t := &tScreen{ti: ti} - - t.keyexist = make(map[Key]bool) - t.keycodes = make(map[string]*tKeyCode) - if len(ti.Mouse) > 0 { - t.mouse = []byte(ti.Mouse) - } - t.prepareKeys() - t.buildAcsMap() - t.sigwinch = make(chan os.Signal, 10) - t.fallback = make(map[rune]string) - for k, v := range RuneFallbacks { - t.fallback[k] = v - } - - return t, nil -} - -// tKeyCode represents a combination of a key code and modifiers. -type tKeyCode struct { - key Key - mod ModMask -} - -// tScreen represents a screen backed by a terminfo implementation. -type tScreen struct { - ti *terminfo.Terminfo - h int - w int - fini bool - cells CellBuffer - in *os.File - out *os.File - buffering bool // true if we are collecting writes to buf instead of sending directly to out - buf bytes.Buffer - curstyle Style - style Style - evch chan Event - sigwinch chan os.Signal - quit chan struct{} - indoneq chan struct{} - keyexist map[Key]bool - keycodes map[string]*tKeyCode - keychan chan []byte - keytimer *time.Timer - keyexpire time.Time - cx int - cy int - mouse []byte - clear bool - cursorx int - cursory int - tiosp *termiosPrivate - wasbtn bool - acs map[rune]string - charset string - encoder transform.Transformer - decoder transform.Transformer - fallback map[rune]string - colors map[Color]Color - palette []Color - truecolor bool - escaped bool - buttondn bool - - sync.Mutex -} - -func (t *tScreen) Init() error { - t.evch = make(chan Event, 10) - t.indoneq = make(chan struct{}) - t.keychan = make(chan []byte, 10) - t.keytimer = time.NewTimer(time.Millisecond * 50) - t.charset = "UTF-8" - - t.charset = getCharset() - if enc := GetEncoding(t.charset); enc != nil { - t.encoder = enc.NewEncoder() - t.decoder = enc.NewDecoder() - } else { - return ErrNoCharset - } - ti := t.ti - - // environment overrides - w := ti.Columns - h := ti.Lines - if i, _ := strconv.Atoi(os.Getenv("LINES")); i != 0 { - h = i - } - if i, _ := strconv.Atoi(os.Getenv("COLUMNS")); i != 0 { - w = i - } - if e := t.termioInit(); e != nil { - return e - } - - if t.ti.SetFgBgRGB != "" || t.ti.SetFgRGB != "" || t.ti.SetBgRGB != "" { - t.truecolor = true - } - // A user who wants to have his themes honored can - // set this environment variable. - if os.Getenv("TCELL_TRUECOLOR") == "disable" { - t.truecolor = false - } - if !t.truecolor { - t.colors = make(map[Color]Color) - t.palette = make([]Color, t.Colors()) - for i := 0; i < t.Colors(); i++ { - t.palette[i] = Color(i) - // identity map for our builtin colors - t.colors[Color(i)] = Color(i) - } - } - - t.TPuts(ti.EnterCA) - t.TPuts(ti.HideCursor) - t.TPuts(ti.EnableAcs) - t.TPuts(ti.Clear) - - t.quit = make(chan struct{}) - - t.Lock() - t.cx = -1 - t.cy = -1 - t.style = StyleDefault - t.cells.Resize(w, h) - t.cursorx = -1 - t.cursory = -1 - t.resize() - t.Unlock() - - go t.mainLoop() - go t.inputLoop() - - return nil -} - -func (t *tScreen) prepareKeyMod(key Key, mod ModMask, val string) { - if val != "" { - // Do not overrride codes that already exist - if _, exist := t.keycodes[val]; !exist { - t.keyexist[key] = true - t.keycodes[val] = &tKeyCode{key: key, mod: mod} - } - } -} - -func (t *tScreen) prepareKey(key Key, val string) { - t.prepareKeyMod(key, ModNone, val) -} - -func (t *tScreen) prepareKeys() { - ti := t.ti - t.prepareKey(KeyBackspace, ti.KeyBackspace) - t.prepareKey(KeyF1, ti.KeyF1) - t.prepareKey(KeyF2, ti.KeyF2) - t.prepareKey(KeyF3, ti.KeyF3) - t.prepareKey(KeyF4, ti.KeyF4) - t.prepareKey(KeyF5, ti.KeyF5) - t.prepareKey(KeyF6, ti.KeyF6) - t.prepareKey(KeyF7, ti.KeyF7) - t.prepareKey(KeyF8, ti.KeyF8) - t.prepareKey(KeyF9, ti.KeyF9) - t.prepareKey(KeyF10, ti.KeyF10) - t.prepareKey(KeyF11, ti.KeyF11) - t.prepareKey(KeyF12, ti.KeyF12) - t.prepareKey(KeyF13, ti.KeyF13) - t.prepareKey(KeyF14, ti.KeyF14) - t.prepareKey(KeyF15, ti.KeyF15) - t.prepareKey(KeyF16, ti.KeyF16) - t.prepareKey(KeyF17, ti.KeyF17) - t.prepareKey(KeyF18, ti.KeyF18) - t.prepareKey(KeyF19, ti.KeyF19) - t.prepareKey(KeyF20, ti.KeyF20) - t.prepareKey(KeyF21, ti.KeyF21) - t.prepareKey(KeyF22, ti.KeyF22) - t.prepareKey(KeyF23, ti.KeyF23) - t.prepareKey(KeyF24, ti.KeyF24) - t.prepareKey(KeyF25, ti.KeyF25) - t.prepareKey(KeyF26, ti.KeyF26) - t.prepareKey(KeyF27, ti.KeyF27) - t.prepareKey(KeyF28, ti.KeyF28) - t.prepareKey(KeyF29, ti.KeyF29) - t.prepareKey(KeyF30, ti.KeyF30) - t.prepareKey(KeyF31, ti.KeyF31) - t.prepareKey(KeyF32, ti.KeyF32) - t.prepareKey(KeyF33, ti.KeyF33) - t.prepareKey(KeyF34, ti.KeyF34) - t.prepareKey(KeyF35, ti.KeyF35) - t.prepareKey(KeyF36, ti.KeyF36) - t.prepareKey(KeyF37, ti.KeyF37) - t.prepareKey(KeyF38, ti.KeyF38) - t.prepareKey(KeyF39, ti.KeyF39) - t.prepareKey(KeyF40, ti.KeyF40) - t.prepareKey(KeyF41, ti.KeyF41) - t.prepareKey(KeyF42, ti.KeyF42) - t.prepareKey(KeyF43, ti.KeyF43) - t.prepareKey(KeyF44, ti.KeyF44) - t.prepareKey(KeyF45, ti.KeyF45) - t.prepareKey(KeyF46, ti.KeyF46) - t.prepareKey(KeyF47, ti.KeyF47) - t.prepareKey(KeyF48, ti.KeyF48) - t.prepareKey(KeyF49, ti.KeyF49) - t.prepareKey(KeyF50, ti.KeyF50) - t.prepareKey(KeyF51, ti.KeyF51) - t.prepareKey(KeyF52, ti.KeyF52) - t.prepareKey(KeyF53, ti.KeyF53) - t.prepareKey(KeyF54, ti.KeyF54) - t.prepareKey(KeyF55, ti.KeyF55) - t.prepareKey(KeyF56, ti.KeyF56) - t.prepareKey(KeyF57, ti.KeyF57) - t.prepareKey(KeyF58, ti.KeyF58) - t.prepareKey(KeyF59, ti.KeyF59) - t.prepareKey(KeyF60, ti.KeyF60) - t.prepareKey(KeyF61, ti.KeyF61) - t.prepareKey(KeyF62, ti.KeyF62) - t.prepareKey(KeyF63, ti.KeyF63) - t.prepareKey(KeyF64, ti.KeyF64) - t.prepareKey(KeyInsert, ti.KeyInsert) - t.prepareKey(KeyDelete, ti.KeyDelete) - t.prepareKey(KeyHome, ti.KeyHome) - t.prepareKey(KeyEnd, ti.KeyEnd) - t.prepareKey(KeyUp, ti.KeyUp) - t.prepareKey(KeyDown, ti.KeyDown) - t.prepareKey(KeyLeft, ti.KeyLeft) - t.prepareKey(KeyRight, ti.KeyRight) - t.prepareKey(KeyPgUp, ti.KeyPgUp) - t.prepareKey(KeyPgDn, ti.KeyPgDn) - t.prepareKey(KeyHelp, ti.KeyHelp) - t.prepareKey(KeyPrint, ti.KeyPrint) - t.prepareKey(KeyCancel, ti.KeyCancel) - t.prepareKey(KeyExit, ti.KeyExit) - t.prepareKey(KeyBacktab, ti.KeyBacktab) - - t.prepareKeyMod(KeyRight, ModShift, ti.KeyShfRight) - t.prepareKeyMod(KeyLeft, ModShift, ti.KeyShfLeft) - t.prepareKeyMod(KeyUp, ModShift, ti.KeyShfUp) - t.prepareKeyMod(KeyDown, ModShift, ti.KeyShfDown) - t.prepareKeyMod(KeyHome, ModShift, ti.KeyShfHome) - t.prepareKeyMod(KeyEnd, ModShift, ti.KeyShfEnd) - - t.prepareKeyMod(KeyRight, ModCtrl, ti.KeyCtrlRight) - t.prepareKeyMod(KeyLeft, ModCtrl, ti.KeyCtrlLeft) - t.prepareKeyMod(KeyUp, ModCtrl, ti.KeyCtrlUp) - t.prepareKeyMod(KeyDown, ModCtrl, ti.KeyCtrlDown) - t.prepareKeyMod(KeyHome, ModCtrl, ti.KeyCtrlHome) - t.prepareKeyMod(KeyEnd, ModCtrl, ti.KeyCtrlEnd) - - t.prepareKeyMod(KeyRight, ModAlt, ti.KeyAltRight) - t.prepareKeyMod(KeyLeft, ModAlt, ti.KeyAltLeft) - t.prepareKeyMod(KeyUp, ModAlt, ti.KeyAltUp) - t.prepareKeyMod(KeyDown, ModAlt, ti.KeyAltDown) - t.prepareKeyMod(KeyHome, ModAlt, ti.KeyAltHome) - t.prepareKeyMod(KeyEnd, ModAlt, ti.KeyAltEnd) - - t.prepareKeyMod(KeyRight, ModAlt, ti.KeyMetaRight) - t.prepareKeyMod(KeyLeft, ModAlt, ti.KeyMetaLeft) - t.prepareKeyMod(KeyUp, ModAlt, ti.KeyMetaUp) - t.prepareKeyMod(KeyDown, ModAlt, ti.KeyMetaDown) - t.prepareKeyMod(KeyHome, ModAlt, ti.KeyMetaHome) - t.prepareKeyMod(KeyEnd, ModAlt, ti.KeyMetaEnd) - - t.prepareKeyMod(KeyRight, ModAlt|ModShift, ti.KeyAltShfRight) - t.prepareKeyMod(KeyLeft, ModAlt|ModShift, ti.KeyAltShfLeft) - t.prepareKeyMod(KeyUp, ModAlt|ModShift, ti.KeyAltShfUp) - t.prepareKeyMod(KeyDown, ModAlt|ModShift, ti.KeyAltShfDown) - t.prepareKeyMod(KeyHome, ModAlt|ModShift, ti.KeyAltShfHome) - t.prepareKeyMod(KeyEnd, ModAlt|ModShift, ti.KeyAltShfEnd) - - t.prepareKeyMod(KeyRight, ModAlt|ModShift, ti.KeyMetaShfRight) - t.prepareKeyMod(KeyLeft, ModAlt|ModShift, ti.KeyMetaShfLeft) - t.prepareKeyMod(KeyUp, ModAlt|ModShift, ti.KeyMetaShfUp) - t.prepareKeyMod(KeyDown, ModAlt|ModShift, ti.KeyMetaShfDown) - t.prepareKeyMod(KeyHome, ModAlt|ModShift, ti.KeyMetaShfHome) - t.prepareKeyMod(KeyEnd, ModAlt|ModShift, ti.KeyMetaShfEnd) - - t.prepareKeyMod(KeyRight, ModCtrl|ModShift, ti.KeyCtrlShfRight) - t.prepareKeyMod(KeyLeft, ModCtrl|ModShift, ti.KeyCtrlShfLeft) - t.prepareKeyMod(KeyUp, ModCtrl|ModShift, ti.KeyCtrlShfUp) - t.prepareKeyMod(KeyDown, ModCtrl|ModShift, ti.KeyCtrlShfDown) - t.prepareKeyMod(KeyHome, ModCtrl|ModShift, ti.KeyCtrlShfHome) - t.prepareKeyMod(KeyEnd, ModCtrl|ModShift, ti.KeyCtrlShfEnd) - - // Sadly, xterm handling of keycodes is somewhat erratic. In - // particular, different codes are sent depending on application - // mode is in use or not, and the entries for many of these are - // simply absent from terminfo on many systems. So we insert - // a number of escape sequences if they are not already used, in - // order to have the widest correct usage. Note that prepareKey - // will not inject codes if the escape sequence is already known. - // We also only do this for terminals that have the application - // mode present. - - // Cursor mode - if ti.EnterKeypad != "" { - t.prepareKey(KeyUp, "\x1b[A") - t.prepareKey(KeyDown, "\x1b[B") - t.prepareKey(KeyRight, "\x1b[C") - t.prepareKey(KeyLeft, "\x1b[D") - t.prepareKey(KeyEnd, "\x1b[F") - t.prepareKey(KeyHome, "\x1b[H") - t.prepareKey(KeyDelete, "\x1b[3~") - t.prepareKey(KeyHome, "\x1b[1~") - t.prepareKey(KeyEnd, "\x1b[4~") - t.prepareKey(KeyPgUp, "\x1b[5~") - t.prepareKey(KeyPgDn, "\x1b[6~") - - // Application mode - t.prepareKey(KeyUp, "\x1bOA") - t.prepareKey(KeyDown, "\x1bOB") - t.prepareKey(KeyRight, "\x1bOC") - t.prepareKey(KeyLeft, "\x1bOD") - t.prepareKey(KeyHome, "\x1bOH") - } - -outer: - // Add key mappings for control keys. - for i := 0; i < ' '; i++ { - // Do not insert direct key codes for ambiguous keys. - // For example, ESC is used for lots of other keys, so - // when parsing this we don't want to fast path handling - // of it, but instead wait a bit before parsing it as in - // isolation. - for esc := range t.keycodes { - if []byte(esc)[0] == byte(i) { - continue outer - } - } - - t.keyexist[Key(i)] = true - - mod := ModCtrl - switch Key(i) { - case KeyBS, KeyTAB, KeyESC, KeyCR: - // directly typeable- no control sequence - mod = ModNone - } - t.keycodes[string(rune(i))] = &tKeyCode{key: Key(i), mod: mod} - } -} - -func (t *tScreen) Fini() { - t.Lock() - defer t.Unlock() - - ti := t.ti - t.cells.Resize(0, 0) - t.TPuts(ti.ShowCursor) - t.TPuts(ti.AttrOff) - t.TPuts(ti.Clear) - t.TPuts(ti.ExitCA) - t.TPuts(ti.ExitKeypad) - t.TPuts(ti.TParm(ti.MouseMode, 0)) - t.curstyle = Style(-1) - t.clear = false - t.fini = true - - select { - case <-t.quit: - // do nothing, already closed - - default: - close(t.quit) - } - - t.termioFini() -} - -func (t *tScreen) SetStyle(style Style) { - t.Lock() - if !t.fini { - t.style = style - } - t.Unlock() -} - -func (t *tScreen) Clear() { - t.Fill(' ', t.style) -} - -func (t *tScreen) Fill(r rune, style Style) { - t.Lock() - if !t.fini { - t.cells.Fill(r, style) - } - t.Unlock() -} - -func (t *tScreen) SetContent(x, y int, mainc rune, combc []rune, style Style) { - t.Lock() - if !t.fini { - t.cells.SetContent(x, y, mainc, combc, style) - } - t.Unlock() -} - -func (t *tScreen) GetContent(x, y int) (rune, []rune, Style, int) { - t.Lock() - mainc, combc, style, width := t.cells.GetContent(x, y) - t.Unlock() - return mainc, combc, style, width -} - -func (t *tScreen) SetCell(x, y int, style Style, ch ...rune) { - if len(ch) > 0 { - t.SetContent(x, y, ch[0], ch[1:], style) - } else { - t.SetContent(x, y, ' ', nil, style) - } -} - -func (t *tScreen) encodeRune(r rune, buf []byte) []byte { - - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - ob = ob[:num] - dst := 0 - var err error - if enc := t.encoder; enc != nil { - enc.Reset() - dst, _, err = enc.Transform(nb, ob, true) - } - if err != nil || dst == 0 || nb[0] == '\x1a' { - // Combining characters are elided - if len(buf) == 0 { - if acs, ok := t.acs[r]; ok { - buf = append(buf, []byte(acs)...) - } else if fb, ok := t.fallback[r]; ok { - buf = append(buf, []byte(fb)...) - } else { - buf = append(buf, '?') - } - } - } else { - buf = append(buf, nb[:dst]...) - } - - return buf -} - -func (t *tScreen) sendFgBg(fg Color, bg Color) { - ti := t.ti - if ti.Colors == 0 { - return - } - if t.truecolor { - if ti.SetFgBgRGB != "" && - fg != ColorDefault && bg != ColorDefault { - r1, g1, b1 := fg.RGB() - r2, g2, b2 := bg.RGB() - t.TPuts(ti.TParm(ti.SetFgBgRGB, - int(r1), int(g1), int(b1), - int(r2), int(g2), int(b2))) - } else { - if fg != ColorDefault && ti.SetFgRGB != "" { - r, g, b := fg.RGB() - t.TPuts(ti.TParm(ti.SetFgRGB, - int(r), int(g), int(b))) - } - if bg != ColorDefault && ti.SetBgRGB != "" { - r, g, b := bg.RGB() - t.TPuts(ti.TParm(ti.SetBgRGB, - int(r), int(g), int(b))) - } - } - return - } - - if fg != ColorDefault { - if v, ok := t.colors[fg]; ok { - fg = v - } else { - v = FindColor(fg, t.palette) - t.colors[fg] = v - fg = v - } - } - - if bg != ColorDefault { - if v, ok := t.colors[bg]; ok { - bg = v - } else { - v = FindColor(bg, t.palette) - t.colors[bg] = v - bg = v - } - } - - if ti.SetFgBg != "" && fg != ColorDefault && bg != ColorDefault { - t.TPuts(ti.TParm(ti.SetFgBg, int(fg), int(bg))) - } else { - if fg != ColorDefault && ti.SetFg != "" { - t.TPuts(ti.TParm(ti.SetFg, int(fg))) - } - if bg != ColorDefault && ti.SetBg != "" { - t.TPuts(ti.TParm(ti.SetBg, int(bg))) - } - } -} - -func (t *tScreen) drawCell(x, y int) int { - - ti := t.ti - - mainc, combc, style, width := t.cells.GetContent(x, y) - if !t.cells.Dirty(x, y) { - return width - } - - if t.cy != y || t.cx != x { - t.TPuts(ti.TGoto(x, y)) - t.cx = x - t.cy = y - } - - if style == StyleDefault { - style = t.style - } - if style != t.curstyle { - fg, bg, attrs := style.Decompose() - - t.TPuts(ti.AttrOff) - - t.sendFgBg(fg, bg) - if attrs&AttrBold != 0 { - t.TPuts(ti.Bold) - } - if attrs&AttrUnderline != 0 { - t.TPuts(ti.Underline) - } - if attrs&AttrReverse != 0 { - t.TPuts(ti.Reverse) - } - if attrs&AttrBlink != 0 { - t.TPuts(ti.Blink) - } - if attrs&AttrDim != 0 { - t.TPuts(ti.Dim) - } - t.curstyle = style - } - // now emit runes - taking care to not overrun width with a - // wide character, and to ensure that we emit exactly one regular - // character followed up by any residual combing characters - - if width < 1 { - width = 1 - } - - var str string - - buf := make([]byte, 0, 6) - - buf = t.encodeRune(mainc, buf) - for _, r := range combc { - buf = t.encodeRune(r, buf) - } - - str = string(buf) - if width > 1 && str == "?" { - // No FullWidth character support - str = "? " - t.cx = -1 - } - - // XXX: check for hazeltine not being able to display ~ - - if x > t.w-width { - // too wide to fit; emit a single space instead - width = 1 - str = " " - } - t.writeString(str) - t.cx += width - t.cells.SetDirty(x, y, false) - if width > 1 { - t.cx = -1 - } - - return width -} - -func (t *tScreen) ShowCursor(x, y int) { - t.Lock() - t.cursorx = x - t.cursory = y - t.Unlock() -} - -func (t *tScreen) HideCursor() { - t.ShowCursor(-1, -1) -} - -func (t *tScreen) showCursor() { - - x, y := t.cursorx, t.cursory - w, h := t.cells.Size() - if x < 0 || y < 0 || x >= w || y >= h { - t.hideCursor() - return - } - t.TPuts(t.ti.TGoto(x, y)) - t.TPuts(t.ti.ShowCursor) - t.cx = x - t.cy = y -} - -// writeString sends a string to the terminal. The string is sent as-is and -// this function does not expand inline padding indications (of the form -// $<[delay]> where [delay] is msec). In order to have these expanded, use -// TPuts. If the screen is "buffering", the string is collected in a buffer, -// with the intention that the entire buffer be sent to the terminal in one -// write operation at some point later. -func (t *tScreen) writeString(s string) { - if t.buffering { - io.WriteString(&t.buf, s) - } else { - io.WriteString(t.out, s) - } -} - -func (t *tScreen) TPuts(s string) { - if t.buffering { - t.ti.TPuts(&t.buf, s) - } else { - t.ti.TPuts(t.out, s) - } -} - -func (t *tScreen) Show() { - t.Lock() - if !t.fini { - t.resize() - t.draw() - } - t.Unlock() -} - -func (t *tScreen) clearScreen() { - fg, bg, _ := t.style.Decompose() - t.sendFgBg(fg, bg) - t.TPuts(t.ti.Clear) - t.clear = false -} - -func (t *tScreen) hideCursor() { - // does not update cursor position - if t.ti.HideCursor != "" { - t.TPuts(t.ti.HideCursor) - } else { - // No way to hide cursor, stick it - // at bottom right of screen - t.cx, t.cy = t.cells.Size() - t.TPuts(t.ti.TGoto(t.cx, t.cy)) - } -} - -func (t *tScreen) draw() { - // clobber cursor position, because we're gonna change it all - t.cx = -1 - t.cy = -1 - - t.buf.Reset() - t.buffering = true - defer func() { - t.buffering = false - }() - - // hide the cursor while we move stuff around - t.hideCursor() - - if t.clear { - t.clearScreen() - } - - for y := 0; y < t.h; y++ { - for x := 0; x < t.w; x++ { - width := t.drawCell(x, y) - if width > 1 { - if x+1 < t.w { - // this is necessary so that if we ever - // go back to drawing that cell, we - // actually will *draw* it. - t.cells.SetDirty(x+1, y, true) - } - } - x += width - 1 - } - } - - // restore the cursor - t.showCursor() - - t.buf.WriteTo(t.out) -} - -func (t *tScreen) EnableMouse() { - if len(t.mouse) != 0 { - t.TPuts(t.ti.TParm(t.ti.MouseMode, 1)) - } -} - -func (t *tScreen) DisableMouse() { - if len(t.mouse) != 0 { - t.TPuts(t.ti.TParm(t.ti.MouseMode, 0)) - } -} - -func (t *tScreen) Size() (int, int) { - t.Lock() - w, h := t.w, t.h - t.Unlock() - return w, h -} - -func (t *tScreen) resize() { - if w, h, e := t.getWinSize(); e == nil { - if w != t.w || h != t.h { - t.cx = -1 - t.cy = -1 - - t.cells.Resize(w, h) - t.cells.Invalidate() - t.h = h - t.w = w - ev := NewEventResize(w, h) - t.PostEvent(ev) - } - } -} - -func (t *tScreen) Colors() int { - // this doesn't change, no need for lock - if t.truecolor { - return 1 << 24 - } - return t.ti.Colors -} - -func (t *tScreen) PollEvent() Event { - select { - case <-t.quit: - return nil - case ev := <-t.evch: - return ev - } -} - -// vtACSNames is a map of bytes defined by terminfo that are used in -// the terminals Alternate Character Set to represent other glyphs. -// For example, the upper left corner of the box drawing set can be -// displayed by printing "l" while in the alternate character set. -// Its not quite that simple, since the "l" is the terminfo name, -// and it may be necessary to use a different character based on -// the terminal implementation (or the terminal may lack support for -// this altogether). See buildAcsMap below for detail. -var vtACSNames = map[byte]rune{ - '+': RuneRArrow, - ',': RuneLArrow, - '-': RuneUArrow, - '.': RuneDArrow, - '0': RuneBlock, - '`': RuneDiamond, - 'a': RuneCkBoard, - 'b': '␉', // VT100, Not defined by terminfo - 'c': '␌', // VT100, Not defined by terminfo - 'd': '␋', // VT100, Not defined by terminfo - 'e': '␊', // VT100, Not defined by terminfo - 'f': RuneDegree, - 'g': RunePlMinus, - 'h': RuneBoard, - 'i': RuneLantern, - 'j': RuneLRCorner, - 'k': RuneURCorner, - 'l': RuneULCorner, - 'm': RuneLLCorner, - 'n': RunePlus, - 'o': RuneS1, - 'p': RuneS3, - 'q': RuneHLine, - 'r': RuneS7, - 's': RuneS9, - 't': RuneLTee, - 'u': RuneRTee, - 'v': RuneBTee, - 'w': RuneTTee, - 'x': RuneVLine, - 'y': RuneLEqual, - 'z': RuneGEqual, - '{': RunePi, - '|': RuneNEqual, - '}': RuneSterling, - '~': RuneBullet, -} - -// buildAcsMap builds a map of characters that we translate from Unicode to -// alternate character encodings. To do this, we use the standard VT100 ACS -// maps. This is only done if the terminal lacks support for Unicode; we -// always prefer to emit Unicode glyphs when we are able. -func (t *tScreen) buildAcsMap() { - acsstr := t.ti.AltChars - t.acs = make(map[rune]string) - for len(acsstr) > 2 { - srcv := acsstr[0] - dstv := string(acsstr[1]) - if r, ok := vtACSNames[srcv]; ok { - t.acs[r] = t.ti.EnterAcs + dstv + t.ti.ExitAcs - } - acsstr = acsstr[2:] - } -} - -func (t *tScreen) PostEventWait(ev Event) { - t.evch <- ev -} - -func (t *tScreen) PostEvent(ev Event) error { - select { - case t.evch <- ev: - return nil - default: - return ErrEventQFull - } -} - -func (t *tScreen) clip(x, y int) (int, int) { - w, h := t.cells.Size() - if x < 0 { - x = 0 - } - if y < 0 { - y = 0 - } - if x > w-1 { - x = w - 1 - } - if y > h-1 { - y = h - 1 - } - return x, y -} - -// buildMouseEvent returns an event based on the supplied coordinates and button -// state. Note that the screen's mouse button state is updated based on the -// input to this function (i.e. it mutates the receiver). -func (t *tScreen) buildMouseEvent(x, y, btn int) *EventMouse { - - // XTerm mouse events only report at most one button at a time, - // which may include a wheel button. Wheel motion events are - // reported as single impulses, while other button events are reported - // as separate press & release events. - - button := ButtonNone - mod := ModNone - - // Mouse wheel has bit 6 set, no release events. It should be noted - // that wheel events are sometimes misdelivered as mouse button events - // during a click-drag, so we debounce these, considering them to be - // button press events unless we see an intervening release event. - switch btn & 0x43 { - case 0: - button = Button1 - t.wasbtn = true - case 1: - button = Button2 - t.wasbtn = true - case 2: - button = Button3 - t.wasbtn = true - case 3: - button = ButtonNone - t.wasbtn = false - case 0x40: - if !t.wasbtn { - button = WheelUp - } else { - button = Button1 - } - case 0x41: - if !t.wasbtn { - button = WheelDown - } else { - button = Button2 - } - } - - if btn&0x4 != 0 { - mod |= ModShift - } - if btn&0x8 != 0 { - mod |= ModAlt - } - if btn&0x10 != 0 { - mod |= ModCtrl - } - - // Some terminals will report mouse coordinates outside the - // screen, especially with click-drag events. Clip the coordinates - // to the screen in that case. - x, y = t.clip(x, y) - - return NewEventMouse(x, y, button, mod) -} - -// parseSgrMouse attempts to locate an SGR mouse record at the start of the -// buffer. It returns true, true if it found one, and the associated bytes -// be removed from the buffer. It returns true, false if the buffer might -// contain such an event, but more bytes are necessary (partial match), and -// false, false if the content is definitely *not* an SGR mouse record. -func (t *tScreen) parseSgrMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - - b := buf.Bytes() - - var x, y, btn, state int - dig := false - neg := false - motion := false - i := 0 - val := 0 - - for i = range b { - switch b[i] { - case '\x1b': - if state != 0 { - return false, false - } - state = 1 - - case '\x9b': - if state != 0 { - return false, false - } - state = 2 - - case '[': - if state != 1 { - return false, false - } - state = 2 - - case '<': - if state != 2 { - return false, false - } - val = 0 - dig = false - neg = false - state = 3 - - case '-': - if state != 3 && state != 4 && state != 5 { - return false, false - } - if dig || neg { - return false, false - } - neg = true // stay in state - - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - if state != 3 && state != 4 && state != 5 { - return false, false - } - val *= 10 - val += int(b[i] - '0') - dig = true // stay in state - - case ';': - if neg { - val = -val - } - switch state { - case 3: - btn, val = val, 0 - neg, dig, state = false, false, 4 - case 4: - x, val = val-1, 0 - neg, dig, state = false, false, 5 - default: - return false, false - } - - case 'm', 'M': - if state != 5 { - return false, false - } - if neg { - val = -val - } - y = val - 1 - - motion = (btn & 32) != 0 - btn &^= 32 - if b[i] == 'm' { - // mouse release, clear all buttons - btn |= 3 - btn &^= 0x40 - t.buttondn = false - } else if motion { - /* - * Some broken terminals appear to send - * mouse button one motion events, instead of - * encoding 35 (no buttons) into these events. - * We resolve these by looking for a non-motion - * event first. - */ - if !t.buttondn { - btn |= 3 - btn &^= 0x40 - } - } else { - t.buttondn = true - } - // consume the event bytes - for i >= 0 { - buf.ReadByte() - i-- - } - *evs = append(*evs, t.buildMouseEvent(x, y, btn)) - return true, true - } - } - - // incomplete & inconclusve at this point - return true, false -} - -// parseXtermMouse is like parseSgrMouse, but it parses a legacy -// X11 mouse record. -func (t *tScreen) parseXtermMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - - b := buf.Bytes() - - state := 0 - btn := 0 - x := 0 - y := 0 - - for i := range b { - switch state { - case 0: - switch b[i] { - case '\x1b': - state = 1 - case '\x9b': - state = 2 - default: - return false, false - } - case 1: - if b[i] != '[' { - return false, false - } - state = 2 - case 2: - if b[i] != 'M' { - return false, false - } - state++ - case 3: - btn = int(b[i]) - state++ - case 4: - x = int(b[i]) - 32 - 1 - state++ - case 5: - y = int(b[i]) - 32 - 1 - for i >= 0 { - buf.ReadByte() - i-- - } - *evs = append(*evs, t.buildMouseEvent(x, y, btn)) - return true, true - } - } - return true, false -} - -func (t *tScreen) parseFunctionKey(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - b := buf.Bytes() - partial := false - for e, k := range t.keycodes { - esc := []byte(e) - if (len(esc) == 1) && (esc[0] == '\x1b') { - continue - } - if bytes.HasPrefix(b, esc) { - // matched - var r rune - if len(esc) == 1 { - r = rune(b[0]) - } - mod := k.mod - if t.escaped { - mod |= ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(k.key, r, mod)) - for i := 0; i < len(esc); i++ { - buf.ReadByte() - } - return true, true - } - if bytes.HasPrefix(esc, b) { - partial = true - } - } - return partial, false -} - -func (t *tScreen) parseRune(buf *bytes.Buffer, evs *[]Event) (bool, bool) { - b := buf.Bytes() - if b[0] >= ' ' && b[0] <= 0x7F { - // printable ASCII easy to deal with -- no encodings - mod := ModNone - if t.escaped { - mod = ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(KeyRune, rune(b[0]), mod)) - buf.ReadByte() - return true, true - } - - if b[0] < 0x80 { - // Low numbered values are control keys, not runes. - return false, false - } - - utfb := make([]byte, 12) - for l := 1; l <= len(b); l++ { - t.decoder.Reset() - nout, nin, e := t.decoder.Transform(utfb, b[:l], true) - if e == transform.ErrShortSrc { - continue - } - if nout != 0 { - r, _ := utf8.DecodeRune(utfb[:nout]) - if r != utf8.RuneError { - mod := ModNone - if t.escaped { - mod = ModAlt - t.escaped = false - } - *evs = append(*evs, NewEventKey(KeyRune, r, mod)) - } - for nin > 0 { - buf.ReadByte() - nin-- - } - return true, true - } - } - // Looks like potential escape - return true, false -} - -func (t *tScreen) scanInput(buf *bytes.Buffer, expire bool) { - evs := t.collectEventsFromInput(buf, expire) - - for _, ev := range evs { - t.PostEventWait(ev) - } -} - -// Return an array of Events extracted from the supplied buffer. This is done -// while holding the screen's lock - the events can then be queued for -// application processing with the lock released. -func (t *tScreen) collectEventsFromInput(buf *bytes.Buffer, expire bool) []Event { - - res := make([]Event, 0, 20) - - t.Lock() - defer t.Unlock() - - for { - b := buf.Bytes() - if len(b) == 0 { - buf.Reset() - return res - } - - partials := 0 - - if part, comp := t.parseRune(buf, &res); comp { - continue - } else if part { - partials++ - } - - if part, comp := t.parseFunctionKey(buf, &res); comp { - continue - } else if part { - partials++ - } - - // Only parse mouse records if this term claims to have - // mouse support - - if t.ti.Mouse != "" { - if part, comp := t.parseXtermMouse(buf, &res); comp { - continue - } else if part { - partials++ - } - - if part, comp := t.parseSgrMouse(buf, &res); comp { - continue - } else if part { - partials++ - } - } - - if partials == 0 || expire { - if b[0] == '\x1b' { - if len(b) == 1 { - res = append(res, NewEventKey(KeyEsc, 0, ModNone)) - t.escaped = false - } else { - t.escaped = true - } - buf.ReadByte() - continue - } - // Nothing was going to match, or we timed out - // waiting for more data -- just deliver the characters - // to the app & let them sort it out. Possibly we - // should only do this for control characters like ESC. - by, _ := buf.ReadByte() - mod := ModNone - if t.escaped { - t.escaped = false - mod = ModAlt - } - res = append(res, NewEventKey(KeyRune, rune(by), mod)) - continue - } - - // well we have some partial data, wait until we get - // some more - break - } - - return res -} - -func (t *tScreen) mainLoop() { - buf := &bytes.Buffer{} - for { - select { - case <-t.quit: - close(t.indoneq) - return - case <-t.sigwinch: - t.Lock() - t.cx = -1 - t.cy = -1 - t.resize() - t.cells.Invalidate() - t.draw() - t.Unlock() - continue - case <-t.keytimer.C: - // If the timer fired, and the current time - // is after the expiration of the escape sequence, - // then we assume the escape sequence reached it's - // conclusion, and process the chunk independently. - // This lets us detect conflicts such as a lone ESC. - if buf.Len() > 0 { - if time.Now().After(t.keyexpire) { - t.scanInput(buf, true) - } - } - if buf.Len() > 0 { - if !t.keytimer.Stop() { - select { - case <-t.keytimer.C: - default: - } - } - t.keytimer.Reset(time.Millisecond * 50) - } - case chunk := <-t.keychan: - buf.Write(chunk) - t.keyexpire = time.Now().Add(time.Millisecond * 50) - t.scanInput(buf, false) - if !t.keytimer.Stop() { - select { - case <-t.keytimer.C: - default: - } - } - if buf.Len() > 0 { - t.keytimer.Reset(time.Millisecond * 50) - } - } - } -} - -func (t *tScreen) inputLoop() { - - for { - chunk := make([]byte, 128) - n, e := t.in.Read(chunk) - switch e { - case io.EOF: - case nil: - default: - t.PostEvent(NewEventError(e)) - return - } - t.keychan <- chunk[:n] - } -} - -func (t *tScreen) Sync() { - t.Lock() - t.cx = -1 - t.cy = -1 - if !t.fini { - t.resize() - t.clear = true - t.cells.Invalidate() - t.draw() - } - t.Unlock() -} - -func (t *tScreen) CharacterSet() string { - return t.charset -} - -func (t *tScreen) RegisterRuneFallback(orig rune, fallback string) { - t.Lock() - t.fallback[orig] = fallback - t.Unlock() -} - -func (t *tScreen) UnregisterRuneFallback(orig rune) { - t.Lock() - delete(t.fallback, orig) - t.Unlock() -} - -func (t *tScreen) CanDisplay(r rune, checkFallbacks bool) bool { - - if enc := t.encoder; enc != nil { - nb := make([]byte, 6) - ob := make([]byte, 6) - num := utf8.EncodeRune(ob, r) - - enc.Reset() - dst, _, err := enc.Transform(nb, ob[:num], true) - if dst != 0 && err == nil && nb[0] != '\x1A' { - return true - } - } - // Terminal fallbacks always permitted, since we assume they are - // basically nearly perfect renditions. - if _, ok := t.acs[r]; ok { - return true - } - if !checkFallbacks { - return false - } - if _, ok := t.fallback[r]; ok { - return true - } - return false -} - -func (t *tScreen) HasMouse() bool { - return len(t.mouse) != 0 -} - -func (t *tScreen) HasKey(k Key) bool { - if k == KeyRune { - return true - } - return t.keyexist[k] -} - -func (t *tScreen) Resize(int, int, int, int) {} diff --git a/vendor/github.com/gdamore/tcell/tscreen_bsd.go b/vendor/github.com/gdamore/tcell/tscreen_bsd.go deleted file mode 100644 index 25137165..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_bsd.go +++ /dev/null @@ -1,116 +0,0 @@ -// +build freebsd netbsd openbsd dragonfly - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - "unsafe" -) - -type termiosPrivate syscall.Termios - -func (t *tScreen) termioInit() error { - var e error - var newtios termiosPrivate - var fd uintptr - var tios uintptr - var ioc uintptr - t.tiosp = &termiosPrivate{} - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tios = uintptr(unsafe.Pointer(t.tiosp)) - ioc = uintptr(syscall.TIOCGETA) - fd = uintptr(t.out.Fd()) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - newtios = *t.tiosp - newtios.Iflag &^= syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | - syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | - syscall.ICRNL | syscall.IXON - newtios.Oflag &^= syscall.OPOST - newtios.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | - syscall.ISIG | syscall.IEXTEN - newtios.Cflag &^= syscall.CSIZE | syscall.PARENB - newtios.Cflag |= syscall.CS8 - - tios = uintptr(unsafe.Pointer(&newtios)) - - ioc = uintptr(syscall.TIOCSETA) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil { - fd := uintptr(t.out.Fd()) - ioc := uintptr(syscall.TIOCSETAF) - tios := uintptr(unsafe.Pointer(t.tiosp)) - syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0) - t.out.Close() - } - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - - fd := uintptr(t.out.Fd()) - dim := [4]uint16{} - dimp := uintptr(unsafe.Pointer(&dim)) - ioc := uintptr(syscall.TIOCGWINSZ) - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, - fd, ioc, dimp, 0, 0, 0); err != 0 { - return -1, -1, err - } - return int(dim[1]), int(dim[0]), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_darwin.go b/vendor/github.com/gdamore/tcell/tscreen_darwin.go deleted file mode 100644 index 6ee5fd5e..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_darwin.go +++ /dev/null @@ -1,137 +0,0 @@ -// +build darwin - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// The Darwin system is *almost* a real BSD system, but it suffers from -// a brain damaged TTY driver. This TTY driver does not actually -// wake up in poll() or similar calls, which means that we cannot reliably -// shut down the terminal without resorting to obscene custom C code -// and a dedicated poller thread. -// -// So instead, we do a best effort, and simply try to do the close in the -// background. Probably this will cause a leak of two goroutines and -// maybe also the file descriptor, meaning that applications on Darwin -// can't reinitialize the screen, but that's probably a very rare behavior, -// and accepting that is the best of some very poor alternative options. -// -// Maybe someday Apple will fix there tty driver, but its been broken for -// a long time (probably forever) so holding one's breath is contraindicated. - -import ( - "os" - "os/signal" - "syscall" - "unsafe" -) - -type termiosPrivate syscall.Termios - -func (t *tScreen) termioInit() error { - var e error - var newtios termiosPrivate - var fd uintptr - var tios uintptr - var ioc uintptr - t.tiosp = &termiosPrivate{} - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tios = uintptr(unsafe.Pointer(t.tiosp)) - ioc = uintptr(syscall.TIOCGETA) - fd = uintptr(t.out.Fd()) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - newtios = *t.tiosp - newtios.Iflag &^= syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | - syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | - syscall.ICRNL | syscall.IXON - newtios.Oflag &^= syscall.OPOST - newtios.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | - syscall.ISIG | syscall.IEXTEN - newtios.Cflag &^= syscall.CSIZE | syscall.PARENB - newtios.Cflag |= syscall.CS8 - - tios = uintptr(unsafe.Pointer(&newtios)) - - ioc = uintptr(syscall.TIOCSETA) - if _, _, e1 := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0); e1 != 0 { - e = e1 - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil { - fd := uintptr(t.out.Fd()) - ioc := uintptr(syscall.TIOCSETAF) - tios := uintptr(unsafe.Pointer(t.tiosp)) - syscall.Syscall6(syscall.SYS_IOCTL, fd, ioc, tios, 0, 0, 0) - t.out.Close() - } - - // See above -- we background this call which might help, but - // really the tty is probably open. - - go func() { - if t.in != nil { - t.in.Close() - } - }() -} - -func (t *tScreen) getWinSize() (int, int, error) { - - fd := uintptr(t.out.Fd()) - dim := [4]uint16{} - dimp := uintptr(unsafe.Pointer(&dim)) - ioc := uintptr(syscall.TIOCGWINSZ) - if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, - fd, ioc, dimp, 0, 0, 0); err != 0 { - return -1, -1, err - } - return int(dim[1]), int(dim[0]), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_linux.go b/vendor/github.com/gdamore/tcell/tscreen_linux.go deleted file mode 100644 index 19e58d60..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_linux.go +++ /dev/null @@ -1,119 +0,0 @@ -// +build linux - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - - "golang.org/x/sys/unix" -) - -type termiosPrivate struct { - tio *unix.Termios -} - -func (t *tScreen) termioInit() error { - var e error - var raw *unix.Termios - var tio *unix.Termios - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tio, e = unix.IoctlGetTermios(int(t.out.Fd()), unix.TCGETS) - if e != nil { - goto failed - } - - t.tiosp = &termiosPrivate{tio: tio} - - // make a local copy, to make it raw - raw = &unix.Termios{ - Cflag: tio.Cflag, - Oflag: tio.Oflag, - Iflag: tio.Iflag, - Lflag: tio.Lflag, - Cc: tio.Cc, - } - raw.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | - unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) - raw.Oflag &^= unix.OPOST - raw.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | - unix.IEXTEN) - raw.Cflag &^= (unix.CSIZE | unix.PARENB) - raw.Cflag |= unix.CS8 - - // This is setup for blocking reads. In the past we attempted to - // use non-blocking reads, but now a separate input loop and timer - // copes with the problems we had on some systems (BSD/Darwin) - // where close hung forever. - raw.Cc[unix.VMIN] = 1 - raw.Cc[unix.VTIME] = 0 - - e = unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETS, raw) - if e != nil { - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil && t.tiosp != nil { - unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETSF, t.tiosp.tio) - t.out.Close() - } - - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - - wsz, err := unix.IoctlGetWinsize(int(t.out.Fd()), unix.TIOCGWINSZ) - if err != nil { - return -1, -1, err - } - return int(wsz.Col), int(wsz.Row), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_solaris.go b/vendor/github.com/gdamore/tcell/tscreen_solaris.go deleted file mode 100644 index 9fa48b85..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_solaris.go +++ /dev/null @@ -1,117 +0,0 @@ -// +build solaris - -// Copyright 2019 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -import ( - "os" - "os/signal" - "syscall" - - "golang.org/x/sys/unix" -) - -type termiosPrivate struct { - tio *unix.Termios -} - -func (t *tScreen) termioInit() error { - var e error - var raw *unix.Termios - var tio *unix.Termios - - if t.in, e = os.OpenFile("/dev/tty", os.O_RDONLY, 0); e != nil { - goto failed - } - if t.out, e = os.OpenFile("/dev/tty", os.O_WRONLY, 0); e != nil { - goto failed - } - - tio, e = unix.IoctlGetTermios(int(t.out.Fd()), unix.TCGETS) - if e != nil { - goto failed - } - - t.tiosp = &termiosPrivate{tio: tio} - - // make a local copy, to make it raw - raw = &unix.Termios{ - Cflag: tio.Cflag, - Oflag: tio.Oflag, - Iflag: tio.Iflag, - Lflag: tio.Lflag, - Cc: tio.Cc, - } - - raw.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.INLCR | - unix.IGNCR | unix.ICRNL | unix.IXON) - raw.Oflag &^= unix.OPOST - raw.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) - raw.Cflag &^= (unix.CSIZE | unix.PARENB) - raw.Cflag |= unix.CS8 - - // This is setup for blocking reads. In the past we attempted to - // use non-blocking reads, but now a separate input loop and timer - // copes with the problems we had on some systems (BSD/Darwin) - // where close hung forever. - raw.Cc[unix.VMIN] = 1 - raw.Cc[unix.VTIME] = 0 - - e = unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETS, raw) - if e != nil { - goto failed - } - - signal.Notify(t.sigwinch, syscall.SIGWINCH) - - if w, h, e := t.getWinSize(); e == nil && w != 0 && h != 0 { - t.cells.Resize(w, h) - } - - return nil - -failed: - if t.in != nil { - t.in.Close() - } - if t.out != nil { - t.out.Close() - } - return e -} - -func (t *tScreen) termioFini() { - - signal.Stop(t.sigwinch) - - <-t.indoneq - - if t.out != nil && t.tiosp != nil { - unix.IoctlSetTermios(int(t.out.Fd()), unix.TCSETSF, t.tiosp.tio) - t.out.Close() - } - if t.in != nil { - t.in.Close() - } -} - -func (t *tScreen) getWinSize() (int, int, error) { - wsz, err := unix.IoctlGetWinsize(int(t.out.Fd()), unix.TIOCGWINSZ) - if err != nil { - return -1, -1, err - } - return int(wsz.Col), int(wsz.Row), nil -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_stub.go b/vendor/github.com/gdamore/tcell/tscreen_stub.go deleted file mode 100644 index 91de26e1..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_stub.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build nacl plan9 - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// This stub file is for systems that have no termios. - -type termiosPrivate struct{} - -func (t *tScreen) termioInit() error { - return ErrNoScreen -} - -func (t *tScreen) termioFini() { -} - -func (t *tScreen) getWinSize() (int, int, error) { - return 0, 0, ErrNoScreen -} diff --git a/vendor/github.com/gdamore/tcell/tscreen_windows.go b/vendor/github.com/gdamore/tcell/tscreen_windows.go deleted file mode 100644 index daac0976..00000000 --- a/vendor/github.com/gdamore/tcell/tscreen_windows.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build windows - -// Copyright 2015 The TCell Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use file except in compliance with the License. -// You may obtain a copy of the license at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tcell - -// On Windows we don't have support for termios. We probably could, and -// may should, in a cygwin type environment. Its not clear how to make -// this all work nicely with both cygwin and Windows console, so we -// decline to do so here. - -func (t *tScreen) termioInit() error { - return ErrNoScreen -} - -func (t *tScreen) termioFini() { - return -} - -func (t *tScreen) getWinSize() (int, int, error) { - return 0, 0, ErrNoScreen -} - -func (t *tScreen) getCharset() string { - return "UTF-16LE" -} - -type termiosPrivate struct{} diff --git a/vendor/github.com/go-ole/go-ole/.travis.yml b/vendor/github.com/go-ole/go-ole/.travis.yml deleted file mode 100644 index 28f740cd..00000000 --- a/vendor/github.com/go-ole/go-ole/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go -sudo: false - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - tip diff --git a/vendor/github.com/go-ole/go-ole/ChangeLog.md b/vendor/github.com/go-ole/go-ole/ChangeLog.md deleted file mode 100644 index 4ba6a8c6..00000000 --- a/vendor/github.com/go-ole/go-ole/ChangeLog.md +++ /dev/null @@ -1,49 +0,0 @@ -# Version 1.x.x - -* **Add more test cases and reference new test COM server project.** (Placeholder for future additions) - -# Version 1.2.0-alphaX - -**Minimum supported version is now Go 1.4. Go 1.1 support is deprecated, but should still build.** - - * Added CI configuration for Travis-CI and AppVeyor. - * Added test InterfaceID and ClassID for the COM Test Server project. - * Added more inline documentation (#83). - * Added IEnumVARIANT implementation (#88). - * Added IEnumVARIANT test cases (#99, #100, #101). - * Added support for retrieving `time.Time` from VARIANT (#92). - * Added test case for IUnknown (#64). - * Added test case for IDispatch (#64). - * Added test cases for scalar variants (#64, #76). - -# Version 1.1.1 - - * Fixes for Linux build. - * Fixes for Windows build. - -# Version 1.1.0 - -The change to provide building on all platforms is a new feature. The increase in minor version reflects that and allows those who wish to stay on 1.0.x to continue to do so. Support for 1.0.x will be limited to bug fixes. - - * Move GUID out of variables.go into its own file to make new documentation available. - * Move OleError out of ole.go into its own file to make new documentation available. - * Add documentation to utility functions. - * Add documentation to variant receiver functions. - * Add documentation to ole structures. - * Make variant available to other systems outside of Windows. - * Make OLE structures available to other systems outside of Windows. - -## New Features - - * Library should now be built on all platforms supported by Go. Library will NOOP on any platform that is not Windows. - * More functions are now documented and available on godoc.org. - -# Version 1.0.1 - - 1. Fix package references from repository location change. - -# Version 1.0.0 - -This version is stable enough for use. The COM API is still incomplete, but provides enough functionality for accessing COM servers using IDispatch interface. - -There is no changelog for this version. Check commits for history. diff --git a/vendor/github.com/go-ole/go-ole/LICENSE b/vendor/github.com/go-ole/go-ole/LICENSE deleted file mode 100644 index 623ec06f..00000000 --- a/vendor/github.com/go-ole/go-ole/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright © 2013-2017 Yasuhiro Matsumoto, - -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. diff --git a/vendor/github.com/go-ole/go-ole/README.md b/vendor/github.com/go-ole/go-ole/README.md deleted file mode 100644 index 7b577558..00000000 --- a/vendor/github.com/go-ole/go-ole/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Go OLE - -[![Build status](https://ci.appveyor.com/api/projects/status/qr0u2sf7q43us9fj?svg=true)](https://ci.appveyor.com/project/jacobsantos/go-ole-jgs28) -[![Build Status](https://travis-ci.org/go-ole/go-ole.svg?branch=master)](https://travis-ci.org/go-ole/go-ole) -[![GoDoc](https://godoc.org/github.com/go-ole/go-ole?status.svg)](https://godoc.org/github.com/go-ole/go-ole) - -Go bindings for Windows COM using shared libraries instead of cgo. - -By Yasuhiro Matsumoto. - -## Install - -To experiment with go-ole, you can just compile and run the example program: - -``` -go get github.com/go-ole/go-ole -cd /path/to/go-ole/ -go test - -cd /path/to/go-ole/example/excel -go run excel.go -``` - -## Continuous Integration - -Continuous integration configuration has been added for both Travis-CI and AppVeyor. You will have to add these to your own account for your fork in order for it to run. - -**Travis-CI** - -Travis-CI was added to check builds on Linux to ensure that `go get` works when cross building. Currently, Travis-CI is not used to test cross-building, but this may be changed in the future. It is also not currently possible to test the library on Linux, since COM API is specific to Windows and it is not currently possible to run a COM server on Linux or even connect to a remote COM server. - -**AppVeyor** - -AppVeyor is used to build on Windows using the (in-development) test COM server. It is currently only used to test the build and ensure that the code works on Windows. It will be used to register a COM server and then run the test cases based on the test COM server. - -The tests currently do run and do pass and this should be maintained with commits. - -## Versioning - -Go OLE uses [semantic versioning](http://semver.org) for version numbers, which is similar to the version contract of the Go language. Which means that the major version will always maintain backwards compatibility with minor versions. Minor versions will only add new additions and changes. Fixes will always be in patch. - -This contract should allow you to upgrade to new minor and patch versions without breakage or modifications to your existing code. Leave a ticket, if there is breakage, so that it could be fixed. - -## LICENSE - -Under the MIT License: http://mattn.mit-license.org/2013 diff --git a/vendor/github.com/go-ole/go-ole/appveyor.yml b/vendor/github.com/go-ole/go-ole/appveyor.yml deleted file mode 100644 index 0d557ac2..00000000 --- a/vendor/github.com/go-ole/go-ole/appveyor.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Notes: -# - Minimal appveyor.yml file is an empty file. All sections are optional. -# - Indent each level of configuration with 2 spaces. Do not use tabs! -# - All section names are case-sensitive. -# - Section names should be unique on each level. - -version: "1.3.0.{build}-alpha-{branch}" - -os: Windows Server 2012 R2 - -branches: - only: - - master - - v1.2 - - v1.1 - - v1.0 - -skip_tags: true - -clone_folder: c:\gopath\src\github.com\go-ole\go-ole - -environment: - GOPATH: c:\gopath - matrix: - - GOARCH: amd64 - GOVERSION: 1.5 - GOROOT: c:\go - DOWNLOADPLATFORM: "x64" - -install: - - choco install mingw - - SET PATH=c:\tools\mingw64\bin;%PATH% - # - Download COM Server - - ps: Start-FileDownload "https://github.com/go-ole/test-com-server/releases/download/v1.0.2/test-com-server-${env:DOWNLOADPLATFORM}.zip" - - 7z e test-com-server-%DOWNLOADPLATFORM%.zip -oc:\gopath\src\github.com\go-ole\go-ole > NUL - - c:\gopath\src\github.com\go-ole\go-ole\build\register-assembly.bat - # - set - - go version - - go env - - go get -u golang.org/x/tools/cmd/cover - - go get -u golang.org/x/tools/cmd/godoc - - go get -u golang.org/x/tools/cmd/stringer - -build_script: - - cd c:\gopath\src\github.com\go-ole\go-ole - - go get -v -t ./... - - go build - - go test -v -cover ./... - -# disable automatic tests -test: off - -# disable deployment -deploy: off diff --git a/vendor/github.com/go-ole/go-ole/com.go b/vendor/github.com/go-ole/go-ole/com.go deleted file mode 100644 index 6f986b18..00000000 --- a/vendor/github.com/go-ole/go-ole/com.go +++ /dev/null @@ -1,344 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unicode/utf16" - "unsafe" -) - -var ( - procCoInitialize, _ = modole32.FindProc("CoInitialize") - procCoInitializeEx, _ = modole32.FindProc("CoInitializeEx") - procCoUninitialize, _ = modole32.FindProc("CoUninitialize") - procCoCreateInstance, _ = modole32.FindProc("CoCreateInstance") - procCoTaskMemFree, _ = modole32.FindProc("CoTaskMemFree") - procCLSIDFromProgID, _ = modole32.FindProc("CLSIDFromProgID") - procCLSIDFromString, _ = modole32.FindProc("CLSIDFromString") - procStringFromCLSID, _ = modole32.FindProc("StringFromCLSID") - procStringFromIID, _ = modole32.FindProc("StringFromIID") - procIIDFromString, _ = modole32.FindProc("IIDFromString") - procCoGetObject, _ = modole32.FindProc("CoGetObject") - procGetUserDefaultLCID, _ = modkernel32.FindProc("GetUserDefaultLCID") - procCopyMemory, _ = modkernel32.FindProc("RtlMoveMemory") - procVariantInit, _ = modoleaut32.FindProc("VariantInit") - procVariantClear, _ = modoleaut32.FindProc("VariantClear") - procVariantTimeToSystemTime, _ = modoleaut32.FindProc("VariantTimeToSystemTime") - procSysAllocString, _ = modoleaut32.FindProc("SysAllocString") - procSysAllocStringLen, _ = modoleaut32.FindProc("SysAllocStringLen") - procSysFreeString, _ = modoleaut32.FindProc("SysFreeString") - procSysStringLen, _ = modoleaut32.FindProc("SysStringLen") - procCreateDispTypeInfo, _ = modoleaut32.FindProc("CreateDispTypeInfo") - procCreateStdDispatch, _ = modoleaut32.FindProc("CreateStdDispatch") - procGetActiveObject, _ = modoleaut32.FindProc("GetActiveObject") - - procGetMessageW, _ = moduser32.FindProc("GetMessageW") - procDispatchMessageW, _ = moduser32.FindProc("DispatchMessageW") -) - -// coInitialize initializes COM library on current thread. -// -// MSDN documentation suggests that this function should not be called. Call -// CoInitializeEx() instead. The reason has to do with threading and this -// function is only for single-threaded apartments. -// -// That said, most users of the library have gotten away with just this -// function. If you are experiencing threading issues, then use -// CoInitializeEx(). -func coInitialize() (err error) { - // http://msdn.microsoft.com/en-us/library/windows/desktop/ms678543(v=vs.85).aspx - // Suggests that no value should be passed to CoInitialized. - // Could just be Call() since the parameter is optional. <-- Needs testing to be sure. - hr, _, _ := procCoInitialize.Call(uintptr(0)) - if hr != 0 { - err = NewError(hr) - } - return -} - -// coInitializeEx initializes COM library with concurrency model. -func coInitializeEx(coinit uint32) (err error) { - // http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279(v=vs.85).aspx - // Suggests that the first parameter is not only optional but should always be NULL. - hr, _, _ := procCoInitializeEx.Call(uintptr(0), uintptr(coinit)) - if hr != 0 { - err = NewError(hr) - } - return -} - -// CoInitialize initializes COM library on current thread. -// -// MSDN documentation suggests that this function should not be called. Call -// CoInitializeEx() instead. The reason has to do with threading and this -// function is only for single-threaded apartments. -// -// That said, most users of the library have gotten away with just this -// function. If you are experiencing threading issues, then use -// CoInitializeEx(). -func CoInitialize(p uintptr) (err error) { - // p is ignored and won't be used. - // Avoid any variable not used errors. - p = uintptr(0) - return coInitialize() -} - -// CoInitializeEx initializes COM library with concurrency model. -func CoInitializeEx(p uintptr, coinit uint32) (err error) { - // Avoid any variable not used errors. - p = uintptr(0) - return coInitializeEx(coinit) -} - -// CoUninitialize uninitializes COM Library. -func CoUninitialize() { - procCoUninitialize.Call() -} - -// CoTaskMemFree frees memory pointer. -func CoTaskMemFree(memptr uintptr) { - procCoTaskMemFree.Call(memptr) -} - -// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier. -// -// The Programmatic Identifier must be registered, because it will be looked up -// in the Windows Registry. The registry entry has the following keys: CLSID, -// Insertable, Protocol and Shell -// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx). -// -// programID identifies the class id with less precision and is not guaranteed -// to be unique. These are usually found in the registry under -// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of -// "Program.Component.Version" with version being optional. -// -// CLSIDFromProgID in Windows API. -func CLSIDFromProgID(progId string) (clsid *GUID, err error) { - var guid GUID - lpszProgID := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId))) - hr, _, _ := procCLSIDFromProgID.Call(lpszProgID, uintptr(unsafe.Pointer(&guid))) - if hr != 0 { - err = NewError(hr) - } - clsid = &guid - return -} - -// CLSIDFromString retrieves Class ID from string representation. -// -// This is technically the string version of the GUID and will convert the -// string to object. -// -// CLSIDFromString in Windows API. -func CLSIDFromString(str string) (clsid *GUID, err error) { - var guid GUID - lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(str))) - hr, _, _ := procCLSIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid))) - if hr != 0 { - err = NewError(hr) - } - clsid = &guid - return -} - -// StringFromCLSID returns GUID formated string from GUID object. -func StringFromCLSID(clsid *GUID) (str string, err error) { - var p *uint16 - hr, _, _ := procStringFromCLSID.Call(uintptr(unsafe.Pointer(clsid)), uintptr(unsafe.Pointer(&p))) - if hr != 0 { - err = NewError(hr) - } - str = LpOleStrToString(p) - return -} - -// IIDFromString returns GUID from program ID. -func IIDFromString(progId string) (clsid *GUID, err error) { - var guid GUID - lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId))) - hr, _, _ := procIIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid))) - if hr != 0 { - err = NewError(hr) - } - clsid = &guid - return -} - -// StringFromIID returns GUID formatted string from GUID object. -func StringFromIID(iid *GUID) (str string, err error) { - var p *uint16 - hr, _, _ := procStringFromIID.Call(uintptr(unsafe.Pointer(iid)), uintptr(unsafe.Pointer(&p))) - if hr != 0 { - err = NewError(hr) - } - str = LpOleStrToString(p) - return -} - -// CreateInstance of single uninitialized object with GUID. -func CreateInstance(clsid *GUID, iid *GUID) (unk *IUnknown, err error) { - if iid == nil { - iid = IID_IUnknown - } - hr, _, _ := procCoCreateInstance.Call( - uintptr(unsafe.Pointer(clsid)), - 0, - CLSCTX_SERVER, - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(&unk))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// GetActiveObject retrieves pointer to active object. -func GetActiveObject(clsid *GUID, iid *GUID) (unk *IUnknown, err error) { - if iid == nil { - iid = IID_IUnknown - } - hr, _, _ := procGetActiveObject.Call( - uintptr(unsafe.Pointer(clsid)), - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(&unk))) - if hr != 0 { - err = NewError(hr) - } - return -} - -type BindOpts struct { - CbStruct uint32 - GrfFlags uint32 - GrfMode uint32 - TickCountDeadline uint32 -} - -// GetObject retrieves pointer to active object. -func GetObject(programID string, bindOpts *BindOpts, iid *GUID) (unk *IUnknown, err error) { - if bindOpts != nil { - bindOpts.CbStruct = uint32(unsafe.Sizeof(BindOpts{})) - } - if iid == nil { - iid = IID_IUnknown - } - hr, _, _ := procCoGetObject.Call( - uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(programID))), - uintptr(unsafe.Pointer(bindOpts)), - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(&unk))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// VariantInit initializes variant. -func VariantInit(v *VARIANT) (err error) { - hr, _, _ := procVariantInit.Call(uintptr(unsafe.Pointer(v))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// VariantClear clears value in Variant settings to VT_EMPTY. -func VariantClear(v *VARIANT) (err error) { - hr, _, _ := procVariantClear.Call(uintptr(unsafe.Pointer(v))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// SysAllocString allocates memory for string and copies string into memory. -func SysAllocString(v string) (ss *int16) { - pss, _, _ := procSysAllocString.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(v)))) - ss = (*int16)(unsafe.Pointer(pss)) - return -} - -// SysAllocStringLen copies up to length of given string returning pointer. -func SysAllocStringLen(v string) (ss *int16) { - utf16 := utf16.Encode([]rune(v + "\x00")) - ptr := &utf16[0] - - pss, _, _ := procSysAllocStringLen.Call(uintptr(unsafe.Pointer(ptr)), uintptr(len(utf16)-1)) - ss = (*int16)(unsafe.Pointer(pss)) - return -} - -// SysFreeString frees string system memory. This must be called with SysAllocString. -func SysFreeString(v *int16) (err error) { - hr, _, _ := procSysFreeString.Call(uintptr(unsafe.Pointer(v))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// SysStringLen is the length of the system allocated string. -func SysStringLen(v *int16) uint32 { - l, _, _ := procSysStringLen.Call(uintptr(unsafe.Pointer(v))) - return uint32(l) -} - -// CreateStdDispatch provides default IDispatch implementation for IUnknown. -// -// This handles default IDispatch implementation for objects. It haves a few -// limitations with only supporting one language. It will also only return -// default exception codes. -func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (disp *IDispatch, err error) { - hr, _, _ := procCreateStdDispatch.Call( - uintptr(unsafe.Pointer(unk)), - v, - uintptr(unsafe.Pointer(ptinfo)), - uintptr(unsafe.Pointer(&disp))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch. -// -// This will not handle the full implementation of the interface. -func CreateDispTypeInfo(idata *INTERFACEDATA) (pptinfo *IUnknown, err error) { - hr, _, _ := procCreateDispTypeInfo.Call( - uintptr(unsafe.Pointer(idata)), - uintptr(GetUserDefaultLCID()), - uintptr(unsafe.Pointer(&pptinfo))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// copyMemory moves location of a block of memory. -func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) { - procCopyMemory.Call(uintptr(dest), uintptr(src), uintptr(length)) -} - -// GetUserDefaultLCID retrieves current user default locale. -func GetUserDefaultLCID() (lcid uint32) { - ret, _, _ := procGetUserDefaultLCID.Call() - lcid = uint32(ret) - return -} - -// GetMessage in message queue from runtime. -// -// This function appears to block. PeekMessage does not block. -func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, err error) { - r0, _, err := procGetMessageW.Call(uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(MsgFilterMin), uintptr(MsgFilterMax)) - ret = int32(r0) - return -} - -// DispatchMessage to window procedure. -func DispatchMessage(msg *Msg) (ret int32) { - r0, _, _ := procDispatchMessageW.Call(uintptr(unsafe.Pointer(msg))) - ret = int32(r0) - return -} diff --git a/vendor/github.com/go-ole/go-ole/com_func.go b/vendor/github.com/go-ole/go-ole/com_func.go deleted file mode 100644 index cef539d9..00000000 --- a/vendor/github.com/go-ole/go-ole/com_func.go +++ /dev/null @@ -1,174 +0,0 @@ -// +build !windows - -package ole - -import ( - "time" - "unsafe" -) - -// coInitialize initializes COM library on current thread. -// -// MSDN documentation suggests that this function should not be called. Call -// CoInitializeEx() instead. The reason has to do with threading and this -// function is only for single-threaded apartments. -// -// That said, most users of the library have gotten away with just this -// function. If you are experiencing threading issues, then use -// CoInitializeEx(). -func coInitialize() error { - return NewError(E_NOTIMPL) -} - -// coInitializeEx initializes COM library with concurrency model. -func coInitializeEx(coinit uint32) error { - return NewError(E_NOTIMPL) -} - -// CoInitialize initializes COM library on current thread. -// -// MSDN documentation suggests that this function should not be called. Call -// CoInitializeEx() instead. The reason has to do with threading and this -// function is only for single-threaded apartments. -// -// That said, most users of the library have gotten away with just this -// function. If you are experiencing threading issues, then use -// CoInitializeEx(). -func CoInitialize(p uintptr) error { - return NewError(E_NOTIMPL) -} - -// CoInitializeEx initializes COM library with concurrency model. -func CoInitializeEx(p uintptr, coinit uint32) error { - return NewError(E_NOTIMPL) -} - -// CoUninitialize uninitializes COM Library. -func CoUninitialize() {} - -// CoTaskMemFree frees memory pointer. -func CoTaskMemFree(memptr uintptr) {} - -// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier. -// -// The Programmatic Identifier must be registered, because it will be looked up -// in the Windows Registry. The registry entry has the following keys: CLSID, -// Insertable, Protocol and Shell -// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx). -// -// programID identifies the class id with less precision and is not guaranteed -// to be unique. These are usually found in the registry under -// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of -// "Program.Component.Version" with version being optional. -// -// CLSIDFromProgID in Windows API. -func CLSIDFromProgID(progId string) (*GUID, error) { - return nil, NewError(E_NOTIMPL) -} - -// CLSIDFromString retrieves Class ID from string representation. -// -// This is technically the string version of the GUID and will convert the -// string to object. -// -// CLSIDFromString in Windows API. -func CLSIDFromString(str string) (*GUID, error) { - return nil, NewError(E_NOTIMPL) -} - -// StringFromCLSID returns GUID formated string from GUID object. -func StringFromCLSID(clsid *GUID) (string, error) { - return "", NewError(E_NOTIMPL) -} - -// IIDFromString returns GUID from program ID. -func IIDFromString(progId string) (*GUID, error) { - return nil, NewError(E_NOTIMPL) -} - -// StringFromIID returns GUID formatted string from GUID object. -func StringFromIID(iid *GUID) (string, error) { - return "", NewError(E_NOTIMPL) -} - -// CreateInstance of single uninitialized object with GUID. -func CreateInstance(clsid *GUID, iid *GUID) (*IUnknown, error) { - return nil, NewError(E_NOTIMPL) -} - -// GetActiveObject retrieves pointer to active object. -func GetActiveObject(clsid *GUID, iid *GUID) (*IUnknown, error) { - return nil, NewError(E_NOTIMPL) -} - -// VariantInit initializes variant. -func VariantInit(v *VARIANT) error { - return NewError(E_NOTIMPL) -} - -// VariantClear clears value in Variant settings to VT_EMPTY. -func VariantClear(v *VARIANT) error { - return NewError(E_NOTIMPL) -} - -// SysAllocString allocates memory for string and copies string into memory. -func SysAllocString(v string) *int16 { - u := int16(0) - return &u -} - -// SysAllocStringLen copies up to length of given string returning pointer. -func SysAllocStringLen(v string) *int16 { - u := int16(0) - return &u -} - -// SysFreeString frees string system memory. This must be called with SysAllocString. -func SysFreeString(v *int16) error { - return NewError(E_NOTIMPL) -} - -// SysStringLen is the length of the system allocated string. -func SysStringLen(v *int16) uint32 { - return uint32(0) -} - -// CreateStdDispatch provides default IDispatch implementation for IUnknown. -// -// This handles default IDispatch implementation for objects. It haves a few -// limitations with only supporting one language. It will also only return -// default exception codes. -func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (*IDispatch, error) { - return nil, NewError(E_NOTIMPL) -} - -// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch. -// -// This will not handle the full implementation of the interface. -func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error) { - return nil, NewError(E_NOTIMPL) -} - -// copyMemory moves location of a block of memory. -func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {} - -// GetUserDefaultLCID retrieves current user default locale. -func GetUserDefaultLCID() uint32 { - return uint32(0) -} - -// GetMessage in message queue from runtime. -// -// This function appears to block. PeekMessage does not block. -func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error) { - return int32(0), NewError(E_NOTIMPL) -} - -// DispatchMessage to window procedure. -func DispatchMessage(msg *Msg) int32 { - return int32(0) -} - -func GetVariantDate(value uint64) (time.Time, error) { - return time.Now(), NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/connect.go b/vendor/github.com/go-ole/go-ole/connect.go deleted file mode 100644 index b2ac2ec6..00000000 --- a/vendor/github.com/go-ole/go-ole/connect.go +++ /dev/null @@ -1,192 +0,0 @@ -package ole - -// Connection contains IUnknown for fluent interface interaction. -// -// Deprecated. Use oleutil package instead. -type Connection struct { - Object *IUnknown // Access COM -} - -// Initialize COM. -func (*Connection) Initialize() (err error) { - return coInitialize() -} - -// Uninitialize COM. -func (*Connection) Uninitialize() { - CoUninitialize() -} - -// Create IUnknown object based first on ProgId and then from String. -func (c *Connection) Create(progId string) (err error) { - var clsid *GUID - clsid, err = CLSIDFromProgID(progId) - if err != nil { - clsid, err = CLSIDFromString(progId) - if err != nil { - return - } - } - - unknown, err := CreateInstance(clsid, IID_IUnknown) - if err != nil { - return - } - c.Object = unknown - - return -} - -// Release IUnknown object. -func (c *Connection) Release() { - c.Object.Release() -} - -// Load COM object from list of programIDs or strings. -func (c *Connection) Load(names ...string) (errors []error) { - var tempErrors []error = make([]error, len(names)) - var numErrors int = 0 - for _, name := range names { - err := c.Create(name) - if err != nil { - tempErrors = append(tempErrors, err) - numErrors += 1 - continue - } - break - } - - copy(errors, tempErrors[0:numErrors]) - return -} - -// Dispatch returns Dispatch object. -func (c *Connection) Dispatch() (object *Dispatch, err error) { - dispatch, err := c.Object.QueryInterface(IID_IDispatch) - if err != nil { - return - } - object = &Dispatch{dispatch} - return -} - -// Dispatch stores IDispatch object. -type Dispatch struct { - Object *IDispatch // Dispatch object. -} - -// Call method on IDispatch with parameters. -func (d *Dispatch) Call(method string, params ...interface{}) (result *VARIANT, err error) { - id, err := d.GetId(method) - if err != nil { - return - } - - result, err = d.Invoke(id, DISPATCH_METHOD, params) - return -} - -// MustCall method on IDispatch with parameters. -func (d *Dispatch) MustCall(method string, params ...interface{}) (result *VARIANT) { - id, err := d.GetId(method) - if err != nil { - panic(err) - } - - result, err = d.Invoke(id, DISPATCH_METHOD, params) - if err != nil { - panic(err) - } - - return -} - -// Get property on IDispatch with parameters. -func (d *Dispatch) Get(name string, params ...interface{}) (result *VARIANT, err error) { - id, err := d.GetId(name) - if err != nil { - return - } - result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) - return -} - -// MustGet property on IDispatch with parameters. -func (d *Dispatch) MustGet(name string, params ...interface{}) (result *VARIANT) { - id, err := d.GetId(name) - if err != nil { - panic(err) - } - - result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) - if err != nil { - panic(err) - } - return -} - -// Set property on IDispatch with parameters. -func (d *Dispatch) Set(name string, params ...interface{}) (result *VARIANT, err error) { - id, err := d.GetId(name) - if err != nil { - return - } - result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) - return -} - -// MustSet property on IDispatch with parameters. -func (d *Dispatch) MustSet(name string, params ...interface{}) (result *VARIANT) { - id, err := d.GetId(name) - if err != nil { - panic(err) - } - - result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) - if err != nil { - panic(err) - } - return -} - -// GetId retrieves ID of name on IDispatch. -func (d *Dispatch) GetId(name string) (id int32, err error) { - var dispid []int32 - dispid, err = d.Object.GetIDsOfName([]string{name}) - if err != nil { - return - } - id = dispid[0] - return -} - -// GetIds retrieves all IDs of names on IDispatch. -func (d *Dispatch) GetIds(names ...string) (dispid []int32, err error) { - dispid, err = d.Object.GetIDsOfName(names) - return -} - -// Invoke IDispatch on DisplayID of dispatch type with parameters. -// -// There have been problems where if send cascading params..., it would error -// out because the parameters would be empty. -func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface{}) (result *VARIANT, err error) { - if len(params) < 1 { - result, err = d.Object.Invoke(id, dispatch) - } else { - result, err = d.Object.Invoke(id, dispatch, params...) - } - return -} - -// Release IDispatch object. -func (d *Dispatch) Release() { - d.Object.Release() -} - -// Connect initializes COM and attempts to load IUnknown based on given names. -func Connect(names ...string) (connection *Connection) { - connection.Initialize() - connection.Load(names...) - return -} diff --git a/vendor/github.com/go-ole/go-ole/constants.go b/vendor/github.com/go-ole/go-ole/constants.go deleted file mode 100644 index fd0c6d74..00000000 --- a/vendor/github.com/go-ole/go-ole/constants.go +++ /dev/null @@ -1,153 +0,0 @@ -package ole - -const ( - CLSCTX_INPROC_SERVER = 1 - CLSCTX_INPROC_HANDLER = 2 - CLSCTX_LOCAL_SERVER = 4 - CLSCTX_INPROC_SERVER16 = 8 - CLSCTX_REMOTE_SERVER = 16 - CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER - CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER - CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER -) - -const ( - COINIT_APARTMENTTHREADED = 0x2 - COINIT_MULTITHREADED = 0x0 - COINIT_DISABLE_OLE1DDE = 0x4 - COINIT_SPEED_OVER_MEMORY = 0x8 -) - -const ( - DISPATCH_METHOD = 1 - DISPATCH_PROPERTYGET = 2 - DISPATCH_PROPERTYPUT = 4 - DISPATCH_PROPERTYPUTREF = 8 -) - -const ( - S_OK = 0x00000000 - E_UNEXPECTED = 0x8000FFFF - E_NOTIMPL = 0x80004001 - E_OUTOFMEMORY = 0x8007000E - E_INVALIDARG = 0x80070057 - E_NOINTERFACE = 0x80004002 - E_POINTER = 0x80004003 - E_HANDLE = 0x80070006 - E_ABORT = 0x80004004 - E_FAIL = 0x80004005 - E_ACCESSDENIED = 0x80070005 - E_PENDING = 0x8000000A - - CO_E_CLASSSTRING = 0x800401F3 -) - -const ( - CC_FASTCALL = iota - CC_CDECL - CC_MSCPASCAL - CC_PASCAL = CC_MSCPASCAL - CC_MACPASCAL - CC_STDCALL - CC_FPFASTCALL - CC_SYSCALL - CC_MPWCDECL - CC_MPWPASCAL - CC_MAX = CC_MPWPASCAL -) - -type VT uint16 - -const ( - VT_EMPTY VT = 0x0 - VT_NULL VT = 0x1 - VT_I2 VT = 0x2 - VT_I4 VT = 0x3 - VT_R4 VT = 0x4 - VT_R8 VT = 0x5 - VT_CY VT = 0x6 - VT_DATE VT = 0x7 - VT_BSTR VT = 0x8 - VT_DISPATCH VT = 0x9 - VT_ERROR VT = 0xa - VT_BOOL VT = 0xb - VT_VARIANT VT = 0xc - VT_UNKNOWN VT = 0xd - VT_DECIMAL VT = 0xe - VT_I1 VT = 0x10 - VT_UI1 VT = 0x11 - VT_UI2 VT = 0x12 - VT_UI4 VT = 0x13 - VT_I8 VT = 0x14 - VT_UI8 VT = 0x15 - VT_INT VT = 0x16 - VT_UINT VT = 0x17 - VT_VOID VT = 0x18 - VT_HRESULT VT = 0x19 - VT_PTR VT = 0x1a - VT_SAFEARRAY VT = 0x1b - VT_CARRAY VT = 0x1c - VT_USERDEFINED VT = 0x1d - VT_LPSTR VT = 0x1e - VT_LPWSTR VT = 0x1f - VT_RECORD VT = 0x24 - VT_INT_PTR VT = 0x25 - VT_UINT_PTR VT = 0x26 - VT_FILETIME VT = 0x40 - VT_BLOB VT = 0x41 - VT_STREAM VT = 0x42 - VT_STORAGE VT = 0x43 - VT_STREAMED_OBJECT VT = 0x44 - VT_STORED_OBJECT VT = 0x45 - VT_BLOB_OBJECT VT = 0x46 - VT_CF VT = 0x47 - VT_CLSID VT = 0x48 - VT_BSTR_BLOB VT = 0xfff - VT_VECTOR VT = 0x1000 - VT_ARRAY VT = 0x2000 - VT_BYREF VT = 0x4000 - VT_RESERVED VT = 0x8000 - VT_ILLEGAL VT = 0xffff - VT_ILLEGALMASKED VT = 0xfff - VT_TYPEMASK VT = 0xfff -) - -const ( - DISPID_UNKNOWN = -1 - DISPID_VALUE = 0 - DISPID_PROPERTYPUT = -3 - DISPID_NEWENUM = -4 - DISPID_EVALUATE = -5 - DISPID_CONSTRUCTOR = -6 - DISPID_DESTRUCTOR = -7 - DISPID_COLLECT = -8 -) - -const ( - TKIND_ENUM = 1 - TKIND_RECORD = 2 - TKIND_MODULE = 3 - TKIND_INTERFACE = 4 - TKIND_DISPATCH = 5 - TKIND_COCLASS = 6 - TKIND_ALIAS = 7 - TKIND_UNION = 8 - TKIND_MAX = 9 -) - -// Safe Array Feature Flags - -const ( - FADF_AUTO = 0x0001 - FADF_STATIC = 0x0002 - FADF_EMBEDDED = 0x0004 - FADF_FIXEDSIZE = 0x0010 - FADF_RECORD = 0x0020 - FADF_HAVEIID = 0x0040 - FADF_HAVEVARTYPE = 0x0080 - FADF_BSTR = 0x0100 - FADF_UNKNOWN = 0x0200 - FADF_DISPATCH = 0x0400 - FADF_VARIANT = 0x0800 - FADF_RESERVED = 0xF008 -) diff --git a/vendor/github.com/go-ole/go-ole/error.go b/vendor/github.com/go-ole/go-ole/error.go deleted file mode 100644 index 096b456d..00000000 --- a/vendor/github.com/go-ole/go-ole/error.go +++ /dev/null @@ -1,51 +0,0 @@ -package ole - -// OleError stores COM errors. -type OleError struct { - hr uintptr - description string - subError error -} - -// NewError creates new error with HResult. -func NewError(hr uintptr) *OleError { - return &OleError{hr: hr} -} - -// NewErrorWithDescription creates new COM error with HResult and description. -func NewErrorWithDescription(hr uintptr, description string) *OleError { - return &OleError{hr: hr, description: description} -} - -// NewErrorWithSubError creates new COM error with parent error. -func NewErrorWithSubError(hr uintptr, description string, err error) *OleError { - return &OleError{hr: hr, description: description, subError: err} -} - -// Code is the HResult. -func (v *OleError) Code() uintptr { - return uintptr(v.hr) -} - -// String description, either manually set or format message with error code. -func (v *OleError) String() string { - if v.description != "" { - return errstr(int(v.hr)) + " (" + v.description + ")" - } - return errstr(int(v.hr)) -} - -// Error implements error interface. -func (v *OleError) Error() string { - return v.String() -} - -// Description retrieves error summary, if there is one. -func (v *OleError) Description() string { - return v.description -} - -// SubError returns parent error, if there is one. -func (v *OleError) SubError() error { - return v.subError -} diff --git a/vendor/github.com/go-ole/go-ole/error_func.go b/vendor/github.com/go-ole/go-ole/error_func.go deleted file mode 100644 index 8a2ffaa2..00000000 --- a/vendor/github.com/go-ole/go-ole/error_func.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build !windows - -package ole - -// errstr converts error code to string. -func errstr(errno int) string { - return "" -} diff --git a/vendor/github.com/go-ole/go-ole/error_windows.go b/vendor/github.com/go-ole/go-ole/error_windows.go deleted file mode 100644 index d0e8e685..00000000 --- a/vendor/github.com/go-ole/go-ole/error_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build windows - -package ole - -import ( - "fmt" - "syscall" - "unicode/utf16" -) - -// errstr converts error code to string. -func errstr(errno int) string { - // ask windows for the remaining errors - var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS - b := make([]uint16, 300) - n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) - if err != nil { - return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) - } - // trim terminating \r and \n - for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { - } - return string(utf16.Decode(b[:n])) -} diff --git a/vendor/github.com/go-ole/go-ole/go.mod b/vendor/github.com/go-ole/go-ole/go.mod deleted file mode 100644 index df98533e..00000000 --- a/vendor/github.com/go-ole/go-ole/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/go-ole/go-ole - -go 1.12 diff --git a/vendor/github.com/go-ole/go-ole/guid.go b/vendor/github.com/go-ole/go-ole/guid.go deleted file mode 100644 index 8d20f68f..00000000 --- a/vendor/github.com/go-ole/go-ole/guid.go +++ /dev/null @@ -1,284 +0,0 @@ -package ole - -var ( - // IID_NULL is null Interface ID, used when no other Interface ID is known. - IID_NULL = NewGUID("{00000000-0000-0000-0000-000000000000}") - - // IID_IUnknown is for IUnknown interfaces. - IID_IUnknown = NewGUID("{00000000-0000-0000-C000-000000000046}") - - // IID_IDispatch is for IDispatch interfaces. - IID_IDispatch = NewGUID("{00020400-0000-0000-C000-000000000046}") - - // IID_IEnumVariant is for IEnumVariant interfaces - IID_IEnumVariant = NewGUID("{00020404-0000-0000-C000-000000000046}") - - // IID_IConnectionPointContainer is for IConnectionPointContainer interfaces. - IID_IConnectionPointContainer = NewGUID("{B196B284-BAB4-101A-B69C-00AA00341D07}") - - // IID_IConnectionPoint is for IConnectionPoint interfaces. - IID_IConnectionPoint = NewGUID("{B196B286-BAB4-101A-B69C-00AA00341D07}") - - // IID_IInspectable is for IInspectable interfaces. - IID_IInspectable = NewGUID("{AF86E2E0-B12D-4C6A-9C5A-D7AA65101E90}") - - // IID_IProvideClassInfo is for IProvideClassInfo interfaces. - IID_IProvideClassInfo = NewGUID("{B196B283-BAB4-101A-B69C-00AA00341D07}") -) - -// These are for testing and not part of any library. -var ( - // IID_ICOMTestString is for ICOMTestString interfaces. - // - // {E0133EB4-C36F-469A-9D3D-C66B84BE19ED} - IID_ICOMTestString = NewGUID("{E0133EB4-C36F-469A-9D3D-C66B84BE19ED}") - - // IID_ICOMTestInt8 is for ICOMTestInt8 interfaces. - // - // {BEB06610-EB84-4155-AF58-E2BFF53680B4} - IID_ICOMTestInt8 = NewGUID("{BEB06610-EB84-4155-AF58-E2BFF53680B4}") - - // IID_ICOMTestInt16 is for ICOMTestInt16 interfaces. - // - // {DAA3F9FA-761E-4976-A860-8364CE55F6FC} - IID_ICOMTestInt16 = NewGUID("{DAA3F9FA-761E-4976-A860-8364CE55F6FC}") - - // IID_ICOMTestInt32 is for ICOMTestInt32 interfaces. - // - // {E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0} - IID_ICOMTestInt32 = NewGUID("{E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0}") - - // IID_ICOMTestInt64 is for ICOMTestInt64 interfaces. - // - // {8D437CBC-B3ED-485C-BC32-C336432A1623} - IID_ICOMTestInt64 = NewGUID("{8D437CBC-B3ED-485C-BC32-C336432A1623}") - - // IID_ICOMTestFloat is for ICOMTestFloat interfaces. - // - // {BF1ED004-EA02-456A-AA55-2AC8AC6B054C} - IID_ICOMTestFloat = NewGUID("{BF1ED004-EA02-456A-AA55-2AC8AC6B054C}") - - // IID_ICOMTestDouble is for ICOMTestDouble interfaces. - // - // {BF908A81-8687-4E93-999F-D86FAB284BA0} - IID_ICOMTestDouble = NewGUID("{BF908A81-8687-4E93-999F-D86FAB284BA0}") - - // IID_ICOMTestBoolean is for ICOMTestBoolean interfaces. - // - // {D530E7A6-4EE8-40D1-8931-3D63B8605010} - IID_ICOMTestBoolean = NewGUID("{D530E7A6-4EE8-40D1-8931-3D63B8605010}") - - // IID_ICOMEchoTestObject is for ICOMEchoTestObject interfaces. - // - // {6485B1EF-D780-4834-A4FE-1EBB51746CA3} - IID_ICOMEchoTestObject = NewGUID("{6485B1EF-D780-4834-A4FE-1EBB51746CA3}") - - // IID_ICOMTestTypes is for ICOMTestTypes interfaces. - // - // {CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0} - IID_ICOMTestTypes = NewGUID("{CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0}") - - // CLSID_COMEchoTestObject is for COMEchoTestObject class. - // - // {3C24506A-AE9E-4D50-9157-EF317281F1B0} - CLSID_COMEchoTestObject = NewGUID("{3C24506A-AE9E-4D50-9157-EF317281F1B0}") - - // CLSID_COMTestScalarClass is for COMTestScalarClass class. - // - // {865B85C5-0334-4AC6-9EF6-AACEC8FC5E86} - CLSID_COMTestScalarClass = NewGUID("{865B85C5-0334-4AC6-9EF6-AACEC8FC5E86}") -) - -const hextable = "0123456789ABCDEF" -const emptyGUID = "{00000000-0000-0000-0000-000000000000}" - -// GUID is Windows API specific GUID type. -// -// This exists to match Windows GUID type for direct passing for COM. -// Format is in xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx. -type GUID struct { - Data1 uint32 - Data2 uint16 - Data3 uint16 - Data4 [8]byte -} - -// NewGUID converts the given string into a globally unique identifier that is -// compliant with the Windows API. -// -// The supplied string may be in any of these formats: -// -// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} -// -// The conversion of the supplied string is not case-sensitive. -func NewGUID(guid string) *GUID { - d := []byte(guid) - var d1, d2, d3, d4a, d4b []byte - - switch len(d) { - case 38: - if d[0] != '{' || d[37] != '}' { - return nil - } - d = d[1:37] - fallthrough - case 36: - if d[8] != '-' || d[13] != '-' || d[18] != '-' || d[23] != '-' { - return nil - } - d1 = d[0:8] - d2 = d[9:13] - d3 = d[14:18] - d4a = d[19:23] - d4b = d[24:36] - case 32: - d1 = d[0:8] - d2 = d[8:12] - d3 = d[12:16] - d4a = d[16:20] - d4b = d[20:32] - default: - return nil - } - - var g GUID - var ok1, ok2, ok3, ok4 bool - g.Data1, ok1 = decodeHexUint32(d1) - g.Data2, ok2 = decodeHexUint16(d2) - g.Data3, ok3 = decodeHexUint16(d3) - g.Data4, ok4 = decodeHexByte64(d4a, d4b) - if ok1 && ok2 && ok3 && ok4 { - return &g - } - return nil -} - -func decodeHexUint32(src []byte) (value uint32, ok bool) { - var b1, b2, b3, b4 byte - var ok1, ok2, ok3, ok4 bool - b1, ok1 = decodeHexByte(src[0], src[1]) - b2, ok2 = decodeHexByte(src[2], src[3]) - b3, ok3 = decodeHexByte(src[4], src[5]) - b4, ok4 = decodeHexByte(src[6], src[7]) - value = (uint32(b1) << 24) | (uint32(b2) << 16) | (uint32(b3) << 8) | uint32(b4) - ok = ok1 && ok2 && ok3 && ok4 - return -} - -func decodeHexUint16(src []byte) (value uint16, ok bool) { - var b1, b2 byte - var ok1, ok2 bool - b1, ok1 = decodeHexByte(src[0], src[1]) - b2, ok2 = decodeHexByte(src[2], src[3]) - value = (uint16(b1) << 8) | uint16(b2) - ok = ok1 && ok2 - return -} - -func decodeHexByte64(s1 []byte, s2 []byte) (value [8]byte, ok bool) { - var ok1, ok2, ok3, ok4, ok5, ok6, ok7, ok8 bool - value[0], ok1 = decodeHexByte(s1[0], s1[1]) - value[1], ok2 = decodeHexByte(s1[2], s1[3]) - value[2], ok3 = decodeHexByte(s2[0], s2[1]) - value[3], ok4 = decodeHexByte(s2[2], s2[3]) - value[4], ok5 = decodeHexByte(s2[4], s2[5]) - value[5], ok6 = decodeHexByte(s2[6], s2[7]) - value[6], ok7 = decodeHexByte(s2[8], s2[9]) - value[7], ok8 = decodeHexByte(s2[10], s2[11]) - ok = ok1 && ok2 && ok3 && ok4 && ok5 && ok6 && ok7 && ok8 - return -} - -func decodeHexByte(c1, c2 byte) (value byte, ok bool) { - var n1, n2 byte - var ok1, ok2 bool - n1, ok1 = decodeHexChar(c1) - n2, ok2 = decodeHexChar(c2) - value = (n1 << 4) | n2 - ok = ok1 && ok2 - return -} - -func decodeHexChar(c byte) (byte, bool) { - switch { - case '0' <= c && c <= '9': - return c - '0', true - case 'a' <= c && c <= 'f': - return c - 'a' + 10, true - case 'A' <= c && c <= 'F': - return c - 'A' + 10, true - } - - return 0, false -} - -// String converts the GUID to string form. It will adhere to this pattern: -// -// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} -// -// If the GUID is nil, the string representation of an empty GUID is returned: -// -// {00000000-0000-0000-0000-000000000000} -func (guid *GUID) String() string { - if guid == nil { - return emptyGUID - } - - var c [38]byte - c[0] = '{' - putUint32Hex(c[1:9], guid.Data1) - c[9] = '-' - putUint16Hex(c[10:14], guid.Data2) - c[14] = '-' - putUint16Hex(c[15:19], guid.Data3) - c[19] = '-' - putByteHex(c[20:24], guid.Data4[0:2]) - c[24] = '-' - putByteHex(c[25:37], guid.Data4[2:8]) - c[37] = '}' - return string(c[:]) -} - -func putUint32Hex(b []byte, v uint32) { - b[0] = hextable[byte(v>>24)>>4] - b[1] = hextable[byte(v>>24)&0x0f] - b[2] = hextable[byte(v>>16)>>4] - b[3] = hextable[byte(v>>16)&0x0f] - b[4] = hextable[byte(v>>8)>>4] - b[5] = hextable[byte(v>>8)&0x0f] - b[6] = hextable[byte(v)>>4] - b[7] = hextable[byte(v)&0x0f] -} - -func putUint16Hex(b []byte, v uint16) { - b[0] = hextable[byte(v>>8)>>4] - b[1] = hextable[byte(v>>8)&0x0f] - b[2] = hextable[byte(v)>>4] - b[3] = hextable[byte(v)&0x0f] -} - -func putByteHex(dst, src []byte) { - for i := 0; i < len(src); i++ { - dst[i*2] = hextable[src[i]>>4] - dst[i*2+1] = hextable[src[i]&0x0f] - } -} - -// IsEqualGUID compares two GUID. -// -// Not constant time comparison. -func IsEqualGUID(guid1 *GUID, guid2 *GUID) bool { - return guid1.Data1 == guid2.Data1 && - guid1.Data2 == guid2.Data2 && - guid1.Data3 == guid2.Data3 && - guid1.Data4[0] == guid2.Data4[0] && - guid1.Data4[1] == guid2.Data4[1] && - guid1.Data4[2] == guid2.Data4[2] && - guid1.Data4[3] == guid2.Data4[3] && - guid1.Data4[4] == guid2.Data4[4] && - guid1.Data4[5] == guid2.Data4[5] && - guid1.Data4[6] == guid2.Data4[6] && - guid1.Data4[7] == guid2.Data4[7] -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint.go deleted file mode 100644 index 9e6c49f4..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpoint.go +++ /dev/null @@ -1,20 +0,0 @@ -package ole - -import "unsafe" - -type IConnectionPoint struct { - IUnknown -} - -type IConnectionPointVtbl struct { - IUnknownVtbl - GetConnectionInterface uintptr - GetConnectionPointContainer uintptr - Advise uintptr - Unadvise uintptr - EnumConnections uintptr -} - -func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { - return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go deleted file mode 100644 index 5414dc3c..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build !windows - -package ole - -import "unsafe" - -func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { - return int32(0) -} - -func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { - return uint32(0), NewError(E_NOTIMPL) -} - -func (v *IConnectionPoint) Unadvise(cookie uint32) error { - return NewError(E_NOTIMPL) -} - -func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { - return NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go deleted file mode 100644 index 32bc1832..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go +++ /dev/null @@ -1,43 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unsafe" -) - -func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { - // XXX: This doesn't look like it does what it's supposed to - return release((*IUnknown)(unsafe.Pointer(v))) -} - -func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err error) { - hr, _, _ := syscall.Syscall( - v.VTable().Advise, - 3, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(unknown)), - uintptr(unsafe.Pointer(&cookie))) - if hr != 0 { - err = NewError(hr) - } - return -} - -func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) { - hr, _, _ := syscall.Syscall( - v.VTable().Unadvise, - 2, - uintptr(unsafe.Pointer(v)), - uintptr(cookie), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} - -func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error { - return NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go deleted file mode 100644 index 165860d1..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go +++ /dev/null @@ -1,17 +0,0 @@ -package ole - -import "unsafe" - -type IConnectionPointContainer struct { - IUnknown -} - -type IConnectionPointContainerVtbl struct { - IUnknownVtbl - EnumConnectionPoints uintptr - FindConnectionPoint uintptr -} - -func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { - return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go deleted file mode 100644 index 5dfa42aa..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !windows - -package ole - -func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { - return NewError(E_NOTIMPL) -} - -func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { - return NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go deleted file mode 100644 index ad30d79e..00000000 --- a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unsafe" -) - -func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { - return NewError(E_NOTIMPL) -} - -func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { - hr, _, _ := syscall.Syscall( - v.VTable().FindConnectionPoint, - 3, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(point))) - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/idispatch.go b/vendor/github.com/go-ole/go-ole/idispatch.go deleted file mode 100644 index d4af1240..00000000 --- a/vendor/github.com/go-ole/go-ole/idispatch.go +++ /dev/null @@ -1,94 +0,0 @@ -package ole - -import "unsafe" - -type IDispatch struct { - IUnknown -} - -type IDispatchVtbl struct { - IUnknownVtbl - GetTypeInfoCount uintptr - GetTypeInfo uintptr - GetIDsOfNames uintptr - Invoke uintptr -} - -func (v *IDispatch) VTable() *IDispatchVtbl { - return (*IDispatchVtbl)(unsafe.Pointer(v.RawVTable)) -} - -func (v *IDispatch) GetIDsOfName(names []string) (dispid []int32, err error) { - dispid, err = getIDsOfName(v, names) - return -} - -func (v *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) { - result, err = invoke(v, dispid, dispatch, params...) - return -} - -func (v *IDispatch) GetTypeInfoCount() (c uint32, err error) { - c, err = getTypeInfoCount(v) - return -} - -func (v *IDispatch) GetTypeInfo() (tinfo *ITypeInfo, err error) { - tinfo, err = getTypeInfo(v) - return -} - -// GetSingleIDOfName is a helper that returns single display ID for IDispatch name. -// -// This replaces the common pattern of attempting to get a single name from the list of available -// IDs. It gives the first ID, if it is available. -func (v *IDispatch) GetSingleIDOfName(name string) (displayID int32, err error) { - var displayIDs []int32 - displayIDs, err = v.GetIDsOfName([]string{name}) - if err != nil { - return - } - displayID = displayIDs[0] - return -} - -// InvokeWithOptionalArgs accepts arguments as an array, works like Invoke. -// -// Accepts name and will attempt to retrieve Display ID to pass to Invoke. -// -// Passing params as an array is a workaround that could be fixed in later versions of Go that -// prevent passing empty params. During testing it was discovered that this is an acceptable way of -// getting around not being able to pass params normally. -func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16, params []interface{}) (result *VARIANT, err error) { - displayID, err := v.GetSingleIDOfName(name) - if err != nil { - return - } - - if len(params) < 1 { - result, err = v.Invoke(displayID, dispatch) - } else { - result, err = v.Invoke(displayID, dispatch, params...) - } - - return -} - -// CallMethod invokes named function with arguments on object. -func (v *IDispatch) CallMethod(name string, params ...interface{}) (*VARIANT, error) { - return v.InvokeWithOptionalArgs(name, DISPATCH_METHOD, params) -} - -// GetProperty retrieves the property with the name with the ability to pass arguments. -// -// Most of the time you will not need to pass arguments as most objects do not allow for this -// feature. Or at least, should not allow for this feature. Some servers don't follow best practices -// and this is provided for those edge cases. -func (v *IDispatch) GetProperty(name string, params ...interface{}) (*VARIANT, error) { - return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYGET, params) -} - -// PutProperty attempts to mutate a property in the object. -func (v *IDispatch) PutProperty(name string, params ...interface{}) (*VARIANT, error) { - return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYPUT, params) -} diff --git a/vendor/github.com/go-ole/go-ole/idispatch_func.go b/vendor/github.com/go-ole/go-ole/idispatch_func.go deleted file mode 100644 index b8fbbe31..00000000 --- a/vendor/github.com/go-ole/go-ole/idispatch_func.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !windows - -package ole - -func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { - return []int32{}, NewError(E_NOTIMPL) -} - -func getTypeInfoCount(disp *IDispatch) (uint32, error) { - return uint32(0), NewError(E_NOTIMPL) -} - -func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { - return nil, NewError(E_NOTIMPL) -} - -func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { - return nil, NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/idispatch_windows.go b/vendor/github.com/go-ole/go-ole/idispatch_windows.go deleted file mode 100644 index 6ec180b5..00000000 --- a/vendor/github.com/go-ole/go-ole/idispatch_windows.go +++ /dev/null @@ -1,200 +0,0 @@ -// +build windows - -package ole - -import ( - "math/big" - "syscall" - "time" - "unsafe" -) - -func getIDsOfName(disp *IDispatch, names []string) (dispid []int32, err error) { - wnames := make([]*uint16, len(names)) - for i := 0; i < len(names); i++ { - wnames[i] = syscall.StringToUTF16Ptr(names[i]) - } - dispid = make([]int32, len(names)) - namelen := uint32(len(names)) - hr, _, _ := syscall.Syscall6( - disp.VTable().GetIDsOfNames, - 6, - uintptr(unsafe.Pointer(disp)), - uintptr(unsafe.Pointer(IID_NULL)), - uintptr(unsafe.Pointer(&wnames[0])), - uintptr(namelen), - uintptr(GetUserDefaultLCID()), - uintptr(unsafe.Pointer(&dispid[0]))) - if hr != 0 { - err = NewError(hr) - } - return -} - -func getTypeInfoCount(disp *IDispatch) (c uint32, err error) { - hr, _, _ := syscall.Syscall( - disp.VTable().GetTypeInfoCount, - 2, - uintptr(unsafe.Pointer(disp)), - uintptr(unsafe.Pointer(&c)), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} - -func getTypeInfo(disp *IDispatch) (tinfo *ITypeInfo, err error) { - hr, _, _ := syscall.Syscall( - disp.VTable().GetTypeInfo, - 3, - uintptr(unsafe.Pointer(disp)), - uintptr(GetUserDefaultLCID()), - uintptr(unsafe.Pointer(&tinfo))) - if hr != 0 { - err = NewError(hr) - } - return -} - -func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) { - var dispparams DISPPARAMS - - if dispatch&DISPATCH_PROPERTYPUT != 0 { - dispnames := [1]int32{DISPID_PROPERTYPUT} - dispparams.rgdispidNamedArgs = uintptr(unsafe.Pointer(&dispnames[0])) - dispparams.cNamedArgs = 1 - } else if dispatch&DISPATCH_PROPERTYPUTREF != 0 { - dispnames := [1]int32{DISPID_PROPERTYPUT} - dispparams.rgdispidNamedArgs = uintptr(unsafe.Pointer(&dispnames[0])) - dispparams.cNamedArgs = 1 - } - var vargs []VARIANT - if len(params) > 0 { - vargs = make([]VARIANT, len(params)) - for i, v := range params { - //n := len(params)-i-1 - n := len(params) - i - 1 - VariantInit(&vargs[n]) - switch vv := v.(type) { - case bool: - if vv { - vargs[n] = NewVariant(VT_BOOL, 0xffff) - } else { - vargs[n] = NewVariant(VT_BOOL, 0) - } - case *bool: - vargs[n] = NewVariant(VT_BOOL|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*bool))))) - case uint8: - vargs[n] = NewVariant(VT_I1, int64(v.(uint8))) - case *uint8: - vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint8))))) - case int8: - vargs[n] = NewVariant(VT_I1, int64(v.(int8))) - case *int8: - vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint8))))) - case int16: - vargs[n] = NewVariant(VT_I2, int64(v.(int16))) - case *int16: - vargs[n] = NewVariant(VT_I2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int16))))) - case uint16: - vargs[n] = NewVariant(VT_UI2, int64(v.(uint16))) - case *uint16: - vargs[n] = NewVariant(VT_UI2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint16))))) - case int32: - vargs[n] = NewVariant(VT_I4, int64(v.(int32))) - case *int32: - vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int32))))) - case uint32: - vargs[n] = NewVariant(VT_UI4, int64(v.(uint32))) - case *uint32: - vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint32))))) - case int64: - vargs[n] = NewVariant(VT_I8, int64(v.(int64))) - case *int64: - vargs[n] = NewVariant(VT_I8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int64))))) - case uint64: - vargs[n] = NewVariant(VT_UI8, int64(uintptr(v.(uint64)))) - case *uint64: - vargs[n] = NewVariant(VT_UI8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint64))))) - case int: - vargs[n] = NewVariant(VT_I4, int64(v.(int))) - case *int: - vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int))))) - case uint: - vargs[n] = NewVariant(VT_UI4, int64(v.(uint))) - case *uint: - vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint))))) - case float32: - vargs[n] = NewVariant(VT_R4, *(*int64)(unsafe.Pointer(&vv))) - case *float32: - vargs[n] = NewVariant(VT_R4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float32))))) - case float64: - vargs[n] = NewVariant(VT_R8, *(*int64)(unsafe.Pointer(&vv))) - case *float64: - vargs[n] = NewVariant(VT_R8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float64))))) - case *big.Int: - vargs[n] = NewVariant(VT_DECIMAL, v.(*big.Int).Int64()) - case string: - vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(v.(string)))))) - case *string: - vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*string))))) - case time.Time: - s := vv.Format("2006-01-02 15:04:05") - vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(s))))) - case *time.Time: - s := vv.Format("2006-01-02 15:04:05") - vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(&s)))) - case *IDispatch: - vargs[n] = NewVariant(VT_DISPATCH, int64(uintptr(unsafe.Pointer(v.(*IDispatch))))) - case **IDispatch: - vargs[n] = NewVariant(VT_DISPATCH|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(**IDispatch))))) - case nil: - vargs[n] = NewVariant(VT_NULL, 0) - case *VARIANT: - vargs[n] = NewVariant(VT_VARIANT|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*VARIANT))))) - case []byte: - safeByteArray := safeArrayFromByteSlice(v.([]byte)) - vargs[n] = NewVariant(VT_ARRAY|VT_UI1, int64(uintptr(unsafe.Pointer(safeByteArray)))) - defer VariantClear(&vargs[n]) - case []string: - safeByteArray := safeArrayFromStringSlice(v.([]string)) - vargs[n] = NewVariant(VT_ARRAY|VT_BSTR, int64(uintptr(unsafe.Pointer(safeByteArray)))) - defer VariantClear(&vargs[n]) - default: - panic("unknown type") - } - } - dispparams.rgvarg = uintptr(unsafe.Pointer(&vargs[0])) - dispparams.cArgs = uint32(len(params)) - } - - result = new(VARIANT) - var excepInfo EXCEPINFO - VariantInit(result) - hr, _, _ := syscall.Syscall9( - disp.VTable().Invoke, - 9, - uintptr(unsafe.Pointer(disp)), - uintptr(dispid), - uintptr(unsafe.Pointer(IID_NULL)), - uintptr(GetUserDefaultLCID()), - uintptr(dispatch), - uintptr(unsafe.Pointer(&dispparams)), - uintptr(unsafe.Pointer(result)), - uintptr(unsafe.Pointer(&excepInfo)), - 0) - if hr != 0 { - err = NewErrorWithSubError(hr, BstrToString(excepInfo.bstrDescription), excepInfo) - } - for i, varg := range vargs { - n := len(params) - i - 1 - if varg.VT == VT_BSTR && varg.Val != 0 { - SysFreeString(((*int16)(unsafe.Pointer(uintptr(varg.Val))))) - } - if varg.VT == (VT_BSTR|VT_BYREF) && varg.Val != 0 { - *(params[n].(*string)) = LpOleStrToString(*(**uint16)(unsafe.Pointer(uintptr(varg.Val)))) - } - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant.go b/vendor/github.com/go-ole/go-ole/ienumvariant.go deleted file mode 100644 index 24338975..00000000 --- a/vendor/github.com/go-ole/go-ole/ienumvariant.go +++ /dev/null @@ -1,19 +0,0 @@ -package ole - -import "unsafe" - -type IEnumVARIANT struct { - IUnknown -} - -type IEnumVARIANTVtbl struct { - IUnknownVtbl - Next uintptr - Skip uintptr - Reset uintptr - Clone uintptr -} - -func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { - return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) -} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_func.go b/vendor/github.com/go-ole/go-ole/ienumvariant_func.go deleted file mode 100644 index c1484819..00000000 --- a/vendor/github.com/go-ole/go-ole/ienumvariant_func.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !windows - -package ole - -func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { - return nil, NewError(E_NOTIMPL) -} - -func (enum *IEnumVARIANT) Reset() error { - return NewError(E_NOTIMPL) -} - -func (enum *IEnumVARIANT) Skip(celt uint) error { - return NewError(E_NOTIMPL) -} - -func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { - return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go b/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go deleted file mode 100644 index 4781f3b8..00000000 --- a/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unsafe" -) - -func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) { - hr, _, _ := syscall.Syscall( - enum.VTable().Clone, - 2, - uintptr(unsafe.Pointer(enum)), - uintptr(unsafe.Pointer(&cloned)), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} - -func (enum *IEnumVARIANT) Reset() (err error) { - hr, _, _ := syscall.Syscall( - enum.VTable().Reset, - 1, - uintptr(unsafe.Pointer(enum)), - 0, - 0) - if hr != 0 { - err = NewError(hr) - } - return -} - -func (enum *IEnumVARIANT) Skip(celt uint) (err error) { - hr, _, _ := syscall.Syscall( - enum.VTable().Skip, - 2, - uintptr(unsafe.Pointer(enum)), - uintptr(celt), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} - -func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) { - hr, _, _ := syscall.Syscall6( - enum.VTable().Next, - 4, - uintptr(unsafe.Pointer(enum)), - uintptr(celt), - uintptr(unsafe.Pointer(&array)), - uintptr(unsafe.Pointer(&length)), - 0, - 0) - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable.go b/vendor/github.com/go-ole/go-ole/iinspectable.go deleted file mode 100644 index f4a19e25..00000000 --- a/vendor/github.com/go-ole/go-ole/iinspectable.go +++ /dev/null @@ -1,18 +0,0 @@ -package ole - -import "unsafe" - -type IInspectable struct { - IUnknown -} - -type IInspectableVtbl struct { - IUnknownVtbl - GetIIds uintptr - GetRuntimeClassName uintptr - GetTrustLevel uintptr -} - -func (v *IInspectable) VTable() *IInspectableVtbl { - return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) -} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_func.go b/vendor/github.com/go-ole/go-ole/iinspectable_func.go deleted file mode 100644 index 348829bf..00000000 --- a/vendor/github.com/go-ole/go-ole/iinspectable_func.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build !windows - -package ole - -func (v *IInspectable) GetIids() ([]*GUID, error) { - return []*GUID{}, NewError(E_NOTIMPL) -} - -func (v *IInspectable) GetRuntimeClassName() (string, error) { - return "", NewError(E_NOTIMPL) -} - -func (v *IInspectable) GetTrustLevel() (uint32, error) { - return uint32(0), NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_windows.go b/vendor/github.com/go-ole/go-ole/iinspectable_windows.go deleted file mode 100644 index 4519a4aa..00000000 --- a/vendor/github.com/go-ole/go-ole/iinspectable_windows.go +++ /dev/null @@ -1,72 +0,0 @@ -// +build windows - -package ole - -import ( - "bytes" - "encoding/binary" - "reflect" - "syscall" - "unsafe" -) - -func (v *IInspectable) GetIids() (iids []*GUID, err error) { - var count uint32 - var array uintptr - hr, _, _ := syscall.Syscall( - v.VTable().GetIIds, - 3, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(&count)), - uintptr(unsafe.Pointer(&array))) - if hr != 0 { - err = NewError(hr) - return - } - defer CoTaskMemFree(array) - - iids = make([]*GUID, count) - byteCount := count * uint32(unsafe.Sizeof(GUID{})) - slicehdr := reflect.SliceHeader{Data: array, Len: int(byteCount), Cap: int(byteCount)} - byteSlice := *(*[]byte)(unsafe.Pointer(&slicehdr)) - reader := bytes.NewReader(byteSlice) - for i := range iids { - guid := GUID{} - err = binary.Read(reader, binary.LittleEndian, &guid) - if err != nil { - return - } - iids[i] = &guid - } - return -} - -func (v *IInspectable) GetRuntimeClassName() (s string, err error) { - var hstring HString - hr, _, _ := syscall.Syscall( - v.VTable().GetRuntimeClassName, - 2, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(&hstring)), - 0) - if hr != 0 { - err = NewError(hr) - return - } - s = hstring.String() - DeleteHString(hstring) - return -} - -func (v *IInspectable) GetTrustLevel() (level uint32, err error) { - hr, _, _ := syscall.Syscall( - v.VTable().GetTrustLevel, - 2, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(&level)), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go deleted file mode 100644 index 25f3a6f2..00000000 --- a/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go +++ /dev/null @@ -1,21 +0,0 @@ -package ole - -import "unsafe" - -type IProvideClassInfo struct { - IUnknown -} - -type IProvideClassInfoVtbl struct { - IUnknownVtbl - GetClassInfo uintptr -} - -func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { - return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) -} - -func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { - cinfo, err = getClassInfo(v) - return -} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go deleted file mode 100644 index 7e3cb63e..00000000 --- a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !windows - -package ole - -func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { - return nil, NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go deleted file mode 100644 index 2ad01639..00000000 --- a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unsafe" -) - -func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { - hr, _, _ := syscall.Syscall( - disp.VTable().GetClassInfo, - 2, - uintptr(unsafe.Pointer(disp)), - uintptr(unsafe.Pointer(&tinfo)), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo.go b/vendor/github.com/go-ole/go-ole/itypeinfo.go deleted file mode 100644 index dd3c5e21..00000000 --- a/vendor/github.com/go-ole/go-ole/itypeinfo.go +++ /dev/null @@ -1,34 +0,0 @@ -package ole - -import "unsafe" - -type ITypeInfo struct { - IUnknown -} - -type ITypeInfoVtbl struct { - IUnknownVtbl - GetTypeAttr uintptr - GetTypeComp uintptr - GetFuncDesc uintptr - GetVarDesc uintptr - GetNames uintptr - GetRefTypeOfImplType uintptr - GetImplTypeFlags uintptr - GetIDsOfNames uintptr - Invoke uintptr - GetDocumentation uintptr - GetDllEntry uintptr - GetRefTypeInfo uintptr - AddressOfMember uintptr - CreateInstance uintptr - GetMops uintptr - GetContainingTypeLib uintptr - ReleaseTypeAttr uintptr - ReleaseFuncDesc uintptr - ReleaseVarDesc uintptr -} - -func (v *ITypeInfo) VTable() *ITypeInfoVtbl { - return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) -} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_func.go b/vendor/github.com/go-ole/go-ole/itypeinfo_func.go deleted file mode 100644 index 8364a659..00000000 --- a/vendor/github.com/go-ole/go-ole/itypeinfo_func.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !windows - -package ole - -func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { - return nil, NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go b/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go deleted file mode 100644 index 54782b3d..00000000 --- a/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" - "unsafe" -) - -func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { - hr, _, _ := syscall.Syscall( - uintptr(v.VTable().GetTypeAttr), - 2, - uintptr(unsafe.Pointer(v)), - uintptr(unsafe.Pointer(&tattr)), - 0) - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/iunknown.go b/vendor/github.com/go-ole/go-ole/iunknown.go deleted file mode 100644 index 108f28ea..00000000 --- a/vendor/github.com/go-ole/go-ole/iunknown.go +++ /dev/null @@ -1,57 +0,0 @@ -package ole - -import "unsafe" - -type IUnknown struct { - RawVTable *interface{} -} - -type IUnknownVtbl struct { - QueryInterface uintptr - AddRef uintptr - Release uintptr -} - -type UnknownLike interface { - QueryInterface(iid *GUID) (disp *IDispatch, err error) - AddRef() int32 - Release() int32 -} - -func (v *IUnknown) VTable() *IUnknownVtbl { - return (*IUnknownVtbl)(unsafe.Pointer(v.RawVTable)) -} - -func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{}) error { - return reflectQueryInterface(v, v.VTable().QueryInterface, interfaceID, obj) -} - -func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, err error) { - err = v.PutQueryInterface(interfaceID, &dispatch) - return -} - -func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error) { - err = v.PutQueryInterface(interfaceID, &enum) - return -} - -func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error) { - return queryInterface(v, iid) -} - -func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch) { - unk, err := queryInterface(v, iid) - if err != nil { - panic(err) - } - return unk -} - -func (v *IUnknown) AddRef() int32 { - return addRef(v) -} - -func (v *IUnknown) Release() int32 { - return release(v) -} diff --git a/vendor/github.com/go-ole/go-ole/iunknown_func.go b/vendor/github.com/go-ole/go-ole/iunknown_func.go deleted file mode 100644 index d0a62cfd..00000000 --- a/vendor/github.com/go-ole/go-ole/iunknown_func.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !windows - -package ole - -func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { - return NewError(E_NOTIMPL) -} - -func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { - return nil, NewError(E_NOTIMPL) -} - -func addRef(unk *IUnknown) int32 { - return 0 -} - -func release(unk *IUnknown) int32 { - return 0 -} diff --git a/vendor/github.com/go-ole/go-ole/iunknown_windows.go b/vendor/github.com/go-ole/go-ole/iunknown_windows.go deleted file mode 100644 index ede5bb8c..00000000 --- a/vendor/github.com/go-ole/go-ole/iunknown_windows.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build windows - -package ole - -import ( - "reflect" - "syscall" - "unsafe" -) - -func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { - selfValue := reflect.ValueOf(self).Elem() - objValue := reflect.ValueOf(obj).Elem() - - hr, _, _ := syscall.Syscall( - method, - 3, - selfValue.UnsafeAddr(), - uintptr(unsafe.Pointer(interfaceID)), - objValue.Addr().Pointer()) - if hr != 0 { - err = NewError(hr) - } - return -} - -func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { - hr, _, _ := syscall.Syscall( - unk.VTable().QueryInterface, - 3, - uintptr(unsafe.Pointer(unk)), - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(&disp))) - if hr != 0 { - err = NewError(hr) - } - return -} - -func addRef(unk *IUnknown) int32 { - ret, _, _ := syscall.Syscall( - unk.VTable().AddRef, - 1, - uintptr(unsafe.Pointer(unk)), - 0, - 0) - return int32(ret) -} - -func release(unk *IUnknown) int32 { - ret, _, _ := syscall.Syscall( - unk.VTable().Release, - 1, - uintptr(unsafe.Pointer(unk)), - 0, - 0) - return int32(ret) -} diff --git a/vendor/github.com/go-ole/go-ole/ole.go b/vendor/github.com/go-ole/go-ole/ole.go deleted file mode 100644 index e2ae4f4b..00000000 --- a/vendor/github.com/go-ole/go-ole/ole.go +++ /dev/null @@ -1,157 +0,0 @@ -package ole - -import ( - "fmt" - "strings" -) - -// DISPPARAMS are the arguments that passed to methods or property. -type DISPPARAMS struct { - rgvarg uintptr - rgdispidNamedArgs uintptr - cArgs uint32 - cNamedArgs uint32 -} - -// EXCEPINFO defines exception info. -type EXCEPINFO struct { - wCode uint16 - wReserved uint16 - bstrSource *uint16 - bstrDescription *uint16 - bstrHelpFile *uint16 - dwHelpContext uint32 - pvReserved uintptr - pfnDeferredFillIn uintptr - scode uint32 -} - -// WCode return wCode in EXCEPINFO. -func (e EXCEPINFO) WCode() uint16 { - return e.wCode -} - -// SCODE return scode in EXCEPINFO. -func (e EXCEPINFO) SCODE() uint32 { - return e.scode -} - -// String convert EXCEPINFO to string. -func (e EXCEPINFO) String() string { - var src, desc, hlp string - if e.bstrSource == nil { - src = "" - } else { - src = BstrToString(e.bstrSource) - } - - if e.bstrDescription == nil { - desc = "" - } else { - desc = BstrToString(e.bstrDescription) - } - - if e.bstrHelpFile == nil { - hlp = "" - } else { - hlp = BstrToString(e.bstrHelpFile) - } - - return fmt.Sprintf( - "wCode: %#x, bstrSource: %v, bstrDescription: %v, bstrHelpFile: %v, dwHelpContext: %#x, scode: %#x", - e.wCode, src, desc, hlp, e.dwHelpContext, e.scode, - ) -} - -// Error implements error interface and returns error string. -func (e EXCEPINFO) Error() string { - if e.bstrDescription != nil { - return strings.TrimSpace(BstrToString(e.bstrDescription)) - } - - src := "Unknown" - if e.bstrSource != nil { - src = BstrToString(e.bstrSource) - } - - code := e.scode - if e.wCode != 0 { - code = uint32(e.wCode) - } - - return fmt.Sprintf("%v: %#x", src, code) -} - -// PARAMDATA defines parameter data type. -type PARAMDATA struct { - Name *int16 - Vt uint16 -} - -// METHODDATA defines method info. -type METHODDATA struct { - Name *uint16 - Data *PARAMDATA - Dispid int32 - Meth uint32 - CC int32 - CArgs uint32 - Flags uint16 - VtReturn uint32 -} - -// INTERFACEDATA defines interface info. -type INTERFACEDATA struct { - MethodData *METHODDATA - CMembers uint32 -} - -// Point is 2D vector type. -type Point struct { - X int32 - Y int32 -} - -// Msg is message between processes. -type Msg struct { - Hwnd uint32 - Message uint32 - Wparam int32 - Lparam int32 - Time uint32 - Pt Point -} - -// TYPEDESC defines data type. -type TYPEDESC struct { - Hreftype uint32 - VT uint16 -} - -// IDLDESC defines IDL info. -type IDLDESC struct { - DwReserved uint32 - WIDLFlags uint16 -} - -// TYPEATTR defines type info. -type TYPEATTR struct { - Guid GUID - Lcid uint32 - dwReserved uint32 - MemidConstructor int32 - MemidDestructor int32 - LpstrSchema *uint16 - CbSizeInstance uint32 - Typekind int32 - CFuncs uint16 - CVars uint16 - CImplTypes uint16 - CbSizeVft uint16 - CbAlignment uint16 - WTypeFlags uint16 - WMajorVerNum uint16 - WMinorVerNum uint16 - TdescAlias TYPEDESC - IdldescType IDLDESC -} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection.go b/vendor/github.com/go-ole/go-ole/oleutil/connection.go deleted file mode 100644 index 60df73cd..00000000 --- a/vendor/github.com/go-ole/go-ole/oleutil/connection.go +++ /dev/null @@ -1,100 +0,0 @@ -// +build windows - -package oleutil - -import ( - "reflect" - "unsafe" - - ole "github.com/go-ole/go-ole" -) - -type stdDispatch struct { - lpVtbl *stdDispatchVtbl - ref int32 - iid *ole.GUID - iface interface{} - funcMap map[string]int32 -} - -type stdDispatchVtbl struct { - pQueryInterface uintptr - pAddRef uintptr - pRelease uintptr - pGetTypeInfoCount uintptr - pGetTypeInfo uintptr - pGetIDsOfNames uintptr - pInvoke uintptr -} - -func dispQueryInterface(this *ole.IUnknown, iid *ole.GUID, punk **ole.IUnknown) uint32 { - pthis := (*stdDispatch)(unsafe.Pointer(this)) - *punk = nil - if ole.IsEqualGUID(iid, ole.IID_IUnknown) || - ole.IsEqualGUID(iid, ole.IID_IDispatch) { - dispAddRef(this) - *punk = this - return ole.S_OK - } - if ole.IsEqualGUID(iid, pthis.iid) { - dispAddRef(this) - *punk = this - return ole.S_OK - } - return ole.E_NOINTERFACE -} - -func dispAddRef(this *ole.IUnknown) int32 { - pthis := (*stdDispatch)(unsafe.Pointer(this)) - pthis.ref++ - return pthis.ref -} - -func dispRelease(this *ole.IUnknown) int32 { - pthis := (*stdDispatch)(unsafe.Pointer(this)) - pthis.ref-- - return pthis.ref -} - -func dispGetIDsOfNames(this *ole.IUnknown, iid *ole.GUID, wnames []*uint16, namelen int, lcid int, pdisp []int32) uintptr { - pthis := (*stdDispatch)(unsafe.Pointer(this)) - names := make([]string, len(wnames)) - for i := 0; i < len(names); i++ { - names[i] = ole.LpOleStrToString(wnames[i]) - } - for n := 0; n < namelen; n++ { - if id, ok := pthis.funcMap[names[n]]; ok { - pdisp[n] = id - } - } - return ole.S_OK -} - -func dispGetTypeInfoCount(pcount *int) uintptr { - if pcount != nil { - *pcount = 0 - } - return ole.S_OK -} - -func dispGetTypeInfo(ptypeif *uintptr) uintptr { - return ole.E_NOTIMPL -} - -func dispInvoke(this *ole.IDispatch, dispid int32, riid *ole.GUID, lcid int, flags int16, dispparams *ole.DISPPARAMS, result *ole.VARIANT, pexcepinfo *ole.EXCEPINFO, nerr *uint) uintptr { - pthis := (*stdDispatch)(unsafe.Pointer(this)) - found := "" - for name, id := range pthis.funcMap { - if id == dispid { - found = name - } - } - if found != "" { - rv := reflect.ValueOf(pthis.iface).Elem() - rm := rv.MethodByName(found) - rr := rm.Call([]reflect.Value{}) - println(len(rr)) - return ole.S_OK - } - return ole.E_NOTIMPL -} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go b/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go deleted file mode 100644 index 8818fb82..00000000 --- a/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !windows - -package oleutil - -import ole "github.com/go-ole/go-ole" - -// ConnectObject creates a connection point between two services for communication. -func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { - return 0, ole.NewError(ole.E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go b/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go deleted file mode 100644 index ab9c0d8d..00000000 --- a/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build windows - -package oleutil - -import ( - "reflect" - "syscall" - "unsafe" - - ole "github.com/go-ole/go-ole" -) - -// ConnectObject creates a connection point between two services for communication. -func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cookie uint32, err error) { - unknown, err := disp.QueryInterface(ole.IID_IConnectionPointContainer) - if err != nil { - return - } - - container := (*ole.IConnectionPointContainer)(unsafe.Pointer(unknown)) - var point *ole.IConnectionPoint - err = container.FindConnectionPoint(iid, &point) - if err != nil { - return - } - if edisp, ok := idisp.(*ole.IUnknown); ok { - cookie, err = point.Advise(edisp) - container.Release() - if err != nil { - return - } - } - rv := reflect.ValueOf(disp).Elem() - if rv.Type().Kind() == reflect.Struct { - dest := &stdDispatch{} - dest.lpVtbl = &stdDispatchVtbl{} - dest.lpVtbl.pQueryInterface = syscall.NewCallback(dispQueryInterface) - dest.lpVtbl.pAddRef = syscall.NewCallback(dispAddRef) - dest.lpVtbl.pRelease = syscall.NewCallback(dispRelease) - dest.lpVtbl.pGetTypeInfoCount = syscall.NewCallback(dispGetTypeInfoCount) - dest.lpVtbl.pGetTypeInfo = syscall.NewCallback(dispGetTypeInfo) - dest.lpVtbl.pGetIDsOfNames = syscall.NewCallback(dispGetIDsOfNames) - dest.lpVtbl.pInvoke = syscall.NewCallback(dispInvoke) - dest.iface = disp - dest.iid = iid - cookie, err = point.Advise((*ole.IUnknown)(unsafe.Pointer(dest))) - container.Release() - if err != nil { - point.Release() - return - } - return - } - - container.Release() - - return 0, ole.NewError(ole.E_INVALIDARG) -} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/go-get.go b/vendor/github.com/go-ole/go-ole/oleutil/go-get.go deleted file mode 100644 index 58347628..00000000 --- a/vendor/github.com/go-ole/go-ole/oleutil/go-get.go +++ /dev/null @@ -1,6 +0,0 @@ -// This file is here so go get succeeds as without it errors with: -// no buildable Go source files in ... -// -// +build !windows - -package oleutil diff --git a/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go b/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go deleted file mode 100644 index f7803c1e..00000000 --- a/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go +++ /dev/null @@ -1,127 +0,0 @@ -package oleutil - -import ole "github.com/go-ole/go-ole" - -// ClassIDFrom retrieves class ID whether given is program ID or application string. -func ClassIDFrom(programID string) (classID *ole.GUID, err error) { - return ole.ClassIDFrom(programID) -} - -// CreateObject creates object from programID based on interface type. -// -// Only supports IUnknown. -// -// Program ID can be either program ID or application string. -func CreateObject(programID string) (unknown *ole.IUnknown, err error) { - classID, err := ole.ClassIDFrom(programID) - if err != nil { - return - } - - unknown, err = ole.CreateInstance(classID, ole.IID_IUnknown) - if err != nil { - return - } - - return -} - -// GetActiveObject retrieves active object for program ID and interface ID based -// on interface type. -// -// Only supports IUnknown. -// -// Program ID can be either program ID or application string. -func GetActiveObject(programID string) (unknown *ole.IUnknown, err error) { - classID, err := ole.ClassIDFrom(programID) - if err != nil { - return - } - - unknown, err = ole.GetActiveObject(classID, ole.IID_IUnknown) - if err != nil { - return - } - - return -} - -// CallMethod calls method on IDispatch with parameters. -func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { - return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params) -} - -// MustCallMethod calls method on IDispatch with parameters or panics. -func MustCallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { - r, err := CallMethod(disp, name, params...) - if err != nil { - panic(err.Error()) - } - return r -} - -// GetProperty retrieves property from IDispatch. -func GetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { - return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYGET, params) -} - -// MustGetProperty retrieves property from IDispatch or panics. -func MustGetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { - r, err := GetProperty(disp, name, params...) - if err != nil { - panic(err.Error()) - } - return r -} - -// PutProperty mutates property. -func PutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { - return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUT, params) -} - -// MustPutProperty mutates property or panics. -func MustPutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { - r, err := PutProperty(disp, name, params...) - if err != nil { - panic(err.Error()) - } - return r -} - -// PutPropertyRef mutates property reference. -func PutPropertyRef(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { - return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUTREF, params) -} - -// MustPutPropertyRef mutates property reference or panics. -func MustPutPropertyRef(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { - r, err := PutPropertyRef(disp, name, params...) - if err != nil { - panic(err.Error()) - } - return r -} - -func ForEach(disp *ole.IDispatch, f func(v *ole.VARIANT) error) error { - newEnum, err := disp.GetProperty("_NewEnum") - if err != nil { - return err - } - defer newEnum.Clear() - - enum, err := newEnum.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) - if err != nil { - return err - } - defer enum.Release() - - for item, length, err := enum.Next(1); length > 0; item, length, err = enum.Next(1) { - if err != nil { - return err - } - if ferr := f(&item); ferr != nil { - return ferr - } - } - return nil -} diff --git a/vendor/github.com/go-ole/go-ole/safearray.go b/vendor/github.com/go-ole/go-ole/safearray.go deleted file mode 100644 index a5201b56..00000000 --- a/vendor/github.com/go-ole/go-ole/safearray.go +++ /dev/null @@ -1,27 +0,0 @@ -// Package is meant to retrieve and process safe array data returned from COM. - -package ole - -// SafeArrayBound defines the SafeArray boundaries. -type SafeArrayBound struct { - Elements uint32 - LowerBound int32 -} - -// SafeArray is how COM handles arrays. -type SafeArray struct { - Dimensions uint16 - FeaturesFlag uint16 - ElementsSize uint32 - LocksAmount uint32 - Data uint32 - Bounds [16]byte -} - -// SAFEARRAY is obsolete, exists for backwards compatibility. -// Use SafeArray -type SAFEARRAY SafeArray - -// SAFEARRAYBOUND is obsolete, exists for backwards compatibility. -// Use SafeArrayBound -type SAFEARRAYBOUND SafeArrayBound diff --git a/vendor/github.com/go-ole/go-ole/safearray_func.go b/vendor/github.com/go-ole/go-ole/safearray_func.go deleted file mode 100644 index 0dee670c..00000000 --- a/vendor/github.com/go-ole/go-ole/safearray_func.go +++ /dev/null @@ -1,211 +0,0 @@ -// +build !windows - -package ole - -import ( - "unsafe" -) - -// safeArrayAccessData returns raw array pointer. -// -// AKA: SafeArrayAccessData in Windows API. -func safeArrayAccessData(safearray *SafeArray) (uintptr, error) { - return uintptr(0), NewError(E_NOTIMPL) -} - -// safeArrayUnaccessData releases raw array. -// -// AKA: SafeArrayUnaccessData in Windows API. -func safeArrayUnaccessData(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayAllocData allocates SafeArray. -// -// AKA: SafeArrayAllocData in Windows API. -func safeArrayAllocData(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayAllocDescriptor allocates SafeArray. -// -// AKA: SafeArrayAllocDescriptor in Windows API. -func safeArrayAllocDescriptor(dimensions uint32) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayAllocDescriptorEx allocates SafeArray. -// -// AKA: SafeArrayAllocDescriptorEx in Windows API. -func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayCopy returns copy of SafeArray. -// -// AKA: SafeArrayCopy in Windows API. -func safeArrayCopy(original *SafeArray) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayCopyData duplicates SafeArray into another SafeArray object. -// -// AKA: SafeArrayCopyData in Windows API. -func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayCreate creates SafeArray. -// -// AKA: SafeArrayCreate in Windows API. -func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayCreateEx creates SafeArray. -// -// AKA: SafeArrayCreateEx in Windows API. -func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayCreateVector creates SafeArray. -// -// AKA: SafeArrayCreateVector in Windows API. -func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayCreateVectorEx creates SafeArray. -// -// AKA: SafeArrayCreateVectorEx in Windows API. -func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (*SafeArray, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayDestroy destroys SafeArray object. -// -// AKA: SafeArrayDestroy in Windows API. -func safeArrayDestroy(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayDestroyData destroys SafeArray object. -// -// AKA: SafeArrayDestroyData in Windows API. -func safeArrayDestroyData(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayDestroyDescriptor destroys SafeArray object. -// -// AKA: SafeArrayDestroyDescriptor in Windows API. -func safeArrayDestroyDescriptor(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayGetDim is the amount of dimensions in the SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetDim in Windows API. -func safeArrayGetDim(safearray *SafeArray) (*uint32, error) { - u := uint32(0) - return &u, NewError(E_NOTIMPL) -} - -// safeArrayGetElementSize is the element size in bytes. -// -// AKA: SafeArrayGetElemsize in Windows API. -func safeArrayGetElementSize(safearray *SafeArray) (*uint32, error) { - u := uint32(0) - return &u, NewError(E_NOTIMPL) -} - -// safeArrayGetElement retrieves element at given index. -func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error { - return NewError(E_NOTIMPL) -} - -// safeArrayGetElement retrieves element at given index and converts to string. -func safeArrayGetElementString(safearray *SafeArray, index int32) (string, error) { - return "", NewError(E_NOTIMPL) -} - -// safeArrayGetIID is the InterfaceID of the elements in the SafeArray. -// -// AKA: SafeArrayGetIID in Windows API. -func safeArrayGetIID(safearray *SafeArray) (*GUID, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArrayGetLBound returns lower bounds of SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetLBound in Windows API. -func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int32, error) { - return int32(0), NewError(E_NOTIMPL) -} - -// safeArrayGetUBound returns upper bounds of SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetUBound in Windows API. -func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int32, error) { - return int32(0), NewError(E_NOTIMPL) -} - -// safeArrayGetVartype returns data type of SafeArray. -// -// AKA: SafeArrayGetVartype in Windows API. -func safeArrayGetVartype(safearray *SafeArray) (uint16, error) { - return uint16(0), NewError(E_NOTIMPL) -} - -// safeArrayLock locks SafeArray for reading to modify SafeArray. -// -// This must be called during some calls to ensure that another process does not -// read or write to the SafeArray during editing. -// -// AKA: SafeArrayLock in Windows API. -func safeArrayLock(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayUnlock unlocks SafeArray for reading. -// -// AKA: SafeArrayUnlock in Windows API. -func safeArrayUnlock(safearray *SafeArray) error { - return NewError(E_NOTIMPL) -} - -// safeArrayPutElement stores the data element at the specified location in the -// array. -// -// AKA: SafeArrayPutElement in Windows API. -func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) error { - return NewError(E_NOTIMPL) -} - -// safeArrayGetRecordInfo accesses IRecordInfo info for custom types. -// -// AKA: SafeArrayGetRecordInfo in Windows API. -// -// XXX: Must implement IRecordInfo interface for this to return. -func safeArrayGetRecordInfo(safearray *SafeArray) (interface{}, error) { - return nil, NewError(E_NOTIMPL) -} - -// safeArraySetRecordInfo mutates IRecordInfo info for custom types. -// -// AKA: SafeArraySetRecordInfo in Windows API. -// -// XXX: Must implement IRecordInfo interface for this to return. -func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) error { - return NewError(E_NOTIMPL) -} diff --git a/vendor/github.com/go-ole/go-ole/safearray_windows.go b/vendor/github.com/go-ole/go-ole/safearray_windows.go deleted file mode 100644 index b48a2394..00000000 --- a/vendor/github.com/go-ole/go-ole/safearray_windows.go +++ /dev/null @@ -1,337 +0,0 @@ -// +build windows - -package ole - -import ( - "unsafe" -) - -var ( - procSafeArrayAccessData, _ = modoleaut32.FindProc("SafeArrayAccessData") - procSafeArrayAllocData, _ = modoleaut32.FindProc("SafeArrayAllocData") - procSafeArrayAllocDescriptor, _ = modoleaut32.FindProc("SafeArrayAllocDescriptor") - procSafeArrayAllocDescriptorEx, _ = modoleaut32.FindProc("SafeArrayAllocDescriptorEx") - procSafeArrayCopy, _ = modoleaut32.FindProc("SafeArrayCopy") - procSafeArrayCopyData, _ = modoleaut32.FindProc("SafeArrayCopyData") - procSafeArrayCreate, _ = modoleaut32.FindProc("SafeArrayCreate") - procSafeArrayCreateEx, _ = modoleaut32.FindProc("SafeArrayCreateEx") - procSafeArrayCreateVector, _ = modoleaut32.FindProc("SafeArrayCreateVector") - procSafeArrayCreateVectorEx, _ = modoleaut32.FindProc("SafeArrayCreateVectorEx") - procSafeArrayDestroy, _ = modoleaut32.FindProc("SafeArrayDestroy") - procSafeArrayDestroyData, _ = modoleaut32.FindProc("SafeArrayDestroyData") - procSafeArrayDestroyDescriptor, _ = modoleaut32.FindProc("SafeArrayDestroyDescriptor") - procSafeArrayGetDim, _ = modoleaut32.FindProc("SafeArrayGetDim") - procSafeArrayGetElement, _ = modoleaut32.FindProc("SafeArrayGetElement") - procSafeArrayGetElemsize, _ = modoleaut32.FindProc("SafeArrayGetElemsize") - procSafeArrayGetIID, _ = modoleaut32.FindProc("SafeArrayGetIID") - procSafeArrayGetLBound, _ = modoleaut32.FindProc("SafeArrayGetLBound") - procSafeArrayGetUBound, _ = modoleaut32.FindProc("SafeArrayGetUBound") - procSafeArrayGetVartype, _ = modoleaut32.FindProc("SafeArrayGetVartype") - procSafeArrayLock, _ = modoleaut32.FindProc("SafeArrayLock") - procSafeArrayPtrOfIndex, _ = modoleaut32.FindProc("SafeArrayPtrOfIndex") - procSafeArrayUnaccessData, _ = modoleaut32.FindProc("SafeArrayUnaccessData") - procSafeArrayUnlock, _ = modoleaut32.FindProc("SafeArrayUnlock") - procSafeArrayPutElement, _ = modoleaut32.FindProc("SafeArrayPutElement") - //procSafeArrayRedim, _ = modoleaut32.FindProc("SafeArrayRedim") // TODO - //procSafeArraySetIID, _ = modoleaut32.FindProc("SafeArraySetIID") // TODO - procSafeArrayGetRecordInfo, _ = modoleaut32.FindProc("SafeArrayGetRecordInfo") - procSafeArraySetRecordInfo, _ = modoleaut32.FindProc("SafeArraySetRecordInfo") -) - -// safeArrayAccessData returns raw array pointer. -// -// AKA: SafeArrayAccessData in Windows API. -// Todo: Test -func safeArrayAccessData(safearray *SafeArray) (element uintptr, err error) { - err = convertHresultToError( - procSafeArrayAccessData.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&element)))) - return -} - -// safeArrayUnaccessData releases raw array. -// -// AKA: SafeArrayUnaccessData in Windows API. -func safeArrayUnaccessData(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayUnaccessData.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayAllocData allocates SafeArray. -// -// AKA: SafeArrayAllocData in Windows API. -func safeArrayAllocData(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayAllocData.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayAllocDescriptor allocates SafeArray. -// -// AKA: SafeArrayAllocDescriptor in Windows API. -func safeArrayAllocDescriptor(dimensions uint32) (safearray *SafeArray, err error) { - err = convertHresultToError( - procSafeArrayAllocDescriptor.Call(uintptr(dimensions), uintptr(unsafe.Pointer(&safearray)))) - return -} - -// safeArrayAllocDescriptorEx allocates SafeArray. -// -// AKA: SafeArrayAllocDescriptorEx in Windows API. -func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (safearray *SafeArray, err error) { - err = convertHresultToError( - procSafeArrayAllocDescriptorEx.Call( - uintptr(variantType), - uintptr(dimensions), - uintptr(unsafe.Pointer(&safearray)))) - return -} - -// safeArrayCopy returns copy of SafeArray. -// -// AKA: SafeArrayCopy in Windows API. -func safeArrayCopy(original *SafeArray) (safearray *SafeArray, err error) { - err = convertHresultToError( - procSafeArrayCopy.Call( - uintptr(unsafe.Pointer(original)), - uintptr(unsafe.Pointer(&safearray)))) - return -} - -// safeArrayCopyData duplicates SafeArray into another SafeArray object. -// -// AKA: SafeArrayCopyData in Windows API. -func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) (err error) { - err = convertHresultToError( - procSafeArrayCopyData.Call( - uintptr(unsafe.Pointer(original)), - uintptr(unsafe.Pointer(duplicate)))) - return -} - -// safeArrayCreate creates SafeArray. -// -// AKA: SafeArrayCreate in Windows API. -func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (safearray *SafeArray, err error) { - sa, _, err := procSafeArrayCreate.Call( - uintptr(variantType), - uintptr(dimensions), - uintptr(unsafe.Pointer(bounds))) - safearray = (*SafeArray)(unsafe.Pointer(&sa)) - return -} - -// safeArrayCreateEx creates SafeArray. -// -// AKA: SafeArrayCreateEx in Windows API. -func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (safearray *SafeArray, err error) { - sa, _, err := procSafeArrayCreateEx.Call( - uintptr(variantType), - uintptr(dimensions), - uintptr(unsafe.Pointer(bounds)), - extra) - safearray = (*SafeArray)(unsafe.Pointer(sa)) - return -} - -// safeArrayCreateVector creates SafeArray. -// -// AKA: SafeArrayCreateVector in Windows API. -func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (safearray *SafeArray, err error) { - sa, _, err := procSafeArrayCreateVector.Call( - uintptr(variantType), - uintptr(lowerBound), - uintptr(length)) - safearray = (*SafeArray)(unsafe.Pointer(sa)) - return -} - -// safeArrayCreateVectorEx creates SafeArray. -// -// AKA: SafeArrayCreateVectorEx in Windows API. -func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (safearray *SafeArray, err error) { - sa, _, err := procSafeArrayCreateVectorEx.Call( - uintptr(variantType), - uintptr(lowerBound), - uintptr(length), - extra) - safearray = (*SafeArray)(unsafe.Pointer(sa)) - return -} - -// safeArrayDestroy destroys SafeArray object. -// -// AKA: SafeArrayDestroy in Windows API. -func safeArrayDestroy(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayDestroy.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayDestroyData destroys SafeArray object. -// -// AKA: SafeArrayDestroyData in Windows API. -func safeArrayDestroyData(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayDestroyData.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayDestroyDescriptor destroys SafeArray object. -// -// AKA: SafeArrayDestroyDescriptor in Windows API. -func safeArrayDestroyDescriptor(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayDestroyDescriptor.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayGetDim is the amount of dimensions in the SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetDim in Windows API. -func safeArrayGetDim(safearray *SafeArray) (dimensions *uint32, err error) { - l, _, err := procSafeArrayGetDim.Call(uintptr(unsafe.Pointer(safearray))) - dimensions = (*uint32)(unsafe.Pointer(l)) - return -} - -// safeArrayGetElementSize is the element size in bytes. -// -// AKA: SafeArrayGetElemsize in Windows API. -func safeArrayGetElementSize(safearray *SafeArray) (length *uint32, err error) { - l, _, err := procSafeArrayGetElemsize.Call(uintptr(unsafe.Pointer(safearray))) - length = (*uint32)(unsafe.Pointer(l)) - return -} - -// safeArrayGetElement retrieves element at given index. -func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error { - return convertHresultToError( - procSafeArrayGetElement.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&index)), - uintptr(pv))) -} - -// safeArrayGetElementString retrieves element at given index and converts to string. -func safeArrayGetElementString(safearray *SafeArray, index int32) (str string, err error) { - var element *int16 - err = convertHresultToError( - procSafeArrayGetElement.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&index)), - uintptr(unsafe.Pointer(&element)))) - str = BstrToString(*(**uint16)(unsafe.Pointer(&element))) - SysFreeString(element) - return -} - -// safeArrayGetIID is the InterfaceID of the elements in the SafeArray. -// -// AKA: SafeArrayGetIID in Windows API. -func safeArrayGetIID(safearray *SafeArray) (guid *GUID, err error) { - err = convertHresultToError( - procSafeArrayGetIID.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&guid)))) - return -} - -// safeArrayGetLBound returns lower bounds of SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetLBound in Windows API. -func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int32, err error) { - err = convertHresultToError( - procSafeArrayGetLBound.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(dimension), - uintptr(unsafe.Pointer(&lowerBound)))) - return -} - -// safeArrayGetUBound returns upper bounds of SafeArray. -// -// SafeArrays may have multiple dimensions. Meaning, it could be -// multidimensional array. -// -// AKA: SafeArrayGetUBound in Windows API. -func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBound int32, err error) { - err = convertHresultToError( - procSafeArrayGetUBound.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(dimension), - uintptr(unsafe.Pointer(&upperBound)))) - return -} - -// safeArrayGetVartype returns data type of SafeArray. -// -// AKA: SafeArrayGetVartype in Windows API. -func safeArrayGetVartype(safearray *SafeArray) (varType uint16, err error) { - err = convertHresultToError( - procSafeArrayGetVartype.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&varType)))) - return -} - -// safeArrayLock locks SafeArray for reading to modify SafeArray. -// -// This must be called during some calls to ensure that another process does not -// read or write to the SafeArray during editing. -// -// AKA: SafeArrayLock in Windows API. -func safeArrayLock(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayLock.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayUnlock unlocks SafeArray for reading. -// -// AKA: SafeArrayUnlock in Windows API. -func safeArrayUnlock(safearray *SafeArray) (err error) { - err = convertHresultToError(procSafeArrayUnlock.Call(uintptr(unsafe.Pointer(safearray)))) - return -} - -// safeArrayPutElement stores the data element at the specified location in the -// array. -// -// AKA: SafeArrayPutElement in Windows API. -func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) (err error) { - err = convertHresultToError( - procSafeArrayPutElement.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&index)), - uintptr(unsafe.Pointer(element)))) - return -} - -// safeArrayGetRecordInfo accesses IRecordInfo info for custom types. -// -// AKA: SafeArrayGetRecordInfo in Windows API. -// -// XXX: Must implement IRecordInfo interface for this to return. -func safeArrayGetRecordInfo(safearray *SafeArray) (recordInfo interface{}, err error) { - err = convertHresultToError( - procSafeArrayGetRecordInfo.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&recordInfo)))) - return -} - -// safeArraySetRecordInfo mutates IRecordInfo info for custom types. -// -// AKA: SafeArraySetRecordInfo in Windows API. -// -// XXX: Must implement IRecordInfo interface for this to return. -func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) (err error) { - err = convertHresultToError( - procSafeArraySetRecordInfo.Call( - uintptr(unsafe.Pointer(safearray)), - uintptr(unsafe.Pointer(&recordInfo)))) - return -} diff --git a/vendor/github.com/go-ole/go-ole/safearrayconversion.go b/vendor/github.com/go-ole/go-ole/safearrayconversion.go deleted file mode 100644 index 259f488e..00000000 --- a/vendor/github.com/go-ole/go-ole/safearrayconversion.go +++ /dev/null @@ -1,140 +0,0 @@ -// Helper for converting SafeArray to array of objects. - -package ole - -import ( - "unsafe" -) - -type SafeArrayConversion struct { - Array *SafeArray -} - -func (sac *SafeArrayConversion) ToStringArray() (strings []string) { - totalElements, _ := sac.TotalElements(0) - strings = make([]string, totalElements) - - for i := int32(0); i < totalElements; i++ { - strings[int32(i)], _ = safeArrayGetElementString(sac.Array, i) - } - - return -} - -func (sac *SafeArrayConversion) ToByteArray() (bytes []byte) { - totalElements, _ := sac.TotalElements(0) - bytes = make([]byte, totalElements) - - for i := int32(0); i < totalElements; i++ { - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&bytes[int32(i)])) - } - - return -} - -func (sac *SafeArrayConversion) ToValueArray() (values []interface{}) { - totalElements, _ := sac.TotalElements(0) - values = make([]interface{}, totalElements) - vt, _ := safeArrayGetVartype(sac.Array) - - for i := int32(0); i < totalElements; i++ { - switch VT(vt) { - case VT_BOOL: - var v bool - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_I1: - var v int8 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_I2: - var v int16 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_I4: - var v int32 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_I8: - var v int64 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_UI1: - var v uint8 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_UI2: - var v uint16 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_UI4: - var v uint32 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_UI8: - var v uint64 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_R4: - var v float32 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_R8: - var v float64 - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_BSTR: - var v string - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v - case VT_VARIANT: - var v VARIANT - safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) - values[i] = v.Value() - default: - // TODO - } - } - - return -} - -func (sac *SafeArrayConversion) GetType() (varType uint16, err error) { - return safeArrayGetVartype(sac.Array) -} - -func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, err error) { - return safeArrayGetDim(sac.Array) -} - -func (sac *SafeArrayConversion) GetSize() (length *uint32, err error) { - return safeArrayGetElementSize(sac.Array) -} - -func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int32, err error) { - if index < 1 { - index = 1 - } - - // Get array bounds - var LowerBounds int32 - var UpperBounds int32 - - LowerBounds, err = safeArrayGetLBound(sac.Array, index) - if err != nil { - return - } - - UpperBounds, err = safeArrayGetUBound(sac.Array, index) - if err != nil { - return - } - - totalElements = UpperBounds - LowerBounds + 1 - return -} - -// Release Safe Array memory -func (sac *SafeArrayConversion) Release() { - safeArrayDestroy(sac.Array) -} diff --git a/vendor/github.com/go-ole/go-ole/safearrayslices.go b/vendor/github.com/go-ole/go-ole/safearrayslices.go deleted file mode 100644 index a9fa885f..00000000 --- a/vendor/github.com/go-ole/go-ole/safearrayslices.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build windows - -package ole - -import ( - "unsafe" -) - -func safeArrayFromByteSlice(slice []byte) *SafeArray { - array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) - - if array == nil { - panic("Could not convert []byte to SAFEARRAY") - } - - for i, v := range slice { - safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) - } - return array -} - -func safeArrayFromStringSlice(slice []string) *SafeArray { - array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) - - if array == nil { - panic("Could not convert []string to SAFEARRAY") - } - // SysAllocStringLen(s) - for i, v := range slice { - safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) - } - return array -} diff --git a/vendor/github.com/go-ole/go-ole/utility.go b/vendor/github.com/go-ole/go-ole/utility.go deleted file mode 100644 index 99ee82dc..00000000 --- a/vendor/github.com/go-ole/go-ole/utility.go +++ /dev/null @@ -1,101 +0,0 @@ -package ole - -import ( - "unicode/utf16" - "unsafe" -) - -// ClassIDFrom retrieves class ID whether given is program ID or application string. -// -// Helper that provides check against both Class ID from Program ID and Class ID from string. It is -// faster, if you know which you are using, to use the individual functions, but this will check -// against available functions for you. -func ClassIDFrom(programID string) (classID *GUID, err error) { - classID, err = CLSIDFromProgID(programID) - if err != nil { - classID, err = CLSIDFromString(programID) - if err != nil { - return - } - } - return -} - -// BytePtrToString converts byte pointer to a Go string. -func BytePtrToString(p *byte) string { - a := (*[10000]uint8)(unsafe.Pointer(p)) - i := 0 - for a[i] != 0 { - i++ - } - return string(a[:i]) -} - -// UTF16PtrToString is alias for LpOleStrToString. -// -// Kept for compatibility reasons. -func UTF16PtrToString(p *uint16) string { - return LpOleStrToString(p) -} - -// LpOleStrToString converts COM Unicode to Go string. -func LpOleStrToString(p *uint16) string { - if p == nil { - return "" - } - - length := lpOleStrLen(p) - a := make([]uint16, length) - - ptr := unsafe.Pointer(p) - - for i := 0; i < int(length); i++ { - a[i] = *(*uint16)(ptr) - ptr = unsafe.Pointer(uintptr(ptr) + 2) - } - - return string(utf16.Decode(a)) -} - -// BstrToString converts COM binary string to Go string. -func BstrToString(p *uint16) string { - if p == nil { - return "" - } - length := SysStringLen((*int16)(unsafe.Pointer(p))) - a := make([]uint16, length) - - ptr := unsafe.Pointer(p) - - for i := 0; i < int(length); i++ { - a[i] = *(*uint16)(ptr) - ptr = unsafe.Pointer(uintptr(ptr) + 2) - } - return string(utf16.Decode(a)) -} - -// lpOleStrLen returns the length of Unicode string. -func lpOleStrLen(p *uint16) (length int64) { - if p == nil { - return 0 - } - - ptr := unsafe.Pointer(p) - - for i := 0; ; i++ { - if 0 == *(*uint16)(ptr) { - length = int64(i) - break - } - ptr = unsafe.Pointer(uintptr(ptr) + 2) - } - return -} - -// convertHresultToError converts syscall to error, if call is unsuccessful. -func convertHresultToError(hr uintptr, r2 uintptr, ignore error) (err error) { - if hr != 0 { - err = NewError(hr) - } - return -} diff --git a/vendor/github.com/go-ole/go-ole/variables.go b/vendor/github.com/go-ole/go-ole/variables.go deleted file mode 100644 index ebe00f1c..00000000 --- a/vendor/github.com/go-ole/go-ole/variables.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build windows - -package ole - -import ( - "syscall" -) - -var ( - modcombase = syscall.NewLazyDLL("combase.dll") - modkernel32, _ = syscall.LoadDLL("kernel32.dll") - modole32, _ = syscall.LoadDLL("ole32.dll") - modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") - modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") - moduser32, _ = syscall.LoadDLL("user32.dll") -) diff --git a/vendor/github.com/go-ole/go-ole/variant.go b/vendor/github.com/go-ole/go-ole/variant.go deleted file mode 100644 index 967a23fe..00000000 --- a/vendor/github.com/go-ole/go-ole/variant.go +++ /dev/null @@ -1,105 +0,0 @@ -package ole - -import "unsafe" - -// NewVariant returns new variant based on type and value. -func NewVariant(vt VT, val int64) VARIANT { - return VARIANT{VT: vt, Val: val} -} - -// ToIUnknown converts Variant to Unknown object. -func (v *VARIANT) ToIUnknown() *IUnknown { - if v.VT != VT_UNKNOWN { - return nil - } - return (*IUnknown)(unsafe.Pointer(uintptr(v.Val))) -} - -// ToIDispatch converts variant to dispatch object. -func (v *VARIANT) ToIDispatch() *IDispatch { - if v.VT != VT_DISPATCH { - return nil - } - return (*IDispatch)(unsafe.Pointer(uintptr(v.Val))) -} - -// ToArray converts variant to SafeArray helper. -func (v *VARIANT) ToArray() *SafeArrayConversion { - if v.VT != VT_SAFEARRAY { - if v.VT&VT_ARRAY == 0 { - return nil - } - } - var safeArray *SafeArray = (*SafeArray)(unsafe.Pointer(uintptr(v.Val))) - return &SafeArrayConversion{safeArray} -} - -// ToString converts variant to Go string. -func (v *VARIANT) ToString() string { - if v.VT != VT_BSTR { - return "" - } - return BstrToString(*(**uint16)(unsafe.Pointer(&v.Val))) -} - -// Clear the memory of variant object. -func (v *VARIANT) Clear() error { - return VariantClear(v) -} - -// Value returns variant value based on its type. -// -// Currently supported types: 2- and 4-byte integers, strings, bools. -// Note that 64-bit integers, datetimes, and other types are stored as strings -// and will be returned as strings. -// -// Needs to be further converted, because this returns an interface{}. -func (v *VARIANT) Value() interface{} { - switch v.VT { - case VT_I1: - return int8(v.Val) - case VT_UI1: - return uint8(v.Val) - case VT_I2: - return int16(v.Val) - case VT_UI2: - return uint16(v.Val) - case VT_I4: - return int32(v.Val) - case VT_UI4: - return uint32(v.Val) - case VT_I8: - return int64(v.Val) - case VT_UI8: - return uint64(v.Val) - case VT_INT: - return int(v.Val) - case VT_UINT: - return uint(v.Val) - case VT_INT_PTR: - return uintptr(v.Val) // TODO - case VT_UINT_PTR: - return uintptr(v.Val) - case VT_R4: - return *(*float32)(unsafe.Pointer(&v.Val)) - case VT_R8: - return *(*float64)(unsafe.Pointer(&v.Val)) - case VT_BSTR: - return v.ToString() - case VT_DATE: - // VT_DATE type will either return float64 or time.Time. - d := uint64(v.Val) - date, err := GetVariantDate(d) - if err != nil { - return float64(v.Val) - } - return date - case VT_UNKNOWN: - return v.ToIUnknown() - case VT_DISPATCH: - return v.ToIDispatch() - case VT_BOOL: - return v.Val != 0 - } - return nil -} diff --git a/vendor/github.com/go-ole/go-ole/variant_386.go b/vendor/github.com/go-ole/go-ole/variant_386.go deleted file mode 100644 index e73736bf..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_386.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build 386 - -package ole - -type VARIANT struct { - VT VT // 2 - wReserved1 uint16 // 4 - wReserved2 uint16 // 6 - wReserved3 uint16 // 8 - Val int64 // 16 -} diff --git a/vendor/github.com/go-ole/go-ole/variant_amd64.go b/vendor/github.com/go-ole/go-ole/variant_amd64.go deleted file mode 100644 index dccdde13..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_amd64.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build amd64 - -package ole - -type VARIANT struct { - VT VT // 2 - wReserved1 uint16 // 4 - wReserved2 uint16 // 6 - wReserved3 uint16 // 8 - Val int64 // 16 - _ [8]byte // 24 -} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_386.go b/vendor/github.com/go-ole/go-ole/variant_date_386.go deleted file mode 100644 index 1b970f63..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_date_386.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build windows,386 - -package ole - -import ( - "errors" - "syscall" - "time" - "unsafe" -) - -// GetVariantDate converts COM Variant Time value to Go time.Time. -func GetVariantDate(value uint64) (time.Time, error) { - var st syscall.Systemtime - v1 := uint32(value) - v2 := uint32(value >> 32) - r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) - if r != 0 { - return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil - } - return time.Now(), errors.New("Could not convert to time, passing current time.") -} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_amd64.go b/vendor/github.com/go-ole/go-ole/variant_date_amd64.go deleted file mode 100644 index 6952f1f0..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_date_amd64.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build windows,amd64 - -package ole - -import ( - "errors" - "syscall" - "time" - "unsafe" -) - -// GetVariantDate converts COM Variant Time value to Go time.Time. -func GetVariantDate(value uint64) (time.Time, error) { - var st syscall.Systemtime - r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st))) - if r != 0 { - return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil - } - return time.Now(), errors.New("Could not convert to time, passing current time.") -} diff --git a/vendor/github.com/go-ole/go-ole/variant_ppc64le.go b/vendor/github.com/go-ole/go-ole/variant_ppc64le.go deleted file mode 100644 index 326427a7..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_ppc64le.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build ppc64le - -package ole - -type VARIANT struct { - VT VT // 2 - wReserved1 uint16 // 4 - wReserved2 uint16 // 6 - wReserved3 uint16 // 8 - Val int64 // 16 - _ [8]byte // 24 -} diff --git a/vendor/github.com/go-ole/go-ole/variant_s390x.go b/vendor/github.com/go-ole/go-ole/variant_s390x.go deleted file mode 100644 index 9874ca66..00000000 --- a/vendor/github.com/go-ole/go-ole/variant_s390x.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build s390x - -package ole - -type VARIANT struct { - VT VT // 2 - wReserved1 uint16 // 4 - wReserved2 uint16 // 6 - wReserved3 uint16 // 8 - Val int64 // 16 - _ [8]byte // 24 -} diff --git a/vendor/github.com/go-ole/go-ole/vt_string.go b/vendor/github.com/go-ole/go-ole/vt_string.go deleted file mode 100644 index 729b4a04..00000000 --- a/vendor/github.com/go-ole/go-ole/vt_string.go +++ /dev/null @@ -1,58 +0,0 @@ -// generated by stringer -output vt_string.go -type VT; DO NOT EDIT - -package ole - -import "fmt" - -const ( - _VT_name_0 = "VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCHVT_ERRORVT_BOOLVT_VARIANTVT_UNKNOWNVT_DECIMAL" - _VT_name_1 = "VT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTR" - _VT_name_2 = "VT_RECORDVT_INT_PTRVT_UINT_PTR" - _VT_name_3 = "VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSID" - _VT_name_4 = "VT_BSTR_BLOBVT_VECTOR" - _VT_name_5 = "VT_ARRAY" - _VT_name_6 = "VT_BYREF" - _VT_name_7 = "VT_RESERVED" - _VT_name_8 = "VT_ILLEGAL" -) - -var ( - _VT_index_0 = [...]uint8{0, 8, 15, 20, 25, 30, 35, 40, 47, 54, 65, 73, 80, 90, 100, 110} - _VT_index_1 = [...]uint8{0, 5, 11, 17, 23, 28, 34, 40, 47, 54, 64, 70, 82, 91, 105, 113, 122} - _VT_index_2 = [...]uint8{0, 9, 19, 30} - _VT_index_3 = [...]uint8{0, 11, 18, 27, 37, 55, 71, 85, 90, 98} - _VT_index_4 = [...]uint8{0, 12, 21} - _VT_index_5 = [...]uint8{0, 8} - _VT_index_6 = [...]uint8{0, 8} - _VT_index_7 = [...]uint8{0, 11} - _VT_index_8 = [...]uint8{0, 10} -) - -func (i VT) String() string { - switch { - case 0 <= i && i <= 14: - return _VT_name_0[_VT_index_0[i]:_VT_index_0[i+1]] - case 16 <= i && i <= 31: - i -= 16 - return _VT_name_1[_VT_index_1[i]:_VT_index_1[i+1]] - case 36 <= i && i <= 38: - i -= 36 - return _VT_name_2[_VT_index_2[i]:_VT_index_2[i+1]] - case 64 <= i && i <= 72: - i -= 64 - return _VT_name_3[_VT_index_3[i]:_VT_index_3[i+1]] - case 4095 <= i && i <= 4096: - i -= 4095 - return _VT_name_4[_VT_index_4[i]:_VT_index_4[i+1]] - case i == 8192: - return _VT_name_5 - case i == 16384: - return _VT_name_6 - case i == 32768: - return _VT_name_7 - case i == 65535: - return _VT_name_8 - default: - return fmt.Sprintf("VT(%d)", i) - } -} diff --git a/vendor/github.com/go-ole/go-ole/winrt.go b/vendor/github.com/go-ole/go-ole/winrt.go deleted file mode 100644 index 4e9eca73..00000000 --- a/vendor/github.com/go-ole/go-ole/winrt.go +++ /dev/null @@ -1,99 +0,0 @@ -// +build windows - -package ole - -import ( - "reflect" - "syscall" - "unicode/utf8" - "unsafe" -) - -var ( - procRoInitialize = modcombase.NewProc("RoInitialize") - procRoActivateInstance = modcombase.NewProc("RoActivateInstance") - procRoGetActivationFactory = modcombase.NewProc("RoGetActivationFactory") - procWindowsCreateString = modcombase.NewProc("WindowsCreateString") - procWindowsDeleteString = modcombase.NewProc("WindowsDeleteString") - procWindowsGetStringRawBuffer = modcombase.NewProc("WindowsGetStringRawBuffer") -) - -func RoInitialize(thread_type uint32) (err error) { - hr, _, _ := procRoInitialize.Call(uintptr(thread_type)) - if hr != 0 { - err = NewError(hr) - } - return -} - -func RoActivateInstance(clsid string) (ins *IInspectable, err error) { - hClsid, err := NewHString(clsid) - if err != nil { - return nil, err - } - defer DeleteHString(hClsid) - - hr, _, _ := procRoActivateInstance.Call( - uintptr(unsafe.Pointer(hClsid)), - uintptr(unsafe.Pointer(&ins))) - if hr != 0 { - err = NewError(hr) - } - return -} - -func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { - hClsid, err := NewHString(clsid) - if err != nil { - return nil, err - } - defer DeleteHString(hClsid) - - hr, _, _ := procRoGetActivationFactory.Call( - uintptr(unsafe.Pointer(hClsid)), - uintptr(unsafe.Pointer(iid)), - uintptr(unsafe.Pointer(&ins))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// HString is handle string for pointers. -type HString uintptr - -// NewHString returns a new HString for Go string. -func NewHString(s string) (hstring HString, err error) { - u16 := syscall.StringToUTF16Ptr(s) - len := uint32(utf8.RuneCountInString(s)) - hr, _, _ := procWindowsCreateString.Call( - uintptr(unsafe.Pointer(u16)), - uintptr(len), - uintptr(unsafe.Pointer(&hstring))) - if hr != 0 { - err = NewError(hr) - } - return -} - -// DeleteHString deletes HString. -func DeleteHString(hstring HString) (err error) { - hr, _, _ := procWindowsDeleteString.Call(uintptr(hstring)) - if hr != 0 { - err = NewError(hr) - } - return -} - -// String returns Go string value of HString. -func (h HString) String() string { - var u16buf uintptr - var u16len uint32 - u16buf, _, _ = procWindowsGetStringRawBuffer.Call( - uintptr(h), - uintptr(unsafe.Pointer(&u16len))) - - u16hdr := reflect.SliceHeader{Data: u16buf, Len: int(u16len), Cap: int(u16len)} - u16 := *(*[]uint16)(unsafe.Pointer(&u16hdr)) - return syscall.UTF16ToString(u16) -} diff --git a/vendor/github.com/go-ole/go-ole/winrt_doc.go b/vendor/github.com/go-ole/go-ole/winrt_doc.go deleted file mode 100644 index 52e6d74c..00000000 --- a/vendor/github.com/go-ole/go-ole/winrt_doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// +build !windows - -package ole - -// RoInitialize -func RoInitialize(thread_type uint32) (err error) { - return NewError(E_NOTIMPL) -} - -// RoActivateInstance -func RoActivateInstance(clsid string) (ins *IInspectable, err error) { - return nil, NewError(E_NOTIMPL) -} - -// RoGetActivationFactory -func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { - return nil, NewError(E_NOTIMPL) -} - -// HString is handle string for pointers. -type HString uintptr - -// NewHString returns a new HString for Go string. -func NewHString(s string) (hstring HString, err error) { - return HString(uintptr(0)), NewError(E_NOTIMPL) -} - -// DeleteHString deletes HString. -func DeleteHString(hstring HString) (err error) { - return NewError(E_NOTIMPL) -} - -// String returns Go string value of HString. -func (h HString) String() string { - return "" -} diff --git a/vendor/github.com/godbus/dbus/.travis.yml b/vendor/github.com/godbus/dbus/.travis.yml deleted file mode 100644 index 2e1bbb78..00000000 --- a/vendor/github.com/godbus/dbus/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -dist: precise -language: go -go_import_path: github.com/godbus/dbus -sudo: true - -go: - - 1.6.3 - - 1.7.3 - - tip - -env: - global: - matrix: - - TARGET=amd64 - - TARGET=arm64 - - TARGET=arm - - TARGET=386 - - TARGET=ppc64le - -matrix: - fast_finish: true - allow_failures: - - go: tip - exclude: - - go: tip - env: TARGET=arm - - go: tip - env: TARGET=arm64 - - go: tip - env: TARGET=386 - - go: tip - env: TARGET=ppc64le - -addons: - apt: - packages: - - dbus - - dbus-x11 - -before_install: diff --git a/vendor/github.com/godbus/dbus/CONTRIBUTING.md b/vendor/github.com/godbus/dbus/CONTRIBUTING.md deleted file mode 100644 index c88f9b2b..00000000 --- a/vendor/github.com/godbus/dbus/CONTRIBUTING.md +++ /dev/null @@ -1,50 +0,0 @@ -# How to Contribute - -## Getting Started - -- Fork the repository on GitHub -- Read the [README](README.markdown) for build and test instructions -- Play with the project, submit bugs, submit patches! - -## Contribution Flow - -This is a rough outline of what a contributor's workflow looks like: - -- Create a topic branch from where you want to base your work (usually master). -- Make commits of logical units. -- Make sure your commit messages are in the proper format (see below). -- Push your changes to a topic branch in your fork of the repository. -- Make sure the tests pass, and add any new tests as appropriate. -- Submit a pull request to the original repository. - -Thanks for your contributions! - -### Format of the Commit Message - -We follow a rough convention for commit messages that is designed to answer two -questions: what changed and why. The subject line should feature the what and -the body of the commit should describe the why. - -``` -scripts: add the test-cluster command - -this uses tmux to setup a test cluster that you can easily kill and -start for debugging. - -Fixes #38 -``` - -The format can be described more formally as follows: - -``` -: - - - -