<commit_before>package kite

import (
	"encoding/json"
	"io/ioutil"
	"log"
	"strings"
)

// Options is passed to kite.New when creating new instance.
type Options struct {
	// Mandatory fields
	Kitename    string
	Version     string
	Environment string
	Region      string

	// Optional fields
	PublicIP string // default: 0.0.0.0
	Port     string // default: random
	Path     string // default: /<kitename>

	// Do not authenticate incoming requests
	DisableAuthentication bool
}

// validate fields of the options struct. It exits if an error is occured.
func (o *Options) validate() {
	if o.Kitename == "" {
		log.Fatal("ERROR: options.Kitename field is not set")
	}

	if digits := strings.Split(o.Version, "."); len(digits) != 3 {
		log.Fatal("ERROR: please use 3-digits semantic versioning for options.version")
	}

	if o.Region == "" {
		log.Fatal("ERROR: options.Region field is not set")
	}

	if o.Environment == "" {
		log.Fatal("ERROR: options.Environment field is not set")
	}

	if o.PublicIP == "" {
		o.PublicIP = "0.0.0.0"
	}

	if o.Port == "" {
		o.Port = "0" // OS binds to an automatic port
	}

	if o.Path == "" {
		o.Path = "/" + o.Kitename
	}

	if o.Path[0] != '/' {
		o.Path = "/" + o.Path
	}
}
<commit_msg>add kite prefix in front of kite urls<commit_after>package kite

import (
	"encoding/json"
	"io/ioutil"
	"log"
	"strings"
)

// Options is passed to kite.New when creating new instance.
type Options struct {
	// Mandatory fields
	Kitename    string
	Version     string
	Environment string
	Region      string

	// Optional fields
	PublicIP string // default: 0.0.0.0
	Port     string // default: random
	Path     string // default: /<kitename>

	// Do not authenticate incoming requests
	DisableAuthentication bool
}

// validate fields of the options struct. It exits if an error is occured.
func (o *Options) validate() {
	if o.Kitename == "" {
		log.Fatal("ERROR: options.Kitename field is not set")
	}

	if digits := strings.Split(o.Version, "."); len(digits) != 3 {
		log.Fatal("ERROR: please use 3-digits semantic versioning for options.version")
	}

	if o.Region == "" {
		log.Fatal("ERROR: options.Region field is not set")
	}

	if o.Environment == "" {
		log.Fatal("ERROR: options.Environment field is not set")
	}

	if o.PublicIP == "" {
		o.PublicIP = "0.0.0.0"
	}

	if o.Port == "" {
		o.Port = "0" // OS binds to an automatic port
	}

	if o.Path == "" {
		o.Path = "/kite/" + o.Kitename
	}

	if o.Path[0] != '/' {
		o.Path = "/" + o.Path
	}
}

{'fraction_non_alphanumeric': 0.14377768828030607, 'fraction_numerical': 0.009665726943213854, 'mean_word_length': 2.827426810477658, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1584814', 'n_tokens_mistral': 919, 'n_tokens_neox': 860, 'n_words': 260}