<commit_before>package main

import (
	"os"

	log15 "gopkg.in/inconshreveable/log15.v2"

	"github.com/CyCoreSystems/ari/client/native"
)

func main() {
	if i := run(); i != 0 {
		os.Exit(i)
	}
}

func run() int {

	// setup logging
	native.Logger = log15.New()
	log := log15.New()

	opts := native.Options{
		Application:  "example",
		Username:     "admin",
		Password:     "<PASSWORD>",
		URL:          "http://localhost:8088/ari",
		WebsocketURL: "ws://localhost:8088/ari/events",
	}

	log.Info("Connecting")

	cl, err := native.New(opts)
	if err != nil {
		log.Error("Failed to build native ARI client", "error", err)
		return -1
	}
	defer cl.Close()

	log.Info("Connected")

	info, err := cl.Asterisk.Info("")
	if err != nil {
		log.Error("Failed to get Asterisk Info", "error", err)
		return -1
	}

	log.Info("Asterisk Info", "info", info)

	return 0
}<commit_msg>Update example base on the new implementation of ari.Client<commit_after>package main

import (
	"context"
	"os"

	log15 "gopkg.in/inconshreveable/log15.v2"

	"github.com/CyCoreSystems/ari"
	"github.com/CyCoreSystems/ari/client/native"
)

func main() {
	if i := run(); i != 0 {
		os.Exit(i)
	}
}

func run() int {

	// setup logging
	native.Logger = log15.New()
	log := log15.New()

	opts := native.Options{
		Application:  "example",
		Username:     "admin",
		Password:     "admin",
		URL:          "http://localhost:8088/ari",
		WebsocketURL: "ws://localhost:8088/ari/events",
	}

	log.Info("Connecting")

	cl, err := native.Connect(context.TODO(), &opts)
	if err != nil {
		log.Error("Failed to build native ARI client", "error", err)
		return -1
	}

	defer cl.Close()

	log.Info("Connected")

	info, err := cl.Asterisk().Info(&ari.Key{Kind: "build"})
	if err != nil {
		log.Error("Failed to get Asterisk Info", "error", err)
		return -1
	}

	log.Info("Asterisk Info", "info", info)

	return 0
}
{'fraction_non_alphanumeric': 0.17549491706795078, 'fraction_numerical': 0.02247191011235955, 'mean_word_length': 3.3287037037037037, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2823786', 'n_tokens_mistral': 781, 'n_tokens_neox': 711, 'n_words': 166}