Compare commits

...

6 Commits

Author SHA1 Message Date
96bc5c9e5d ... 2025-02-07 12:17:34 +03:00
20927485d9 ... 2025-02-07 12:13:39 +03:00
a034708f21 ... 2025-02-07 12:08:25 +03:00
19a2577564 ... 2025-02-07 12:07:32 +03:00
e34d804dda ... 2025-02-07 11:59:52 +03:00
cd6c899661 ... 2025-02-07 11:45:28 +03:00
280 changed files with 33718 additions and 685 deletions

View File

@@ -17,6 +17,7 @@ concurrency:
jobs:
deploy-documentation:
#if: startsWith(github.ref, 'refs/tags/')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
@@ -26,12 +27,11 @@ jobs:
uses: actions/checkout@v4
- name: Setup Vlang
run: ./install_v.sh --github-actions
run: ./install_v.sh
- name: Generate documentation
run: |
./doc.vsh
# ls /home/runner/work/herolib/docs
./doc.vsh
find .
- name: Setup Pages

View File

@@ -6,8 +6,6 @@ permissions:
on:
push:
branches: ["main","development"]
tags:
- 'v*'
workflow_dispatch:
branches: ["main","development"]

1
.gitignore vendored
View File

@@ -25,7 +25,6 @@ dump.rdb
output/
*.db
.stellar
vdocs/
data.ms/
test_basic
cli/hero

View File

@@ -31,7 +31,7 @@ fn do() ! {
mut cmd := Command{
name: 'hero'
description: 'Your HERO toolset.'
version: '2.0.6'
version: '1.0.2'
}
// herocmds.cmd_run_add_flags(mut cmd)

38
doc.vsh
View File

@@ -26,9 +26,9 @@ os.chdir(herolib_path) or {
panic('Failed to change directory to herolib: ${err}')
}
os.rmdir_all('_docs') or {}
os.rmdir_all('docs') or {}
os.rmdir_all('vdocs') or {}
os.mkdir_all('_docs') or {}
os.mkdir_all('docs') or {}
os.mkdir_all('vdocs') or {}
// Generate HTML documentation
println('Generating HTML documentation...')
@@ -42,13 +42,12 @@ os.chdir(abs_dir_of_script) or {
// Generate Markdown documentation
println('Generating Markdown documentation...')
os.rmdir_all('vdocs') or {}
// if os.system('v doc -m -no-color -f md -o ../vdocs/v/') != 0 {
// panic('Failed to generate V markdown documentation')
// }
if os.system('v doc -m -no-color -f md -o vdocs/herolib/') != 0 {
if os.system('v doc -m -no-color -f md -o vdocs/') != 0 {
panic('Failed to generate Hero markdown documentation')
}
@@ -62,4 +61,33 @@ $if !linux {
}
}
// Create Jekyll required files
println('Creating Jekyll files...')
os.mkdir_all('docs/assets/css') or {}
// Create style.scss
style_content := '---\n---\n\n@import "{{ site.theme }}";'
os.write_file('docs/assets/css/style.scss', style_content) or {
panic('Failed to create style.scss: ${err}')
}
// Create _config.yml
config_content := 'title: HeroLib Documentation
description: Documentation for the HeroLib project
theme: jekyll-theme-primer
baseurl: /herolib
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/'
os.write_file('docs/_config.yml', config_content) or {
panic('Failed to create _config.yml: ${err}')
}
println('Documentation generation completed successfully!')

View File

@@ -1,11 +1,9 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.clients.mailclient
import freeflowuniverse.herolib.clients. mailclient
//remove the previous one, otherwise the env variables are not read
mailclient.config_delete(name:"test")!
// remove the previous one, otherwise the env variables are not read
mailclient.config_delete(name: 'test')!
// env variables which need to be set are:
// - MAIL_FROM=...
@@ -14,11 +12,14 @@ mailclient.config_delete(name:"test")!
// - MAIL_SERVER=...
// - MAIL_USERNAME=...
mut client:= mailclient.get(name:"test")!
mut client := mailclient.get(name: 'test')!
println(client)
client.send(subject:'this is a test',to:'kristof@incubaid.com',body:'
client.send(
subject: 'this is a test'
to: 'kristof@incubaid.com'
body: '
this is my email content
')!
'
)!

View File

@@ -3,7 +3,6 @@
import freeflowuniverse.herolib.core
import freeflowuniverse.herolib.clients.postgresql_client
// Configure PostgreSQL client
heroscript := "
!!postgresql_client.configure
@@ -19,7 +18,7 @@ heroscript := "
postgresql_client.play(heroscript: heroscript)!
// Get the configured client
mut db_client := postgresql_client.get(name: "test")!
mut db_client := postgresql_client.get(name: 'test')!
// Check if test database exists, create if not
if !db_client.db_exists('test')! {
@@ -31,15 +30,14 @@ if !db_client.db_exists('test')! {
db_client.dbname = 'test'
// Create table if not exists
create_table_sql := "CREATE TABLE IF NOT EXISTS users (
create_table_sql := 'CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)"
)'
println('Creating table users if not exists...')
db_client.exec(create_table_sql)!
println('Database and table setup completed successfully!')

View File

@@ -12,8 +12,8 @@ mut:
}
mut person := Person{
name: 'Bob'
birthday: time.now()
name: 'Bob'
birthday: time.now()
}
heroscript := encoderhero.encode[Person](person)!
@@ -22,9 +22,8 @@ println(heroscript)
person2 := encoderhero.decode[Person](heroscript)!
println(person2)
//show that it doesn't matter which action & method is used
heroscript2:="!!a.b name:Bob age:20 birthday:'2025-02-06 09:57:30'"
// show that it doesn't matter which action & method is used
heroscript2 := "!!a.b name:Bob age:20 birthday:'2025-02-06 09:57:30'"
person3 := encoderhero.decode[Person](heroscript)!
println(person3)

View File

@@ -1,23 +1,22 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import json
enum JobTitle {
manager
executive
worker
manager
executive
worker
}
struct Employee {
mut:
name string
family string @[json: '-'] // this field will be skipped
age int
salary f32
title JobTitle @[json: 'ETitle'] // the key for this field will be 'ETitle', not 'title'
notes string @[omitempty] // the JSON property is not created if the string is equal to '' (an empty string).
// TODO: document @[raw]
name string
family string @[json: '-'] // this field will be skipped
age int
salary f32
title JobTitle @[json: 'ETitle'] // the key for this field will be 'ETitle', not 'title'
notes string @[omitempty] // the JSON property is not created if the string is equal to '' (an empty string).
// TODO: document @[raw]
}
x := Employee{'Peter', 'Begins', 28, 95000.5, .worker, ''}
@@ -34,4 +33,3 @@ println(y)
ss := json.encode(y)
println('JSON encoding of employee y: ${ss}')
assert ss == s

View File

@@ -18,8 +18,7 @@ heroscript := "
postgresql_client.play(heroscript: heroscript)!
// Get the configured client
mut db_client := postgresql_client.get(name: "test")!
mut db_client := postgresql_client.get(name: 'test')!
// Create a new location instance
mut loc := location.new(mut db_client, false) or { panic(err) }

View File

@@ -18,8 +18,7 @@ heroscript := "
postgresql_client.play(heroscript: heroscript)!
// Get the configured client
mut db_client := postgresql_client.get(name: "test")!
mut db_client := postgresql_client.get(name: 'test')!
// Create a new location instance
mut loc := location.new(mut db_client, false) or { panic(err) }

View File

@@ -2,14 +2,15 @@
import freeflowuniverse.herolib.installers.infra.gitea as gitea_installer
mut installer := gitea_installer.get(name: 'test')!
mut installer:= gitea_installer.get(name:'test')!
//if you want to configure using heroscript
gitea_installer.play(heroscript:"
// if you want to configure using heroscript
gitea_installer.play(
heroscript: "
!!gitea.configure name:test
passwd:'something'
domain: 'docs.info.com'
")!
"
)!
installer.start()!

View File

@@ -5,18 +5,36 @@ set -e
os_name="$(uname -s)"
arch_name="$(uname -m)"
# Base URL for GitHub releases
base_url="https://github.com/freeflowuniverse/herolib/releases/download/v1.0.1"
# Select the URL based on the platform
if [[ "$os_name" == "Linux" && "$arch_name" == "x86_64" ]]; then
url="https://f003.backblazeb2.com/file/threefold/linux-i64/hero"
url="$base_url/hero-x86_64-unknown-linux-musl"
elif [[ "$os_name" == "Linux" && "$arch_name" == "aarch64" ]]; then
url="$base_url/hero-aarch64-unknown-linux-musl"
elif [[ "$os_name" == "Darwin" && "$arch_name" == "arm64" ]]; then
url="https://f003.backblazeb2.com/file/threefold/macos-arm64/hero"
# elif [[ "$os_name" == "Darwin" && "$arch_name" == "x86_64" ]]; then
# url="https://f003.backblazeb2.com/file/threefold/macos-i64/hero"
url="$base_url/hero-aarch64-apple-darwin"
elif [[ "$os_name" == "Darwin" && "$arch_name" == "x86_64" ]]; then
url="$base_url/hero-x86_64-apple-darwin"
else
echo "Unsupported platform."
echo "Unsupported platform: $os_name $arch_name"
exit 1
fi
# # Select the URL based on the platform
# if [[ "$os_name" == "Linux" && "$arch_name" == "x86_64" ]]; then
# url="https://f003.backblazeb2.com/file/threefold/linux-i64/hero"
# elif [[ "$os_name" == "Darwin" && "$arch_name" == "arm64" ]]; then
# url="https://f003.backblazeb2.com/file/threefold/macos-arm64/hero"
# # elif [[ "$os_name" == "Darwin" && "$arch_name" == "x86_64" ]]; then
# # url="https://f003.backblazeb2.com/file/threefold/macos-i64/hero"
# else
# echo "Unsupported platform."
# exit 1
# fi
# Check for existing hero installations
existing_hero=$(which hero 2>/dev/null || true)
if [ ! -z "$existing_hero" ]; then

View File

@@ -1,127 +1,112 @@
module mailclient
import freeflowuniverse.herolib.core.base
import freeflowuniverse.herolib.core.playbook
import freeflowuniverse.herolib.ui.console
__global (
mailclient_global map[string]&MailClient
mailclient_default string
mailclient_global map[string]&MailClient
mailclient_default string
)
/////////FACTORY
@[params]
pub struct ArgsGet{
pub struct ArgsGet {
pub mut:
name string
name string
}
fn args_get (args_ ArgsGet) ArgsGet {
mut args:=args_
if args.name == ""{
args.name = mailclient_default
}
if args.name == ""{
args.name = "default"
}
return args
fn args_get(args_ ArgsGet) ArgsGet {
mut args := args_
if args.name == '' {
args.name = mailclient_default
}
if args.name == '' {
args.name = 'default'
}
return args
}
pub fn get(args_ ArgsGet) !&MailClient {
mut args := args_get(args_)
if !(args.name in mailclient_global) {
if ! config_exists(args){
config_save(args)!
}
config_load(args)!
}
return mailclient_global[args.name] or {
println(mailclient_global)
//bug if we get here because should be in globals
panic("could not get config for mailclient with name, is bug:${args.name}")
}
pub fn get(args_ ArgsGet) !&MailClient {
mut args := args_get(args_)
if args.name !in mailclient_global {
if !config_exists(args) {
config_save(args)!
}
config_load(args)!
}
return mailclient_global[args.name] or {
println(mailclient_global)
// bug if we get here because should be in globals
panic('could not get config for mailclient with name, is bug:${args.name}')
}
}
pub fn config_exists(args_ ArgsGet) bool {
mut args := args_get(args_)
mut context:=base.context() or { panic("bug") }
return context.hero_config_exists("mailclient",args.name)
mut args := args_get(args_)
mut context := base.context() or { panic('bug') }
return context.hero_config_exists('mailclient', args.name)
}
pub fn config_load(args_ ArgsGet) ! {
mut args := args_get(args_)
mut context:=base.context()!
mut heroscript := context.hero_config_get("mailclient",args.name)!
play(heroscript:heroscript)!
mut args := args_get(args_)
mut context := base.context()!
mut heroscript := context.hero_config_get('mailclient', args.name)!
play(heroscript: heroscript)!
}
pub fn config_save(args_ ArgsGet) ! {
mut args := args_get(args_)
mut context:=base.context()!
context.hero_config_set("mailclient",args.name,heroscript_default(instance:args.name)!)!
mut args := args_get(args_)
mut context := base.context()!
context.hero_config_set('mailclient', args.name, heroscript_default(instance: args.name)!)!
}
pub fn config_delete(args_ ArgsGet) ! {
mut args := args_get(args_)
mut context:=base.context()!
context.hero_config_delete("mailclient",args.name)!
mut args := args_get(args_)
mut context := base.context()!
context.hero_config_delete('mailclient', args.name)!
}
fn set(o MailClient)! {
mut o2:=obj_init(o)!
mailclient_global[o.name] = &o2
mailclient_default = o.name
fn set(o MailClient) ! {
mut o2 := obj_init(o)!
mailclient_global[o.name] = &o2
mailclient_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string //if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args:=args_
if args.heroscript == "" {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or {
playbook.new(text: args.heroscript)!
}
mut install_actions := plbook.find(filter: 'mailclient.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
mut p := install_action.params
cfg_play(p)!
}
}
mut args := args_
if args.heroscript == '' {
args.heroscript = heroscript_default()!
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut install_actions := plbook.find(filter: 'mailclient.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
mut p := install_action.params
cfg_play(p)!
}
}
}
//switch instance to be used for mailclient
// switch instance to be used for mailclient
pub fn switch(name string) {
mailclient_default = name
mailclient_default = name
}
//helpers
// helpers
@[params]
pub struct DefaultConfigArgs{
instance string = 'default'
pub struct DefaultConfigArgs {
instance string = 'default'
}

View File

@@ -1,4 +1,5 @@
module mailclient
import freeflowuniverse.herolib.data.paramsparser
import os
@@ -6,7 +7,6 @@ pub const version = '0.0.0'
const singleton = false
const default = true
pub fn heroscript_default(args DefaultConfigArgs) !string {
mail_from := os.getenv_opt('MAIL_FROM') or { 'info@example.com' }
mail_password := os.getenv_opt('MAIL_PASSWORD') or { 'secretpassword' }
@@ -23,7 +23,7 @@ pub fn heroscript_default(args DefaultConfigArgs) !string {
mail_username: '${mail_username}'
"
return heroscript
return heroscript
}
@[heap]
@@ -40,22 +40,18 @@ pub mut:
}
fn cfg_play(p paramsparser.Params) ! {
mut mycfg := MailClient{
mut mycfg := MailClient{
name: p.get_default('name', 'default')!
mail_from: p.get('mail_from')!
mail_password: p.get('mail_password')!
mail_port: p.get_int_default('mail_port', 465)!
mail_server: p.get('mail_server')!
mail_username: p.get('mail_username')!
}
set(mycfg)!
}
fn obj_init(obj_ MailClient)!MailClient{
mut obj:=obj_
return obj
}
set(mycfg)!
}
fn obj_init(obj_ MailClient) !MailClient {
mut obj := obj_
return obj
}

View File

@@ -144,7 +144,6 @@ pub fn (mut self Context) hero_config_delete(cat string, name string) ! {
config_file.delete()!
}
pub fn (mut self Context) hero_config_exists(cat string, name string) bool {
path := '${os.home_dir()}/hero/context/${self.config.name}/${cat}__${name}.yaml'
return os.exists(path)

View File

@@ -53,7 +53,6 @@ pub fn cmd_docusaurus(mut cmdroot Command) {
description: 'update your environment the template and the repo you are working on (git pull).'
})
cmd_run.add_flag(Flag{
flag: .bool
required: false
@@ -84,29 +83,29 @@ fn cmd_docusaurus_execute(cmd Command) ! {
// exit(1)
// }
mut docs := docusaurus.new(update:update)!
mut docs := docusaurus.new(update: update)!
if build {
// Create a new docusaurus site
_ := docs.build(
url: url
update:update
url: url
update: update
)!
}
if builddev {
// Create a new docusaurus site
_ := docs.build_dev(
url: url
update:update
url: url
update: update
)!
}
if dev {
// Create a new docusaurus site
_ := docs.dev(
url: url
update:update
url: url
update: update
)!
}
}

View File

@@ -10,16 +10,16 @@ import freeflowuniverse.herolib.clients.postgresql_client
// LocationDB handles all database operations for locations
pub struct LocationDB {
pub mut:
db pg.DB
db pg.DB
db_client postgresql_client.PostgresClient
tmp_dir pathlib.Path
db_dir pathlib.Path
tmp_dir pathlib.Path
db_dir pathlib.Path
}
// new_location_db creates a new LocationDB instance
pub fn new_location_db(mut db_client postgresql_client.PostgresClient, reset bool) !LocationDB {
mut db_dir := pathlib.get_dir(path:'${os.home_dir()}/hero/var/db/location.db',create: true)!
mut db_dir := pathlib.get_dir(path: '${os.home_dir()}/hero/var/db/location.db', create: true)!
// Create locations database if it doesn't exist
if !db_client.db_exists('locations')! {
db_client.db_create('locations')!
@@ -27,15 +27,15 @@ pub fn new_location_db(mut db_client postgresql_client.PostgresClient, reset boo
// Switch to locations database
db_client.dbname = 'locations'
// Get the underlying pg.DB connection
db := db_client.db()!
mut loc_db := LocationDB{
db: db
db: db
db_client: db_client
tmp_dir: pathlib.get_dir(path: '/tmp/location/',create: true)!
db_dir: db_dir
tmp_dir: pathlib.get_dir(path: '/tmp/location/', create: true)!
db_dir: db_dir
}
loc_db.init_tables(reset)!
return loc_db
@@ -50,7 +50,7 @@ fn (mut l LocationDB) init_tables(reset bool) ! {
drop table Country
}!
}
sql l.db {
create table Country
create table City

View File

@@ -5,7 +5,7 @@ import freeflowuniverse.herolib.clients.postgresql_client
// Location represents the main API for location operations
pub struct Location {
mut:
db LocationDB
db LocationDB
db_client postgresql_client.PostgresClient
}
@@ -13,7 +13,7 @@ mut:
pub fn new(mut db_client postgresql_client.PostgresClient, reset bool) !Location {
db := new_location_db(mut db_client, reset)!
return Location{
db: db
db: db
db_client: db_client
}
}
@@ -28,7 +28,7 @@ pub fn (mut l Location) download_and_import(redownload bool) ! {
fn main() ! {
// Configure and get PostgreSQL client
heroscript := "
!!postgresql_client.configure
!!postgresql_client.configure
name:'test'
user: 'postgres'
port: 5432

View File

@@ -1,4 +1,3 @@
module location
//https://www.geonames.org/export/codes.html
// https://www.geonames.org/export/codes.html

View File

@@ -7,27 +7,24 @@ import freeflowuniverse.herolib.osal
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.core.texttools
const (
geonames_url = 'https://download.geonames.org/export/dump'
)
const geonames_url = 'https://download.geonames.org/export/dump'
// download_and_import_data downloads and imports GeoNames data
pub fn (mut l LocationDB) download_and_import_data(redownload bool) ! {
// Download country info
if redownload{
if redownload {
l.reset_import_dates()!
}
country_file := osal.download(
url: '${geonames_url}/countryInfo.txt'
dest: '${l.tmp_dir.path}/country.txt'
url: '${geonames_url}/countryInfo.txt'
dest: '${l.tmp_dir.path}/country.txt'
minsize_kb: 10
)!
l.import_country_data(country_file.path)!
l.import_cities()!
}
// reset_import_dates sets all country import_dates to 0
@@ -41,9 +38,9 @@ pub fn (mut l LocationDB) reset_import_dates() ! {
// should_import_cities checks if a city should be imported based on its last import date on country level
fn (mut l LocationDB) should_import_cities(iso2 string) !bool {
console.print_debug('Checking if should import country: ${iso2}')
country := sql l.db {
select from Country where iso2 == "${iso2}" limit 1
select from Country where iso2 == '${iso2}' limit 1
} or { []Country{} }
console.print_debug('SQL query result: ${country.len} records found')
@@ -58,11 +55,11 @@ fn (mut l LocationDB) should_import_cities(iso2 string) !bool {
one_month := i64(30 * 24 * 60 * 60) // 30 days in seconds
last_import := country[0].import_date
time_since_import := now - last_import
console.print_debug('Last import: ${last_import}, Time since import: ${time_since_import} seconds (${time_since_import/86400} days)')
should_import := (time_since_import > one_month) || (last_import == 0)
console.print_debug('Last import: ${last_import}, Time since import: ${time_since_import} seconds (${time_since_import / 86400} days)')
should_import := time_since_import > one_month || last_import == 0
console.print_debug('Should import ${iso2}: ${should_import}')
return should_import
}
@@ -70,10 +67,10 @@ fn (mut l LocationDB) should_import_cities(iso2 string) !bool {
fn (mut l LocationDB) import_country_data(filepath string) ! {
console.print_header('Starting import from: ${filepath}')
l.db.exec('BEGIN TRANSACTION')!
mut file := os.open(filepath) or {
mut file := os.open(filepath) or {
console.print_stderr('Failed to open country file: ${err}')
return err
return err
}
defer { file.close() }
@@ -98,39 +95,34 @@ fn (mut l LocationDB) import_country_data(filepath string) ! {
} or { []Country{} }
country := Country{
iso2: iso2
iso3: fields[1]
name: fields[4]
continent: fields[8]
iso2: iso2
iso3: fields[1]
name: fields[4]
continent: fields[8]
population: fields[7].i64()
timezone: fields[17]
timezone: fields[17]
}
if existing_country.len > 0 {
// Update existing country
sql l.db {
update Country set
iso3 = country.iso3,
name = country.name,
continent = country.continent,
population = country.population,
timezone = country.timezone
where iso2 == iso2
update Country set iso3 = country.iso3, name = country.name, continent = country.continent,
population = country.population, timezone = country.timezone where iso2 == iso2
}!
//console.print_debug("Updated country: ${country}")
// console.print_debug("Updated country: ${country}")
} else {
// Insert new country
sql l.db {
insert country into Country
}!
//console.print_debug("Inserted country: ${country}")
// console.print_debug("Inserted country: ${country}")
}
count++
if count % 10 == 0 {
console.print_header('Processed ${count} countries')
}
}
l.db.exec('COMMIT')!
console.print_header('Finished importing countries. Total records: ${count}')
}
@@ -158,13 +150,13 @@ fn (mut l LocationDB) import_cities() ! {
// Download and process cities for this country
cities_file := osal.download(
url: '${geonames_url}/${iso2}.zip'
dest: '${l.tmp_dir.path}/${iso2}.zip'
url: '${geonames_url}/${iso2}.zip'
dest: '${l.tmp_dir.path}/${iso2}.zip'
expand_file: '${l.tmp_dir.path}/${iso2}'
minsize_kb: 2
minsize_kb: 2
)!
l.import_city_data("${l.tmp_dir.path}/${iso2}/${iso2}.txt")!
l.import_city_data('${l.tmp_dir.path}/${iso2}/${iso2}.txt')!
// Update the country's import date after successful city import
now := time.now().unix()
@@ -193,36 +185,34 @@ fn (mut l LocationDB) import_city_data(filepath string) ! {
// country code : ISO-3166 2-letter country code, 2 characters
// cc2 : alternate country codes, comma separated, ISO-3166 2-letter country code, 200 characters
// admin1 code : fipscode (subject to change to iso code), see exceptions below, see file admin1Codes.txt for display names of this code; varchar(20)
// admin2 code : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80)
// admin2 code : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80)
// admin3 code : code for third level administrative division, varchar(20)
// admin4 code : code for fourth level administrative division, varchar(20)
// population : bigint (8 byte int)
// population : bigint (8 byte int)
// elevation : in meters, integer
// dem : digital elevation model, srtm3 or gtopo30, average elevation of 3''x3'' (ca 90mx90m) or 30''x30'' (ca 900mx900m) area in meters, integer. srtm processed by cgiar/ciat.
// timezone : the iana timezone id (see file timeZone.txt) varchar(40)
// modification date : date of last modification in yyyy-MM-dd format
l.db.exec('BEGIN TRANSACTION')!
mut file := os.open(filepath) or {
mut file := os.open(filepath) or {
console.print_stderr('Failed to open city file: ${err}')
return err
return err
}
defer { file.close() }
mut reader := io.new_buffered_reader(reader:file)
mut reader := io.new_buffered_reader(reader: file)
defer { reader.free() }
mut count := 0
console.print_header('Start import ${filepath}')
for {
line := reader.read_line() or {
//console.print_debug('End of file reached')
break
line := reader.read_line() or {
// console.print_debug('End of file reached')
break
}
//console.print_debug(line)
// console.print_debug(line)
fields := line.split('\t')
if fields.len < 12 { // Need at least 12 fields for required data
console.print_stderr('fields < 12: ${line}')
@@ -234,65 +224,52 @@ fn (mut l LocationDB) import_city_data(filepath string) ! {
name := fields[1]
ascii_name := texttools.name_fix(fields[2])
country_iso2 := fields[8].to_upper()
// Check if city exists
existing_city := sql l.db {
select from City where id == geoname_id
} or { []City{} }
city := City{
id: geoname_id
name: name
ascii_name: ascii_name
country_iso2: country_iso2
postal_code: '' // Not provided in this format
state_name: '' // Will need separate admin codes file
state_code: fields[10]
county_name: ''
county_code: fields[11]
community_name: ''
community_code: ''
latitude: fields[4].f64()
longitude: fields[5].f64()
accuracy: 4 // Using geonameid, so accuracy is 4
population: fields[14].i64()
timezone: fields[17]
feature_class: fields[6]
feature_code: fields[7]
id: geoname_id
name: name
ascii_name: ascii_name
country_iso2: country_iso2
postal_code: '' // Not provided in this format
state_name: '' // Will need separate admin codes file
state_code: fields[10]
county_name: ''
county_code: fields[11]
community_name: ''
community_code: ''
latitude: fields[4].f64()
longitude: fields[5].f64()
accuracy: 4 // Using geonameid, so accuracy is 4
population: fields[14].i64()
timezone: fields[17]
feature_class: fields[6]
feature_code: fields[7]
search_priority: 0 // Default priority
}
if existing_city.len > 0 {
// Update existing city
sql l.db {
update City set
name = city.name,
ascii_name = city.ascii_name,
country_iso2 = city.country_iso2,
postal_code = city.postal_code,
state_name = city.state_name,
state_code = city.state_code,
county_name = city.county_name,
county_code = city.county_code,
community_name = city.community_name,
community_code = city.community_code,
latitude = city.latitude,
longitude = city.longitude,
accuracy = city.accuracy,
population = city.population,
timezone = city.timezone,
feature_class = city.feature_class,
feature_code = city.feature_code,
search_priority = city.search_priority
where id == geoname_id
update City set name = city.name, ascii_name = city.ascii_name, country_iso2 = city.country_iso2,
postal_code = city.postal_code, state_name = city.state_name, state_code = city.state_code,
county_name = city.county_name, county_code = city.county_code, community_name = city.community_name,
community_code = city.community_code, latitude = city.latitude, longitude = city.longitude,
accuracy = city.accuracy, population = city.population, timezone = city.timezone,
feature_class = city.feature_class, feature_code = city.feature_code,
search_priority = city.search_priority where id == geoname_id
}!
//console.print_debug("Updated city: ${city}")
// console.print_debug("Updated city: ${city}")
} else {
// Insert new city
sql l.db {
insert city into City
}!
//console.print_debug("Inserted city: ${city}")
// console.print_debug("Inserted city: ${city}")
}
count++
// if count % 1000 == 0 {
@@ -300,8 +277,8 @@ fn (mut l LocationDB) import_city_data(filepath string) ! {
// }
}
console.print_debug( 'Processed ${count} cities')
console.print_debug('Processed ${count} cities')
l.db.exec('COMMIT')!
console.print_header('Finished importing cities for ${filepath}. Total records: ${count}')
}

View File

@@ -2,44 +2,44 @@ module location
pub struct Country {
pub:
iso2 string @[primary; sql: 'iso2'; max_len: 2; unique; index]
name string @[required; unique; index]
iso3 string @[required; sql: 'iso3'; max_len: 3; unique; index]
iso2 string @[index; max_len: 2; primary; sql: 'iso2'; unique]
name string @[index; required; unique]
iso3 string @[index; max_len: 3; required; sql: 'iso3'; unique]
continent string @[max_len: 2]
population i64
timezone string @[max_len: 40]
import_date i64 // Epoch timestamp of last import
import_date i64 // Epoch timestamp of last import
}
pub struct City {
pub:
id int @[unique; index]
name string @[required; max_len: 200; index]
ascii_name string @[required; max_len: 200; index] // Normalized name without special characters
country_iso2 string @[required; fkey: 'Country.iso2']
postal_code string @[max_len: 20; index ] //postal code
state_name string @[max_len: 100] // State/Province name
state_code string @[max_len: 20] // State/Province code
county_name string @[max_len: 100]
county_code string @[max_len: 20]
community_name string @[max_len: 100]
community_code string @[max_len: 20]
latitude f64 @[index: 'idx_coords']
longitude f64 @[index: 'idx_coords']
population i64
timezone string @[max_len: 40]
feature_class string @[max_len: 1] // For filtering (P for populated places)
feature_code string @[max_len: 10] // Detailed type (PPL, PPLA, etc.)
id int @[index; unique]
name string @[index; max_len: 200; required]
ascii_name string @[index; max_len: 200; required] // Normalized name without special characters
country_iso2 string @[fkey: 'Country.iso2'; required]
postal_code string @[index; max_len: 20] // postal code
state_name string @[max_len: 100] // State/Province name
state_code string @[max_len: 20] // State/Province code
county_name string @[max_len: 100]
county_code string @[max_len: 20]
community_name string @[max_len: 100]
community_code string @[max_len: 20]
latitude f64 @[index: 'idx_coords']
longitude f64 @[index: 'idx_coords']
population i64
timezone string @[max_len: 40]
feature_class string @[max_len: 1] // For filtering (P for populated places)
feature_code string @[max_len: 10] // Detailed type (PPL, PPLA, etc.)
search_priority int
accuracy i16 = 1 //1=estimated, 4=geonameid, 6=centroid of addresses or shape
accuracy i16 = 1 // 1=estimated, 4=geonameid, 6=centroid of addresses or shape
}
pub struct AlternateName {
pub:
id int @[primary; sql: serial]
city_id int @[required; fkey: 'City.id']
name string @[required; max_len: 200; index]
language_code string @[max_len: 2]
id int @[primary; sql: serial]
city_id int @[fkey: 'City.id'; required]
name string @[index; max_len: 200; required]
language_code string @[max_len: 2]
is_preferred bool
is_short bool
}
@@ -47,9 +47,9 @@ pub:
// SearchResult represents a location search result with combined city and country info
pub struct SearchResult {
pub:
city City
country Country
similarity f64 // Search similarity score
city City
country Country
similarity f64 // Search similarity score
}
// Coordinates represents a geographic point

View File

@@ -51,11 +51,11 @@ import db.pg
// where_clause := if query_conditions.len > 0 { 'WHERE ' + query_conditions.join(' AND ') } else { '' }
// query := '
// SELECT c.*, co.*
// SELECT c.*, co.*
// FROM City c
// JOIN Country co ON c.country_iso2 = co.iso2
// ${where_clause}
// ORDER BY c.search_priority DESC, c.population DESC
// ORDER BY c.search_priority DESC, c.population DESC
// LIMIT ${opts.limit}
// '
@@ -111,8 +111,8 @@ import db.pg
// query := "
// WITH distances AS (
// SELECT c.*, co.*,
// (6371 * acos(cos(radians($1)) * cos(radians(latitude)) *
// cos(radians(longitude) - radians($2)) + sin(radians($1)) *
// (6371 * acos(cos(radians($1)) * cos(radians(latitude)) *
// cos(radians(longitude) - radians($2)) + sin(radians($1)) *
// sin(radians(latitude)))) AS distance
// FROM City c
// JOIN Country co ON c.country_iso2 = co.iso2
@@ -122,7 +122,7 @@ import db.pg
// ORDER BY distance
// LIMIT $4
// "
// params := [
// opts.coordinates.latitude.str(),
// opts.coordinates.longitude.str(),

View File

@@ -97,13 +97,13 @@ fn (mut repo GitRepo) load_tags() ! {
tags_result := repo.exec('git tag --list') or {
return error('Failed to list tags: ${err}. Please ensure git is installed and repository is accessible.')
}
//println(tags_result)
// println(tags_result)
for line in tags_result.split('\n') {
line_trimmed := line.trim_space()
if line_trimmed != '' {
parts := line_trimmed.split(' ')
if parts.len < 2 {
//console.print_debug('Skipping malformed tag line: ${line_trimmed}')
// console.print_debug('Skipping malformed tag line: ${line_trimmed}')
continue
}
commit_hash := parts[0].trim_space()

View File

@@ -25,22 +25,21 @@ fn installed() !bool {
}
fn install() ! {
console.print_header('install gitea')
baseurl:="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-${version}"
baseurl := 'https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-${version}'
mut url := ''
if core.is_linux_arm()! {
//https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-linux-arm64.xz
if core.is_linux_arm()! {
// https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-linux-arm64.xz
url = '${baseurl}-linux-arm64.xz'
} else if core.is_linux_intel()! {
// https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-linux-amd64.xz
url = '${baseurl}-linux-amd64.xz'
} else if core.is_osx_arm()! {
//https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-darwin-10.12-arm64.xz
// https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-darwin-10.12-arm64.xz
url = '${baseurl}-darwin-10.12-arm64.xz'
} else if core.is_osx_intel()! {
//https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-darwin-10.12-amd64.xz
// https://github.com/go-gitea/gitea/releases/download/v1.23.2/gitea-1.23.2-darwin-10.12-amd64.xz
url = '${baseurl}-darwin-10.12-amd64.xz'
} else {
return error('unsported platform')
@@ -104,68 +103,66 @@ fn startupcmd() ![]zinit.ZProcessNewArgs {
}
return res
// mut res := []zinit.ZProcessNewArgs{}
// cfg := get()!
// res << zinit.ZProcessNewArgs{
// name: 'gitea'
// // cmd: 'GITEA_WORK_DIR=${cfg.path} sudo -u git /var/lib/git/gitea web -c /etc/gitea_app.ini'
// cmd: '
// # Variables
// GITEA_USER="${cfg.run_user}"
// GITEA_HOME="${cfg.path}"
// GITEA_BINARY="/usr/local/bin/gitea"
// GITEA_CONFIG="/etc/gitea_app.ini"
// GITEA_DATA_PATH="\$GITEA_HOME/data"
// GITEA_CUSTOM_PATH="\$GITEA_HOME/custom"
// GITEA_LOG_PATH="\$GITEA_HOME/log"
// mut res := []zinit.ZProcessNewArgs{}
// cfg := get()!
// res << zinit.ZProcessNewArgs{
// name: 'gitea'
// // cmd: 'GITEA_WORK_DIR=${cfg.path} sudo -u git /var/lib/git/gitea web -c /etc/gitea_app.ini'
// cmd: '
// # Ensure the script is run as root
// if [[ \$EUID -ne 0 ]]; then
// echo "This script must be run as root."
// exit 1
// fi
// # Variables
// GITEA_USER="${cfg.run_user}"
// GITEA_HOME="${cfg.path}"
// GITEA_BINARY="/usr/local/bin/gitea"
// GITEA_CONFIG="/etc/gitea_app.ini"
// GITEA_DATA_PATH="\$GITEA_HOME/data"
// GITEA_CUSTOM_PATH="\$GITEA_HOME/custom"
// GITEA_LOG_PATH="\$GITEA_HOME/log"
// echo "Setting up Gitea..."
// # Ensure the script is run as root
// if [[ \$EUID -ne 0 ]]; then
// echo "This script must be run as root."
// exit 1
// fi
// # Create Gitea user if it doesn\'t exist
// if id -u "\$GITEA_USER" &>/dev/null; then
// echo "User \$GITEA_USER already exists."
// else
// echo "Creating Gitea user..."
// if ! sudo adduser --system --shell /bin/bash --group --disabled-password --home "/var/lib/\$GITEA_USER" "\$GITEA_USER"; then
// echo "Failed to create user \$GITEA_USER."
// exit 1
// fi
// fi
// echo "Setting up Gitea..."
// # Create necessary directories
// echo "Creating directories..."
// mkdir -p "\$GITEA_DATA_PATH" "\$GITEA_CUSTOM_PATH" "\$GITEA_LOG_PATH"
// chown -R "\$GITEA_USER:\$GITEA_USER" "\$GITEA_HOME"
// chmod -R 750 "\$GITEA_HOME"
// # Create Gitea user if it doesn\'t exist
// if id -u "\$GITEA_USER" &>/dev/null; then
// echo "User \$GITEA_USER already exists."
// else
// echo "Creating Gitea user..."
// if ! sudo adduser --system --shell /bin/bash --group --disabled-password --home "/var/lib/\$GITEA_USER" "\$GITEA_USER"; then
// echo "Failed to create user \$GITEA_USER."
// exit 1
// fi
// fi
// chown "\$GITEA_USER:\$GITEA_USER" "\$GITEA_CONFIG"
// chmod 640 "\$GITEA_CONFIG"
// # Create necessary directories
// echo "Creating directories..."
// mkdir -p "\$GITEA_DATA_PATH" "\$GITEA_CUSTOM_PATH" "\$GITEA_LOG_PATH"
// chown -R "\$GITEA_USER:\$GITEA_USER" "\$GITEA_HOME"
// chmod -R 750 "\$GITEA_HOME"
// chown "\$GITEA_USER:\$GITEA_USER" "\$GITEA_CONFIG"
// chmod 640 "\$GITEA_CONFIG"
// GITEA_WORK_DIR=\$GITEA_HOME sudo -u git gitea web -c \$GITEA_CONFIG
// '
// workdir: cfg.path
// }
// res << zinit.ZProcessNewArgs{
// name: 'restart_gitea'
// cmd: 'sleep 30 && zinit restart gitea && exit 1'
// after: ['gitea']
// oneshot: true
// workdir: cfg.path
// }
// return res
// GITEA_WORK_DIR=\$GITEA_HOME sudo -u git gitea web -c \$GITEA_CONFIG
// '
// workdir: cfg.path
// }
// res << zinit.ZProcessNewArgs{
// name: 'restart_gitea'
// cmd: 'sleep 30 && zinit restart gitea && exit 1'
// after: ['gitea']
// oneshot: true
// workdir: cfg.path
// }
// return res
}
fn running() !bool {
//TODO: extend with proper gitea client
// TODO: extend with proper gitea client
res := os.execute('curl -fsSL http://localhost:3000 || exit 1')
return res.exit_code == 0
}

View File

@@ -4,287 +4,277 @@ import freeflowuniverse.herolib.core.base
import freeflowuniverse.herolib.core.playbook
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.data.paramsparser
import freeflowuniverse.herolib.sysadmin.startupmanager
import freeflowuniverse.herolib.osal.zinit
import time
__global (
gitea_global map[string]&GiteaServer
gitea_default string
gitea_global map[string]&GiteaServer
gitea_default string
)
/////////FACTORY
@[params]
pub struct ArgsGet{
pub struct ArgsGet {
pub mut:
name string
name string
}
fn args_get (args_ ArgsGet) ArgsGet {
mut args:=args_
if args.name == ""{
args.name = "default"
}
return args
fn args_get(args_ ArgsGet) ArgsGet {
mut args := args_
if args.name == '' {
args.name = 'default'
}
return args
}
pub fn get(args_ ArgsGet) !&GiteaServer {
mut context:=base.context()!
mut args := args_get(args_)
mut obj := GiteaServer{}
if !(args.name in gitea_global) {
if ! exists(args)!{
set(obj)!
}else{
heroscript := context.hero_config_get("gitea",args.name)!
mut obj2:=heroscript_loads(heroscript)!
set_in_mem(obj2)!
}
}
return gitea_global[args.name] or {
println(gitea_global)
//bug if we get here because should be in globals
panic("could not get config for gitea with name, is bug:${args.name}")
}
pub fn get(args_ ArgsGet) !&GiteaServer {
mut context := base.context()!
mut args := args_get(args_)
mut obj := GiteaServer{}
if args.name !in gitea_global {
if !exists(args)! {
set(obj)!
} else {
heroscript := context.hero_config_get('gitea', args.name)!
mut obj2 := heroscript_loads(heroscript)!
set_in_mem(obj2)!
}
}
return gitea_global[args.name] or {
println(gitea_global)
// bug if we get here because should be in globals
panic('could not get config for gitea with name, is bug:${args.name}')
}
}
//register the config for the future
pub fn set(o GiteaServer)! {
set_in_mem(o)!
mut context := base.context()!
heroscript := heroscript_dumps(o)!
context.hero_config_set("gitea", o.name, heroscript)!
// register the config for the future
pub fn set(o GiteaServer) ! {
set_in_mem(o)!
mut context := base.context()!
heroscript := heroscript_dumps(o)!
context.hero_config_set('gitea', o.name, heroscript)!
}
//does the config exists?
// does the config exists?
pub fn exists(args_ ArgsGet) !bool {
mut context := base.context()!
mut args := args_get(args_)
return context.hero_config_exists("gitea", args.name)
mut context := base.context()!
mut args := args_get(args_)
return context.hero_config_exists('gitea', args.name)
}
pub fn delete(args_ ArgsGet)! {
mut args := args_get(args_)
mut context:=base.context()!
context.hero_config_delete("gitea",args.name)!
if args.name in gitea_global {
//del gitea_global[args.name]
}
pub fn delete(args_ ArgsGet) ! {
mut args := args_get(args_)
mut context := base.context()!
context.hero_config_delete('gitea', args.name)!
if args.name in gitea_global {
// del gitea_global[args.name]
}
}
//only sets in mem, does not set as config
fn set_in_mem(o GiteaServer)! {
mut o2:=obj_init(o)!
gitea_global[o.name] = &o2
gitea_default = o.name
// only sets in mem, does not set as config
fn set_in_mem(o GiteaServer) ! {
mut o2 := obj_init(o)!
gitea_global[o.name] = &o2
gitea_default = o.name
}
@[params]
pub struct PlayArgs {
pub mut:
heroscript string //if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
heroscript string // if filled in then plbook will be made out of it
plbook ?playbook.PlayBook
reset bool
}
pub fn play(args_ PlayArgs) ! {
mut args:=args_
mut args := args_
mut plbook := args.plbook or {
playbook.new(text: args.heroscript)!
}
mut install_actions := plbook.find(filter: 'gitea.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
heroscript:=install_action.heroscript()
mut obj:=heroscript_loads(heroscript)!
set(obj)!
}
}
mut plbook := args.plbook or { playbook.new(text: args.heroscript)! }
mut other_actions := plbook.find(filter: 'gitea.')!
for other_action in other_actions {
if other_action.name in ["destroy","install","build"]{
mut p := other_action.params
reset:=p.get_default_false("reset")
if other_action.name == "destroy" || reset{
console.print_debug("install action gitea.destroy")
destroy()!
}
if other_action.name == "install"{
console.print_debug("install action gitea.install")
install()!
}
}
if other_action.name in ["start","stop","restart"]{
mut p := other_action.params
name := p.get('name')!
mut gitea_obj:=get(name:name)!
console.print_debug("action object:\n${gitea_obj}")
if other_action.name == "start"{
console.print_debug("install action gitea.${other_action.name}")
gitea_obj.start()!
}
mut install_actions := plbook.find(filter: 'gitea.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
heroscript := install_action.heroscript()
mut obj := heroscript_loads(heroscript)!
set(obj)!
}
}
if other_action.name == "stop"{
console.print_debug("install action gitea.${other_action.name}")
gitea_obj.stop()!
}
if other_action.name == "restart"{
console.print_debug("install action gitea.${other_action.name}")
gitea_obj.restart()!
}
}
}
mut other_actions := plbook.find(filter: 'gitea.')!
for other_action in other_actions {
if other_action.name in ['destroy', 'install', 'build'] {
mut p := other_action.params
reset := p.get_default_false('reset')
if other_action.name == 'destroy' || reset {
console.print_debug('install action gitea.destroy')
destroy()!
}
if other_action.name == 'install' {
console.print_debug('install action gitea.install')
install()!
}
}
if other_action.name in ['start', 'stop', 'restart'] {
mut p := other_action.params
name := p.get('name')!
mut gitea_obj := get(name: name)!
console.print_debug('action object:\n${gitea_obj}')
if other_action.name == 'start' {
console.print_debug('install action gitea.${other_action.name}')
gitea_obj.start()!
}
if other_action.name == 'stop' {
console.print_debug('install action gitea.${other_action.name}')
gitea_obj.stop()!
}
if other_action.name == 'restart' {
console.print_debug('install action gitea.${other_action.name}')
gitea_obj.restart()!
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////# LIVE CYCLE MANAGEMENT FOR INSTALLERS ///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
fn startupmanager_get(cat zinit.StartupManagerType) !startupmanager.StartupManager {
// unknown
// screen
// zinit
// tmux
// systemd
match cat{
.zinit{
console.print_debug("startupmanager: zinit")
return startupmanager.get(cat:.zinit)!
}
.systemd{
console.print_debug("startupmanager: systemd")
return startupmanager.get(cat:.systemd)!
}else{
console.print_debug("startupmanager: auto")
return startupmanager.get()!
}
}
// unknown
// screen
// zinit
// tmux
// systemd
match cat {
.zinit {
console.print_debug('startupmanager: zinit')
return startupmanager.get(cat: .zinit)!
}
.systemd {
console.print_debug('startupmanager: systemd')
return startupmanager.get(cat: .systemd)!
}
else {
console.print_debug('startupmanager: auto')
return startupmanager.get()!
}
}
}
//load from disk and make sure is properly intialized
// load from disk and make sure is properly intialized
pub fn (mut self GiteaServer) reload() ! {
switch(self.name)
self=obj_init(self)!
switch(self.name)
self = obj_init(self)!
}
pub fn (mut self GiteaServer) start() ! {
switch(self.name)
if self.running()!{
return
}
switch(self.name)
if self.running()! {
return
}
console.print_header('gitea start')
console.print_header('gitea start')
if ! installed()!{
install()!
}
if !installed()! {
install()!
}
configure()!
configure()!
start_pre()!
start_pre()!
for zprocess in startupcmd()!{
mut sm:=startupmanager_get(zprocess.startuptype)!
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
console.print_debug('starting gitea with ${zprocess.startuptype}...')
console.print_debug('starting gitea with ${zprocess.startuptype}...')
sm.new(zprocess)!
sm.new(zprocess)!
sm.start(zprocess.name)!
}
sm.start(zprocess.name)!
}
start_post()!
for _ in 0 .. 50 {
if self.running()! {
return
}
time.sleep(100 * time.millisecond)
}
return error('gitea did not install properly.')
start_post()!
for _ in 0 .. 50 {
if self.running()! {
return
}
time.sleep(100 * time.millisecond)
}
return error('gitea did not install properly.')
}
pub fn (mut self GiteaServer) install_start(args InstallArgs) ! {
switch(self.name)
self.install(args)!
self.start()!
switch(self.name)
self.install(args)!
self.start()!
}
pub fn (mut self GiteaServer) stop() ! {
switch(self.name)
stop_pre()!
for zprocess in startupcmd()!{
mut sm:=startupmanager_get(zprocess.startuptype)!
sm.stop(zprocess.name)!
}
stop_post()!
switch(self.name)
stop_pre()!
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
sm.stop(zprocess.name)!
}
stop_post()!
}
pub fn (mut self GiteaServer) restart() ! {
switch(self.name)
self.stop()!
self.start()!
switch(self.name)
self.stop()!
self.start()!
}
pub fn (mut self GiteaServer) running() !bool {
switch(self.name)
switch(self.name)
//walk over the generic processes, if not running return
for zprocess in startupcmd()!{
mut sm:=startupmanager_get(zprocess.startuptype)!
r:=sm.running(zprocess.name)!
if r==false{
return false
}
}
return running()!
// walk over the generic processes, if not running return
for zprocess in startupcmd()! {
mut sm := startupmanager_get(zprocess.startuptype)!
r := sm.running(zprocess.name)!
if r == false {
return false
}
}
return running()!
}
@[params]
pub struct InstallArgs{
pub struct InstallArgs {
pub mut:
reset bool
reset bool
}
pub fn (mut self GiteaServer) install(args InstallArgs) ! {
switch(self.name)
if args.reset || (!installed()!) {
install()!
}
switch(self.name)
if args.reset || (!installed()!) {
install()!
}
}
pub fn (mut self GiteaServer) build() ! {
switch(self.name)
build()!
switch(self.name)
build()!
}
pub fn (mut self GiteaServer) destroy() ! {
switch(self.name)
self.stop() or {}
destroy()!
switch(self.name)
self.stop() or {}
destroy()!
}
//switch instance to be used for gitea
// switch instance to be used for gitea
pub fn switch(name string) {
gitea_default = name
gitea_default = name
}
//helpers
// helpers
@[params]
pub struct DefaultConfigArgs{
instance string = 'default'
pub struct DefaultConfigArgs {
instance string = 'default'
}

View File

@@ -1,4 +1,5 @@
module gitea
import freeflowuniverse.herolib.data.paramsparser
import freeflowuniverse.herolib.data.encoderhero
import freeflowuniverse.herolib.core.pathlib
@@ -16,30 +17,29 @@ const default = false
@[heap]
pub struct GiteaServer {
pub mut:
name string = 'default'
path string = '${os.home_dir()}/hero/var/gitea'
passwd string
domain string = "git.test.com"
jwt_secret string = rand.hex(12)
lfs_jwt_secret string
internal_token string
secret_key string
postgresql_client_name string = "default"
mail_client_name string = "default"
name string = 'default'
path string = '${os.home_dir()}/hero/var/gitea'
passwd string
domain string = 'git.test.com'
jwt_secret string = rand.hex(12)
lfs_jwt_secret string
internal_token string
secret_key string
postgresql_client_name string = 'default'
mail_client_name string = 'default'
}
pub fn (obj GiteaServer) config_path() string {
return '${obj.path}/config.ini'
return '${obj.path}/config.ini'
}
//your checking & initialization code if needed
fn obj_init(mycfg_ GiteaServer)!GiteaServer{
mut mycfg:=mycfg_
return mycfg
// your checking & initialization code if needed
fn obj_init(mycfg_ GiteaServer) !GiteaServer {
mut mycfg := mycfg_
return mycfg
}
//called before start if done
// called before start if done
fn configure() ! {
mut server := get()!
@@ -68,7 +68,7 @@ fn configure() ! {
return error('Failed to initialize mail client "${server.mail_client_name}": ${err}')
}
//TODO: check database exists
// TODO: check database exists
if !db_client.db_exists('gitea_${server.name}')! {
console.print_header('Creating database gitea_${server.name} for gitea.')
db_client.db_create('gitea_${server.name}')!
@@ -85,10 +85,10 @@ fn configure() ! {
/////////////NORMALLY NO NEED TO TOUCH
pub fn heroscript_dumps(obj GiteaServer) !string {
return encoderhero.encode[GiteaServer ](obj)!
return encoderhero.encode[GiteaServer](obj)!
}
pub fn heroscript_loads(heroscript string) !GiteaServer {
mut obj := encoderhero.decode[GiteaServer](heroscript)!
return obj
mut obj := encoderhero.decode[GiteaServer](heroscript)!
return obj
}

View File

@@ -10,9 +10,9 @@ fn testsuite_begin() {
muttmux := new() or { panic('Cannot create tmux: ${err}') }
// reset tmux for tests
is_running := tmux.is_running() or { panic('cannot check if tmux is running: ${err}') }
is_running := is_running() or { panic('cannot check if tmux is running: ${err}') }
if is_running {
tmux.stop() or { panic('Cannot stop tmux: ${err}') }
stop() or { panic('Cannot stop tmux: ${err}') }
}
}
@@ -41,27 +41,21 @@ fn test_window_new() ! {
// tests creating duplicate windows
fn test_window_new0() {
installer := get_install()!
installer := tmux.get_install(
mut tmux := Tmux {
mut tmux := Tmux{
node: node_ssh
}
window_args := WindowArgs {
window_args := WindowArgs{
name: 'TestWindow0'
}
// console.print_debug(tmux)
mut window := tmux.window_new(window_args) or {
panic("Can't create new window: $err")
}
mut window := tmux.window_new(window_args) or { panic("Can't create new window: ${err}") }
assert tmux.sessions.keys().contains('main')
mut window_dup := tmux.window_new(window_args) or {
panic("Can't create new window: $err")
}
console.print_debug(node_ssh.exec('tmux ls') or { panic("fail:$err")})
window.delete() or { panic("Cant delete window") }
mut window_dup := tmux.window_new(window_args) or { panic("Can't create new window: ${err}") }
console.print_debug(node_ssh.exec('tmux ls') or { panic('fail:${err}') })
window.delete() or { panic('Cant delete window') }
// console.print_debug(tmux)
}

View File

@@ -13,58 +13,58 @@ import freeflowuniverse.herolib.ui.console
@[heap]
pub struct DocSite {
pub mut:
name string
url string
path_src pathlib.Path
path_build pathlib.Path
name string
url string
path_src pathlib.Path
path_build pathlib.Path
// path_publish pathlib.Path
args DSiteNewArgs
errors []SiteError
args DSiteNewArgs
errors []SiteError
config Config
}
@[params]
pub struct DSiteNewArgs {
pub mut:
name string
nameshort string
path string
url string
name string
nameshort string
path string
url string
// publish_path string
build_path string
production bool
build_path string
production bool
watch_changes bool = true
update bool
update bool
}
pub fn (mut f DocusaurusFactory) build_dev(args_ DSiteNewArgs) !&DocSite {
mut s:=f.add(args_)!
mut s := f.add(args_)!
s.generate()!
osal.exec(
cmd: '
cmd: '
cd ${s.path_build.path}
bash build_dev.sh
'
retry: 0
)!
)!
return s
}
pub fn (mut f DocusaurusFactory) build(args_ DSiteNewArgs) !&DocSite {
mut s:=f.add(args_)!
mut s := f.add(args_)!
s.generate()!
osal.exec(
cmd: '
cmd: '
cd ${s.path_build.path}
bash build.sh
'
retry: 0
)!
)!
return s
}
pub fn (mut f DocusaurusFactory) dev(args_ DSiteNewArgs) !&DocSite {
mut s:=f.add(args_)!
mut s := f.add(args_)!
s.clean()!
s.generate()!
@@ -72,14 +72,14 @@ pub fn (mut f DocusaurusFactory) dev(args_ DSiteNewArgs) !&DocSite {
// Create screen session for docusaurus development server
mut screen_name := 'docusaurus'
mut sf := screen.new()!
// Add and start a new screen session
mut scr := sf.add(
name: screen_name
cmd: '/bin/bash'
start: true
name: screen_name
cmd: '/bin/bash'
start: true
attach: false
reset: true
reset: true
)!
// Send commands to the screen session
@@ -93,33 +93,29 @@ pub fn (mut f DocusaurusFactory) dev(args_ DSiteNewArgs) !&DocSite {
console.print_item(' 1. Attach to screen: screen -r ${screen_name}')
console.print_item(' 2. To detach from screen: Press Ctrl+A then D')
console.print_item(' 3. To list all screens: screen -ls')
console.print_item('The site content is on::')
console.print_item('The site content is on::')
console.print_item(' 1. location of documents: ${s.path_src.path}/docs')
if osal.cmd_exists("code"){
if osal.cmd_exists('code') {
console.print_item(' 2. We opened above dir in vscode.')
osal.exec(cmd:'code ${s.path_src.path}/docs')!
osal.exec(cmd: 'code ${s.path_src.path}/docs')!
}
// Start the watcher in a separate thread
//mut tf:=spawn watch_docs(docs_path, s.path_src.path, s.path_build.path)
//tf.wait()!
println("\n")
// mut tf:=spawn watch_docs(docs_path, s.path_src.path, s.path_build.path)
// tf.wait()!
println('\n')
if args_.watch_changes {
docs_path := '${s.path_src.path}/docs'
watch_docs(docs_path, s.path_src.path, s.path_build.path)!
}
}
return s
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
pub fn (mut f DocusaurusFactory) add(args_ DSiteNewArgs) !&DocSite {
console.print_header(' Docusaurus: ${args_.name}')
mut args := args_
@@ -129,62 +125,57 @@ pub fn (mut f DocusaurusFactory) add(args_ DSiteNewArgs) !&DocSite {
}
// if args.publish_path.len == 0 {
// args.publish_path = '${f.path_publish.path}/${args.name}'
if args.url.len>0{
if args.url.len > 0 {
mut gs := gittools.new()!
args.path = gs.get_path(url: args.url)!
}
if args.path.len==0{
if args.path.len == 0 {
return error("Can't get path from docusaurus site, its not specified.")
}
mut gs := gittools.new()!
mut r := gs.get_repo(url: 'https://github.com/freeflowuniverse/docusaurus_template.git',pull:args.update)!
mut r := gs.get_repo(
url: 'https://github.com/freeflowuniverse/docusaurus_template.git'
pull: args.update
)!
mut template_path := r.patho()!
// First ensure cfg directory exists in src, if not copy from template
if !os.exists("${args.path}/cfg") {
mut template_cfg := template_path.dir_get("cfg")!
template_cfg.copy(dest:"${args.path}/cfg")!
if !os.exists('${args.path}/cfg') {
mut template_cfg := template_path.dir_get('cfg')!
template_cfg.copy(dest: '${args.path}/cfg')!
}
if !os.exists("${args.path}/docs") {
mut template_cfg := template_path.dir_get("docs")!
template_cfg.copy(dest:"${args.path}/docs")!
if !os.exists('${args.path}/docs') {
mut template_cfg := template_path.dir_get('docs')!
template_cfg.copy(dest: '${args.path}/docs')!
}
mut myconfig := load_config('${args.path}/cfg')!
mut myconfig:=load_config("${args.path}/cfg")!
if myconfig.main.name.len==0{
myconfig.main.name = myconfig.main.base_url.trim_space().trim("/").trim_space()
if myconfig.main.name.len == 0 {
myconfig.main.name = myconfig.main.base_url.trim_space().trim('/').trim_space()
}
if args.name == '' {
args.name = myconfig.main.name
}
}
if args.nameshort.len == 0 {
args.nameshort = args.name
}
}
args.nameshort = texttools.name_fix(args.nameshort)
mut ds := DocSite{
name: args.name
url: args.url
path_src: pathlib.get_dir(path: args.path, create: false)!
name: args.name
url: args.url
path_src: pathlib.get_dir(path: args.path, create: false)!
path_build: f.path_build
// path_publish: pathlib.get_dir(path: args.publish_path, create: true)!
args: args
config:myconfig
args: args
config: myconfig
}
f.sites << &ds
@@ -201,9 +192,9 @@ pub mut:
}
pub fn (mut site DocSite) error(args ErrorArgs) {
// path2 := pathlib.get(args.path)
e := SiteError{
path: args.path
// path2 := pathlib.get(args.path)
e := SiteError{
path: args.path
msg: args.msg
cat: args.cat
}
@@ -222,21 +213,19 @@ pub fn (mut site DocSite) generate() ! {
// retry: 0
// )!
// Now copy all directories that exist in src to build
for item in ["src","static","cfg"]{
if os.exists("${site.path_src.path}/${item}"){
mut aa:= site.path_src.dir_get(item)!
aa.copy(dest:"${site.path_build.path}/${item}")!
for item in ['src', 'static', 'cfg'] {
if os.exists('${site.path_src.path}/${item}') {
mut aa := site.path_src.dir_get(item)!
aa.copy(dest: '${site.path_build.path}/${item}')!
}
}
for item in ["docs"]{
if os.exists("${site.path_src.path}/${item}"){
mut aa:= site.path_src.dir_get(item)!
aa.copy(dest:"${site.path_build.path}/${item}",delete:true)!
for item in ['docs'] {
if os.exists('${site.path_src.path}/${item}') {
mut aa := site.path_src.dir_get(item)!
aa.copy(dest: '${site.path_build.path}/${item}', delete: true)!
}
}
}
fn (mut site DocSite) template_install() ! {
@@ -245,22 +234,26 @@ fn (mut site DocSite) template_install() ! {
mut r := gs.get_repo(url: 'https://github.com/freeflowuniverse/docusaurus_template.git')!
mut template_path := r.patho()!
//always start from template first
for item in ["src","static","cfg"]{
mut aa:= template_path.dir_get(item)!
aa.copy(dest:"${site.path_build.path}/${item}",delete:true)!
// always start from template first
for item in ['src', 'static', 'cfg'] {
mut aa := template_path.dir_get(item)!
aa.copy(dest: '${site.path_build.path}/${item}', delete: true)!
}
for item in ['package.json', 'sidebars.ts', 'tsconfig.json','docusaurus.config.ts'] {
for item in ['package.json', 'sidebars.ts', 'tsconfig.json', 'docusaurus.config.ts'] {
src_path := os.join_path(template_path.path, item)
dest_path := os.join_path(site.path_build.path, item)
os.cp(src_path, dest_path) or { return error('Failed to copy ${item} to build path: ${err}') }
os.cp(src_path, dest_path) or {
return error('Failed to copy ${item} to build path: ${err}')
}
}
for item in ['.gitignore'] {
src_path := os.join_path(template_path.path, item)
dest_path := os.join_path(site.path_src.path, item)
os.cp(src_path, dest_path) or { return error('Failed to copy ${item} to source path: ${err}') }
os.cp(src_path, dest_path) or {
return error('Failed to copy ${item} to source path: ${err}')
}
}
cfg := site.config
@@ -269,30 +262,27 @@ fn (mut site DocSite) template_install() ! {
build := $tmpl('templates/build.sh')
build_dev := $tmpl('templates/build_dev.sh')
mut develop_ := site.path_build.file_get_new("develop.sh")!
develop_.template_write(develop,true)!
mut develop_ := site.path_build.file_get_new('develop.sh')!
develop_.template_write(develop, true)!
develop_.chmod(0o700)!
mut build_ := site.path_build.file_get_new("build.sh")!
build_.template_write(build,true)!
mut build_ := site.path_build.file_get_new('build.sh')!
build_.template_write(build, true)!
build_.chmod(0o700)!
mut build_dev_ := site.path_build.file_get_new("build_dev.sh")!
build_dev_.template_write(build_dev,true)!
mut build_dev_ := site.path_build.file_get_new('build_dev.sh')!
build_dev_.template_write(build_dev, true)!
build_dev_.chmod(0o700)!
mut develop2_ := site.path_src.file_get_new("develop.sh")!
develop2_.template_write(develop,true)!
mut develop2_ := site.path_src.file_get_new('develop.sh')!
develop2_.template_write(develop, true)!
develop2_.chmod(0o700)!
mut build2_ := site.path_src.file_get_new("build.sh")!
build2_.template_write(build,true)!
mut build2_ := site.path_src.file_get_new('build.sh')!
build2_.template_write(build, true)!
build2_.chmod(0o700)!
mut build_dev2_ := site.path_src.file_get_new("build_dev.sh")!
build_dev2_.template_write(build_dev,true)!
build_dev2_.chmod(0o700)!
mut build_dev2_ := site.path_src.file_get_new('build_dev.sh')!
build_dev2_.template_write(build_dev, true)!
build_dev2_.chmod(0o700)!
}

View File

@@ -22,7 +22,7 @@ pub mut:
// publish_path string
build_path string
production bool
update bool
update bool
}
pub fn new(args_ DocusaurusArgs) !&DocusaurusFactory {

View File

@@ -7,7 +7,10 @@ import freeflowuniverse.herolib.installers.web.bun
fn (mut site DocusaurusFactory) template_install(update bool) ! {
mut gs := gittools.new()!
mut r := gs.get_repo(url: 'https://github.com/freeflowuniverse/docusaurus_template.git',pull:update)!
mut r := gs.get_repo(
url: 'https://github.com/freeflowuniverse/docusaurus_template.git'
pull: update
)!
mut template_path := r.patho()!
for item in ['package.json', 'sidebars.ts', 'tsconfig.json'] {

8
manual/create_tag.md Normal file
View File

@@ -0,0 +1,8 @@
## how to tag a version and push
```bash
cd ~/Users/despiegk~/code/github/freeflowuniverse/herolib/README.md
git tag -a v1.0.2 -m "some message"
git add . -A ; git commit -m ... ; git pull ; git push origin v1.0.2
```

452
vdocs/arrays.md Normal file
View File

@@ -0,0 +1,452 @@
# module arrays
## Contents
- [append](#append)
- [binary_search](#binary_search)
- [carray_to_varray](#carray_to_varray)
- [chunk](#chunk)
- [chunk_while](#chunk_while)
- [concat](#concat)
- [copy](#copy)
- [distinct](#distinct)
- [each](#each)
- [each_indexed](#each_indexed)
- [filter_indexed](#filter_indexed)
- [find_first](#find_first)
- [find_last](#find_last)
- [flat_map](#flat_map)
- [flat_map_indexed](#flat_map_indexed)
- [flatten](#flatten)
- [fold](#fold)
- [fold_indexed](#fold_indexed)
- [group](#group)
- [group_by](#group_by)
- [idx_max](#idx_max)
- [idx_min](#idx_min)
- [index_of_first](#index_of_first)
- [index_of_last](#index_of_last)
- [join_to_string](#join_to_string)
- [lower_bound](#lower_bound)
- [map_indexed](#map_indexed)
- [map_of_counts](#map_of_counts)
- [map_of_indexes](#map_of_indexes)
- [max](#max)
- [merge](#merge)
- [min](#min)
- [partition](#partition)
- [reduce](#reduce)
- [reduce_indexed](#reduce_indexed)
- [rotate_left](#rotate_left)
- [rotate_right](#rotate_right)
- [sum](#sum)
- [uniq](#uniq)
- [uniq_all_repeated](#uniq_all_repeated)
- [uniq_only](#uniq_only)
- [uniq_only_repeated](#uniq_only_repeated)
- [upper_bound](#upper_bound)
- [window](#window)
- [WindowAttribute](#WindowAttribute)
## append
Example
```v
arrays.append([1, 3, 5, 7], [2, 4, 6, 8]) // => [1, 3, 5, 7, 2, 4, 6, 8]
```
[[Return to contents]](#Contents)
## binary_search
Example
```v
arrays.binary_search([1, 2, 3, 4], 4)! // => 3
```
[[Return to contents]](#Contents)
## carray_to_varray
[[Return to contents]](#Contents)
## chunk
Example
```v
arrays.chunk([1, 2, 3, 4, 5, 6, 7, 8, 9], 2)) // => [[1, 2], [3, 4], [5, 6], [7, 8], [9]]
```
[[Return to contents]](#Contents)
## chunk_while
Examples
```v
assert arrays.chunk_while([0,9,2,2,3,2,7,5,9,5],fn(x int,y int)bool{return x<=y})==[[0,9],[2,2,3],[2,7],[5,9],[5]]
assert arrays.chunk_while('aaaabbbcca'.runes(),fn(x rune,y rune)bool{return x==y})==[[`a`,`a`,`a`,`a`],[`b`,`b`,`b`],[`c`,`c`],[`a`]]
assert arrays.chunk_while('aaaabbbcca'.runes(),fn(x rune,y rune)bool{return x==y}).map({it[0]:it.len})==[{`a`:4},{`b`:3},{`c`:2},{`a`:1}]
```
[[Return to contents]](#Contents)
## concat
Examples
```v
arrays.concat([1, 2, 3], 4, 5, 6) == [1, 2, 3, 4, 5, 6] // => true
arrays.concat([1, 2, 3], ...[4, 5, 6]) == [1, 2, 3, 4, 5, 6] // => true
arr << [4, 5, 6] // does what you need if arr is mutable
```
[[Return to contents]](#Contents)
## copy
[[Return to contents]](#Contents)
## distinct
Example
```v
assert arrays.distinct( [5, 5, 1, 5, 2, 1, 1, 9] ) == [1, 2, 5, 9]
```
[[Return to contents]](#Contents)
## each
[[Return to contents]](#Contents)
## each_indexed
[[Return to contents]](#Contents)
## filter_indexed
[[Return to contents]](#Contents)
## find_first
Example
```v
arrays.find_first([1, 2, 3, 4, 5], fn (i int) bool { return i == 3 })? // => 3
```
[[Return to contents]](#Contents)
## find_last
Example
```v
arrays.find_last([1, 2, 3, 4, 5], fn (i int) bool { return i == 3})? // => 3
```
[[Return to contents]](#Contents)
## flat_map
[[Return to contents]](#Contents)
## flat_map_indexed
[[Return to contents]](#Contents)
## flatten
Example
```v
arrays.flatten[int]([[1, 2, 3], [4, 5]]) // => [1, 2, 3, 4, 5]
```
[[Return to contents]](#Contents)
## fold
Example
```v
// Sum the length of each string in an array
a := ['Hi', 'all']
r := arrays.fold[string, int](a, 0,
fn (r int, t string) int { return r + t.len })
assert r == 5
```
[[Return to contents]](#Contents)
## fold_indexed
[[Return to contents]](#Contents)
## group
Example
```v
arrays.group[int]([1, 2, 3], [4, 5, 6]) // => [[1, 4], [2, 5], [3, 6]]
```
[[Return to contents]](#Contents)
## group_by
Example
```v
arrays.group_by[int, string](['H', 'el', 'lo'], fn (v string) int { return v.len }) // => {1: ['H'], 2: ['el', 'lo']}
```
[[Return to contents]](#Contents)
## idx_max
Example
```v
arrays.idx_max([1, 2, 3, 0, 9])! // => 4
```
[[Return to contents]](#Contents)
## idx_min
Example
```v
arrays.idx_min([1, 2, 3, 0, 9])! // => 3
```
[[Return to contents]](#Contents)
## index_of_first
Example
```v
arrays.index_of_first([4,5,0,7,0,9], fn(idx int, x int) bool { return x == 0 }) == 2
```
[[Return to contents]](#Contents)
## index_of_last
Example
```v
arrays.index_of_last([4,5,0,7,0,9], fn(idx int, x int) bool { return x == 0 }) == 4
```
[[Return to contents]](#Contents)
## join_to_string
[[Return to contents]](#Contents)
## lower_bound
Example
```v
arrays.lower_bound([2, 4, 6, 8], 3)! // => 4
```
[[Return to contents]](#Contents)
## map_indexed
[[Return to contents]](#Contents)
## map_of_counts
Example
```v
arrays.map_of_counts([1,2,3,4,4,2,1,4,4]) == {1: 2, 2: 2, 3: 1, 4: 4}
```
[[Return to contents]](#Contents)
## map_of_indexes
Example
```v
arrays.map_of_indexes([1,2,3,4,4,2,1,4,4,999]) == {1: [0, 6], 2: [1, 5], 3: [2], 4: [3, 4, 7, 8], 999: [9]}
```
[[Return to contents]](#Contents)
## max
Example
```v
arrays.max([1, 2, 3, 0, 9])! // => 9
```
[[Return to contents]](#Contents)
## merge
Example
```v
arrays.merge([1, 3, 5, 7], [2, 4, 6, 8]) // => [1, 2, 3, 4, 5, 6, 7, 8]
```
[[Return to contents]](#Contents)
## min
Example
```v
arrays.min([1, 2, 3, 0, 9])! // => 0
```
[[Return to contents]](#Contents)
## partition
[[Return to contents]](#Contents)
## reduce
Example
```v
arrays.reduce([1, 2, 3, 4, 5], fn (t1 int, t2 int) int { return t1 * t2 })! // => 120
```
[[Return to contents]](#Contents)
## reduce_indexed
[[Return to contents]](#Contents)
## rotate_left
Example
```v
mut x := [1,2,3,4,5,6]
arrays.rotate_left(mut x, 2)
println(x) // [3, 4, 5, 6, 1, 2]
```
[[Return to contents]](#Contents)
## rotate_right
Example
```v
mut x := [1,2,3,4,5,6]
arrays.rotate_right(mut x, 2)
println(x) // [5, 6, 1, 2, 3, 4]
```
[[Return to contents]](#Contents)
## sum
Example
```v
arrays.sum([1, 2, 3, 4, 5])! // => 15
```
[[Return to contents]](#Contents)
## uniq
Examples
```v
assert arrays.uniq( []int{} ) == []
assert arrays.uniq( [1, 1] ) == [1]
assert arrays.uniq( [2, 1] ) == [2, 1]
assert arrays.uniq( [5, 5, 1, 5, 2, 1, 1, 9] ) == [5, 1, 5, 2, 1, 9]
```
[[Return to contents]](#Contents)
## uniq_all_repeated
Examples
```v
assert arrays.uniq_all_repeated( []int{} ) == []
assert arrays.uniq_all_repeated( [1, 5] ) == []
assert arrays.uniq_all_repeated( [5, 5] ) == [5,5]
assert arrays.uniq_all_repeated( [5, 5, 1, 5, 2, 1, 1, 9] ) == [5, 5, 1, 1]
```
[[Return to contents]](#Contents)
## uniq_only
Examples
```v
assert arrays.uniq_only( []int{} ) == []
assert arrays.uniq_only( [1, 1] ) == []
assert arrays.uniq_only( [2, 1] ) == [2, 1]
assert arrays.uniq_only( [1, 5, 5, 1, 5, 2, 1, 1, 9] ) == [1, 1, 5, 2, 9]
```
[[Return to contents]](#Contents)
## uniq_only_repeated
Examples
```v
assert arrays.uniq_only_repeated( []int{} ) == []
assert arrays.uniq_only_repeated( [1, 5] ) == []
assert arrays.uniq_only_repeated( [5, 5] ) == [5]
assert arrays.uniq_only_repeated( [5, 5, 1, 5, 2, 1, 1, 9] ) == [5, 1]
```
[[Return to contents]](#Contents)
## upper_bound
Example
```v
arrays.upper_bound([2, 4, 6, 8], 3)! // => 2
```
[[Return to contents]](#Contents)
## window
Examples
```v
arrays.window([1, 2, 3, 4], size: 2) // => [[1, 2], [2, 3], [3, 4]]
arrays.window([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], size: 3, step: 2) // => [[1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9]]
```
[[Return to contents]](#Contents)
## WindowAttribute
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

32
vdocs/arrays.parallel.md Normal file
View File

@@ -0,0 +1,32 @@
# module arrays.parallel
## Contents
- [amap](#amap)
- [run](#run)
- [Params](#Params)
## amap
Example
```v
squares := parallel.amap([1, 2, 3, 4, 5], 2, fn (i) { return i * i })
```
[[Return to contents]](#Contents)
## run
Example
```v
parallel.run([1, 2, 3, 4, 5], 2, fn (i) { println(i) })
```
[[Return to contents]](#Contents)
## Params
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

124
vdocs/benchmark.md Normal file
View File

@@ -0,0 +1,124 @@
# module benchmark
## Contents
- [Constants](#Constants)
- [new_benchmark](#new_benchmark)
- [new_benchmark_no_cstep](#new_benchmark_no_cstep)
- [new_benchmark_pointer](#new_benchmark_pointer)
- [start](#start)
- [Benchmark](#Benchmark)
- [set_total_expected_steps](#set_total_expected_steps)
- [stop](#stop)
- [step](#step)
- [step_restart](#step_restart)
- [fail](#fail)
- [ok](#ok)
- [skip](#skip)
- [fail_many](#fail_many)
- [ok_many](#ok_many)
- [neither_fail_nor_ok](#neither_fail_nor_ok)
- [measure](#measure)
- [record_measure](#record_measure)
- [step_message_with_label_and_duration](#step_message_with_label_and_duration)
- [step_message_with_label](#step_message_with_label)
- [step_message](#step_message)
- [step_message_ok](#step_message_ok)
- [step_message_fail](#step_message_fail)
- [step_message_skip](#step_message_skip)
- [total_message](#total_message)
- [all_recorded_measures](#all_recorded_measures)
- [total_duration](#total_duration)
- [MessageOptions](#MessageOptions)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## new_benchmark
[[Return to contents]](#Contents)
## new_benchmark_no_cstep
[[Return to contents]](#Contents)
## new_benchmark_pointer
[[Return to contents]](#Contents)
## start
[[Return to contents]](#Contents)
## Benchmark
[[Return to contents]](#Contents)
## set_total_expected_steps
[[Return to contents]](#Contents)
## stop
[[Return to contents]](#Contents)
## step
[[Return to contents]](#Contents)
## step_restart
[[Return to contents]](#Contents)
## fail
[[Return to contents]](#Contents)
## ok
[[Return to contents]](#Contents)
## skip
[[Return to contents]](#Contents)
## fail_many
[[Return to contents]](#Contents)
## ok_many
[[Return to contents]](#Contents)
## neither_fail_nor_ok
[[Return to contents]](#Contents)
## measure
[[Return to contents]](#Contents)
## record_measure
[[Return to contents]](#Contents)
## step_message_with_label_and_duration
[[Return to contents]](#Contents)
## step_message_with_label
[[Return to contents]](#Contents)
## step_message
[[Return to contents]](#Contents)
## step_message_ok
[[Return to contents]](#Contents)
## step_message_fail
[[Return to contents]](#Contents)
## step_message_skip
[[Return to contents]](#Contents)
## total_message
[[Return to contents]](#Contents)
## all_recorded_measures
[[Return to contents]](#Contents)
## total_duration
[[Return to contents]](#Contents)
## MessageOptions
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

201
vdocs/bitfield.md Normal file
View File

@@ -0,0 +1,201 @@
# module bitfield
## Contents
- [bf_and](#bf_and)
- [bf_not](#bf_not)
- [bf_or](#bf_or)
- [bf_xor](#bf_xor)
- [from_bytes](#from_bytes)
- [from_bytes_lowest_bits_first](#from_bytes_lowest_bits_first)
- [from_str](#from_str)
- [hamming](#hamming)
- [join](#join)
- [new](#new)
- [BitField](#BitField)
- [str](#str)
- [free](#free)
- [get_bit](#get_bit)
- [set_bit](#set_bit)
- [clear_bit](#clear_bit)
- [extract](#extract)
- [insert](#insert)
- [extract_lowest_bits_first](#extract_lowest_bits_first)
- [insert_lowest_bits_first](#insert_lowest_bits_first)
- [set_all](#set_all)
- [clear_all](#clear_all)
- [toggle_bit](#toggle_bit)
- [set_if](#set_if)
- [toggle_bits](#toggle_bits)
- [set_bits](#set_bits)
- [clear_bits](#clear_bits)
- [has](#has)
- [all](#all)
- [get_size](#get_size)
- [clone](#clone)
- [==](#==)
- [pop_count](#pop_count)
- [pos](#pos)
- [slice](#slice)
- [reverse](#reverse)
- [resize](#resize)
- [rotate](#rotate)
- [shift_left](#shift_left)
- [shift_right](#shift_right)
## bf_and
[[Return to contents]](#Contents)
## bf_not
[[Return to contents]](#Contents)
## bf_or
[[Return to contents]](#Contents)
## bf_xor
[[Return to contents]](#Contents)
## from_bytes
[[Return to contents]](#Contents)
## from_bytes_lowest_bits_first
[[Return to contents]](#Contents)
## from_str
[[Return to contents]](#Contents)
## hamming
[[Return to contents]](#Contents)
## join
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## BitField
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## get_bit
[[Return to contents]](#Contents)
## set_bit
[[Return to contents]](#Contents)
## clear_bit
[[Return to contents]](#Contents)
## extract
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## extract_lowest_bits_first
[[Return to contents]](#Contents)
## insert_lowest_bits_first
[[Return to contents]](#Contents)
## set_all
[[Return to contents]](#Contents)
## clear_all
[[Return to contents]](#Contents)
## toggle_bit
[[Return to contents]](#Contents)
## set_if
[[Return to contents]](#Contents)
## toggle_bits
Example
```v
toggle_bits(1,3,5,7)
```
[[Return to contents]](#Contents)
## set_bits
Example
```v
set_bits(1,3,5,7)
```
[[Return to contents]](#Contents)
## clear_bits
Example
```v
clear_bits(1,3,5,7)
```
[[Return to contents]](#Contents)
## has
Example
```v
has(1,3,5,7)
```
[[Return to contents]](#Contents)
## all
Example
```v
all(1,3,5,7)
```
[[Return to contents]](#Contents)
## get_size
[[Return to contents]](#Contents)
## clone
[[Return to contents]](#Contents)
## ==
[[Return to contents]](#Contents)
## pop_count
[[Return to contents]](#Contents)
## pos
[[Return to contents]](#Contents)
## slice
[[Return to contents]](#Contents)
## reverse
[[Return to contents]](#Contents)
## resize
[[Return to contents]](#Contents)
## rotate
[[Return to contents]](#Contents)
## shift_left
[[Return to contents]](#Contents)
## shift_right
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

2572
vdocs/builtin.md Normal file

File diff suppressed because it is too large Load Diff

61
vdocs/builtin.wchar.md Normal file
View File

@@ -0,0 +1,61 @@
# module builtin.wchar
## Contents
- [Constants](#Constants)
- [from_rune](#from_rune)
- [from_string](#from_string)
- [length_in_bytes](#length_in_bytes)
- [length_in_characters](#length_in_characters)
- [to_string](#to_string)
- [to_string2](#to_string2)
- [Character](#Character)
- [str](#str)
- [==](#==)
- [to_rune](#to_rune)
- [C.wchar_t](#C.wchar_t)
## Constants
[[Return to contents]](#Contents)
## from_rune
[[Return to contents]](#Contents)
## from_string
[[Return to contents]](#Contents)
## length_in_bytes
[[Return to contents]](#Contents)
## length_in_characters
Example
```v
assert unsafe { wchar.length_in_characters(wchar.from_string('abc')) } == 3
```
[[Return to contents]](#Contents)
## to_string
[[Return to contents]](#Contents)
## to_string2
[[Return to contents]](#Contents)
## Character
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## ==
[[Return to contents]](#Contents)
## to_rune
[[Return to contents]](#Contents)
## C.wchar_t
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

162
vdocs/cli.md Normal file
View File

@@ -0,0 +1,162 @@
# module cli
## Contents
- [print_help_for_command](#print_help_for_command)
- [print_manpage_for_command](#print_manpage_for_command)
- [FnCommandCallback](#FnCommandCallback)
- [str](#str)
- [[]Flag](#[]Flag)
- [get_all_found](#get_all_found)
- [get_bool](#get_bool)
- [get_int](#get_int)
- [get_ints](#get_ints)
- [get_float](#get_float)
- [get_floats](#get_floats)
- [get_string](#get_string)
- [get_strings](#get_strings)
- [FlagType](#FlagType)
- [Command](#Command)
- [add_command](#add_command)
- [add_commands](#add_commands)
- [add_flag](#add_flag)
- [add_flags](#add_flags)
- [execute_help](#execute_help)
- [execute_man](#execute_man)
- [full_name](#full_name)
- [help_message](#help_message)
- [is_root](#is_root)
- [manpage](#manpage)
- [parse](#parse)
- [root](#root)
- [setup](#setup)
- [str](#str)
- [version](#version)
- [CommandFlag](#CommandFlag)
- [Flag](#Flag)
- [get_bool](#get_bool)
- [get_int](#get_int)
- [get_ints](#get_ints)
- [get_float](#get_float)
- [get_floats](#get_floats)
- [get_string](#get_string)
- [get_strings](#get_strings)
- [parse](#parse)
## print_help_for_command
[[Return to contents]](#Contents)
## print_manpage_for_command
[[Return to contents]](#Contents)
## FnCommandCallback
## str
[[Return to contents]](#Contents)
## []Flag
## get_all_found
[[Return to contents]](#Contents)
## get_bool
[[Return to contents]](#Contents)
## get_int
[[Return to contents]](#Contents)
## get_ints
[[Return to contents]](#Contents)
## get_float
[[Return to contents]](#Contents)
## get_floats
[[Return to contents]](#Contents)
## get_string
[[Return to contents]](#Contents)
## get_strings
[[Return to contents]](#Contents)
## FlagType
[[Return to contents]](#Contents)
## Command
[[Return to contents]](#Contents)
## add_command
[[Return to contents]](#Contents)
## add_commands
[[Return to contents]](#Contents)
## add_flag
[[Return to contents]](#Contents)
## add_flags
[[Return to contents]](#Contents)
## execute_help
[[Return to contents]](#Contents)
## execute_man
[[Return to contents]](#Contents)
## full_name
[[Return to contents]](#Contents)
## help_message
[[Return to contents]](#Contents)
## is_root
[[Return to contents]](#Contents)
## manpage
[[Return to contents]](#Contents)
## parse
[[Return to contents]](#Contents)
## root
[[Return to contents]](#Contents)
## setup
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## version
[[Return to contents]](#Contents)
## CommandFlag
[[Return to contents]](#Contents)
## Flag
[[Return to contents]](#Contents)
## get_bool
[[Return to contents]](#Contents)
## get_int
[[Return to contents]](#Contents)
## get_ints
[[Return to contents]](#Contents)
## get_float
[[Return to contents]](#Contents)
## get_floats
[[Return to contents]](#Contents)
## get_string
[[Return to contents]](#Contents)
## get_strings
[[Return to contents]](#Contents)
## parse
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

42
vdocs/clipboard.dummy.md Normal file
View File

@@ -0,0 +1,42 @@
# module clipboard.dummy
## Contents
- [new_clipboard](#new_clipboard)
- [new_primary](#new_primary)
- [Clipboard](#Clipboard)
- [set_text](#set_text)
- [get_text](#get_text)
- [clear](#clear)
- [free](#free)
- [has_ownership](#has_ownership)
- [check_availability](#check_availability)
## new_clipboard
[[Return to contents]](#Contents)
## new_primary
[[Return to contents]](#Contents)
## Clipboard
[[Return to contents]](#Contents)
## set_text
[[Return to contents]](#Contents)
## get_text
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## has_ownership
[[Return to contents]](#Contents)
## check_availability
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

66
vdocs/clipboard.md Normal file
View File

@@ -0,0 +1,66 @@
# module clipboard
## Contents
- [new](#new)
- [new_primary](#new_primary)
- [Clipboard](#Clipboard)
- [check_availability](#check_availability)
- [check_ownership](#check_ownership)
- [clear](#clear)
- [clear_all](#clear_all)
- [copy](#copy)
- [destroy](#destroy)
- [free](#free)
- [get_text](#get_text)
- [has_ownership](#has_ownership)
- [is_available](#is_available)
- [paste](#paste)
- [set_text](#set_text)
## new
[[Return to contents]](#Contents)
## new_primary
[[Return to contents]](#Contents)
## Clipboard
[[Return to contents]](#Contents)
## check_availability
[[Return to contents]](#Contents)
## check_ownership
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## clear_all
[[Return to contents]](#Contents)
## copy
[[Return to contents]](#Contents)
## destroy
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## get_text
[[Return to contents]](#Contents)
## has_ownership
[[Return to contents]](#Contents)
## is_available
[[Return to contents]](#Contents)
## paste
[[Return to contents]](#Contents)
## set_text
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

62
vdocs/clipboard.x11.md Normal file
View File

@@ -0,0 +1,62 @@
# module clipboard.x11
## Contents
- [new_clipboard](#new_clipboard)
- [new_primary](#new_primary)
- [C.Display](#C.Display)
- [C.XDestroyWindowEvent](#C.XDestroyWindowEvent)
- [C.XSelectionClearEvent](#C.XSelectionClearEvent)
- [C.XSelectionEvent](#C.XSelectionEvent)
- [C.XSelectionRequestEvent](#C.XSelectionRequestEvent)
- [Clipboard](#Clipboard)
- [check_availability](#check_availability)
- [free](#free)
- [clear](#clear)
- [has_ownership](#has_ownership)
- [set_text](#set_text)
- [get_text](#get_text)
## new_clipboard
[[Return to contents]](#Contents)
## new_primary
[[Return to contents]](#Contents)
## C.Display
[[Return to contents]](#Contents)
## C.XDestroyWindowEvent
[[Return to contents]](#Contents)
## C.XSelectionClearEvent
[[Return to contents]](#Contents)
## C.XSelectionEvent
[[Return to contents]](#Contents)
## C.XSelectionRequestEvent
[[Return to contents]](#Contents)
## Clipboard
[[Return to contents]](#Contents)
## check_availability
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## has_ownership
[[Return to contents]](#Contents)
## set_text
[[Return to contents]](#Contents)
## get_text
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

28
vdocs/compress.deflate.md Normal file
View File

@@ -0,0 +1,28 @@
# module compress.deflate
## Contents
- [compress](#compress)
- [decompress](#decompress)
## compress
Example
```v
compressed := deflate.compress(b)!
```
[[Return to contents]](#Contents)
## decompress
Example
```v
decompressed := deflate.decompress(b)!
```
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

66
vdocs/compress.gzip.md Normal file
View File

@@ -0,0 +1,66 @@
# module compress.gzip
## Contents
- [Constants](#Constants)
- [compress](#compress)
- [decompress](#decompress)
- [validate](#validate)
- [CompressFlags](#CompressFlags)
- [DecompressFlags](#DecompressFlags)
- [CompressParams](#CompressParams)
- [DecompressParams](#DecompressParams)
- [GzipHeader](#GzipHeader)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## compress
Example
```v
compressed := gzip.compress(b, compression_level:4095)!
```
[[Return to contents]](#Contents)
## decompress
Example
```v
decompressed := gzip.decompress(b)!
```
[[Return to contents]](#Contents)
## validate
[[Return to contents]](#Contents)
## CompressFlags
[[Return to contents]](#Contents)
## DecompressFlags
[[Return to contents]](#Contents)
## CompressParams
[[Return to contents]](#Contents)
## DecompressParams
[[Return to contents]](#Contents)
## GzipHeader
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

18
vdocs/compress.md Normal file
View File

@@ -0,0 +1,18 @@
# module compress
## Contents
- [Constants](#Constants)
- [compress](#compress)
- [decompress](#decompress)
## Constants
[[Return to contents]](#Contents)
## compress
[[Return to contents]](#Contents)
## decompress
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

106
vdocs/compress.szip.md Normal file
View File

@@ -0,0 +1,106 @@
# module compress.szip
## Contents
- [extract_zip_to_dir](#extract_zip_to_dir)
- [open](#open)
- [zip_files](#zip_files)
- [zip_folder](#zip_folder)
- [Fn_on_extract_entry](#Fn_on_extract_entry)
- [Zip](#Zip)
- [close](#close)
- [open_entry](#open_entry)
- [open_entry_by_index](#open_entry_by_index)
- [close_entry](#close_entry)
- [name](#name)
- [index](#index)
- [is_dir](#is_dir)
- [size](#size)
- [crc32](#crc32)
- [write_entry](#write_entry)
- [create_entry](#create_entry)
- [read_entry](#read_entry)
- [read_entry_buf](#read_entry_buf)
- [extract_entry](#extract_entry)
- [total](#total)
- [CompressionLevel](#CompressionLevel)
- [OpenMode](#OpenMode)
- [C.zip_t](#C.zip_t)
- [ZipFolderOptions](#ZipFolderOptions)
## extract_zip_to_dir
[[Return to contents]](#Contents)
## open
[[Return to contents]](#Contents)
## zip_files
[[Return to contents]](#Contents)
## zip_folder
[[Return to contents]](#Contents)
## Fn_on_extract_entry
[[Return to contents]](#Contents)
## Zip
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## open_entry
[[Return to contents]](#Contents)
## open_entry_by_index
[[Return to contents]](#Contents)
## close_entry
[[Return to contents]](#Contents)
## name
[[Return to contents]](#Contents)
## index
[[Return to contents]](#Contents)
## is_dir
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## crc32
[[Return to contents]](#Contents)
## write_entry
[[Return to contents]](#Contents)
## create_entry
[[Return to contents]](#Contents)
## read_entry
[[Return to contents]](#Contents)
## read_entry_buf
[[Return to contents]](#Contents)
## extract_entry
[[Return to contents]](#Contents)
## total
[[Return to contents]](#Contents)
## CompressionLevel
[[Return to contents]](#Contents)
## OpenMode
[[Return to contents]](#Contents)
## C.zip_t
[[Return to contents]](#Contents)
## ZipFolderOptions
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

28
vdocs/compress.zlib.md Normal file
View File

@@ -0,0 +1,28 @@
# module compress.zlib
## Contents
- [compress](#compress)
- [decompress](#decompress)
## compress
Example
```v
compressed := zlib.compress(b)!
```
[[Return to contents]](#Contents)
## decompress
Example
```v
decompressed := zlib.decompress(b)!
```
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

148
vdocs/compress.zstd.md Normal file
View File

@@ -0,0 +1,148 @@
# module compress.zstd
## Contents
- [check_zstd](#check_zstd)
- [compress](#compress)
- [decompress](#decompress)
- [default_c_level](#default_c_level)
- [get_error_name](#get_error_name)
- [is_error](#is_error)
- [load_array](#load_array)
- [max_c_level](#max_c_level)
- [min_c_level](#min_c_level)
- [new_cctx](#new_cctx)
- [new_dctx](#new_dctx)
- [store_array](#store_array)
- [version_number](#version_number)
- [version_string](#version_string)
- [ZSTD_CCtx](#ZSTD_CCtx)
- [set_parameter](#set_parameter)
- [compress_stream2](#compress_stream2)
- [free_cctx](#free_cctx)
- [ZSTD_DCtx](#ZSTD_DCtx)
- [set_parameter](#set_parameter)
- [decompress_stream](#decompress_stream)
- [free_dctx](#free_dctx)
- [ZSTD_EndDirective](#ZSTD_EndDirective)
- [ZSTD_ResetDirective](#ZSTD_ResetDirective)
- [ZSTD_cParameter](#ZSTD_cParameter)
- [ZSTD_dParameter](#ZSTD_dParameter)
- [ZSTD_strategy](#ZSTD_strategy)
- [CompressParams](#CompressParams)
- [DecompressParams](#DecompressParams)
- [ZSTD_bounds](#ZSTD_bounds)
- [ZSTD_inBuffer](#ZSTD_inBuffer)
- [ZSTD_outBuffer](#ZSTD_outBuffer)
## check_zstd
[[Return to contents]](#Contents)
## compress
Example
```v
compressed := zstd.compress(b)!
```
[[Return to contents]](#Contents)
## decompress
Example
```v
decompressed := zstd.decompress(b)!
```
[[Return to contents]](#Contents)
## default_c_level
[[Return to contents]](#Contents)
## get_error_name
[[Return to contents]](#Contents)
## is_error
[[Return to contents]](#Contents)
## load_array
[[Return to contents]](#Contents)
## max_c_level
[[Return to contents]](#Contents)
## min_c_level
[[Return to contents]](#Contents)
## new_cctx
[[Return to contents]](#Contents)
## new_dctx
[[Return to contents]](#Contents)
## store_array
[[Return to contents]](#Contents)
## version_number
[[Return to contents]](#Contents)
## version_string
[[Return to contents]](#Contents)
## ZSTD_CCtx
[[Return to contents]](#Contents)
## set_parameter
[[Return to contents]](#Contents)
## compress_stream2
[[Return to contents]](#Contents)
## free_cctx
[[Return to contents]](#Contents)
## ZSTD_DCtx
[[Return to contents]](#Contents)
## set_parameter
[[Return to contents]](#Contents)
## decompress_stream
[[Return to contents]](#Contents)
## free_dctx
[[Return to contents]](#Contents)
## ZSTD_EndDirective
[[Return to contents]](#Contents)
## ZSTD_ResetDirective
[[Return to contents]](#Contents)
## ZSTD_cParameter
[[Return to contents]](#Contents)
## ZSTD_dParameter
[[Return to contents]](#Contents)
## ZSTD_strategy
[[Return to contents]](#Contents)
## CompressParams
[[Return to contents]](#Contents)
## DecompressParams
[[Return to contents]](#Contents)
## ZSTD_bounds
[[Return to contents]](#Contents)
## ZSTD_inBuffer
[[Return to contents]](#Contents)
## ZSTD_outBuffer
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

166
vdocs/context.md Normal file
View File

@@ -0,0 +1,166 @@
# module context
## Contents
- [background](#background)
- [todo](#todo)
- [with_cancel](#with_cancel)
- [with_deadline](#with_deadline)
- [with_timeout](#with_timeout)
- [with_value](#with_value)
- [Any](#Any)
- [Canceler](#Canceler)
- [Context](#Context)
- [str](#str)
- [BackgroundContext](#BackgroundContext)
- [str](#str)
- [CancelFn](#CancelFn)
- [Key](#Key)
- [TodoContext](#TodoContext)
- [str](#str)
- [CancelContext](#CancelContext)
- [deadline](#deadline)
- [done](#done)
- [err](#err)
- [value](#value)
- [str](#str)
- [EmptyContext](#EmptyContext)
- [deadline](#deadline)
- [done](#done)
- [err](#err)
- [value](#value)
- [str](#str)
- [TimerContext](#TimerContext)
- [deadline](#deadline)
- [done](#done)
- [err](#err)
- [value](#value)
- [cancel](#cancel)
- [str](#str)
- [ValueContext](#ValueContext)
- [deadline](#deadline)
- [done](#done)
- [err](#err)
- [value](#value)
- [str](#str)
## background
[[Return to contents]](#Contents)
## todo
[[Return to contents]](#Contents)
## with_cancel
[[Return to contents]](#Contents)
## with_deadline
[[Return to contents]](#Contents)
## with_timeout
[[Return to contents]](#Contents)
## with_value
[[Return to contents]](#Contents)
## Any
[[Return to contents]](#Contents)
## Canceler
[[Return to contents]](#Contents)
## Context
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## BackgroundContext
## str
[[Return to contents]](#Contents)
## CancelFn
[[Return to contents]](#Contents)
## Key
[[Return to contents]](#Contents)
## TodoContext
## str
[[Return to contents]](#Contents)
## CancelContext
[[Return to contents]](#Contents)
## deadline
[[Return to contents]](#Contents)
## done
[[Return to contents]](#Contents)
## err
[[Return to contents]](#Contents)
## value
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## EmptyContext
[[Return to contents]](#Contents)
## deadline
[[Return to contents]](#Contents)
## done
[[Return to contents]](#Contents)
## err
[[Return to contents]](#Contents)
## value
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## TimerContext
[[Return to contents]](#Contents)
## deadline
[[Return to contents]](#Contents)
## done
[[Return to contents]](#Contents)
## err
[[Return to contents]](#Contents)
## value
[[Return to contents]](#Contents)
## cancel
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## ValueContext
[[Return to contents]](#Contents)
## deadline
[[Return to contents]](#Contents)
## done
[[Return to contents]](#Contents)
## err
[[Return to contents]](#Contents)
## value
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

View File

@@ -0,0 +1,52 @@
# module context.onecontext
## Contents
- [Constants](#Constants)
- [merge](#merge)
- [OneContext](#OneContext)
- [deadline](#deadline)
- [done](#done)
- [err](#err)
- [value](#value)
- [run](#run)
- [str](#str)
- [cancel](#cancel)
- [run_two_contexts](#run_two_contexts)
- [run_multiple_contexts](#run_multiple_contexts)
## Constants
[[Return to contents]](#Contents)
## merge
[[Return to contents]](#Contents)
## OneContext
## deadline
[[Return to contents]](#Contents)
## done
[[Return to contents]](#Contents)
## err
[[Return to contents]](#Contents)
## value
[[Return to contents]](#Contents)
## run
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## cancel
[[Return to contents]](#Contents)
## run_two_contexts
[[Return to contents]](#Contents)
## run_multiple_contexts
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

10
vdocs/coroutines.md Normal file
View File

@@ -0,0 +1,10 @@
# module coroutines
## Contents
- [sleep](#sleep)
## sleep
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

32
vdocs/crypto.aes.md Normal file
View File

@@ -0,0 +1,32 @@
# module crypto.aes
## Contents
- [Constants](#Constants)
- [new_cipher](#new_cipher)
- [AesCipher](#AesCipher)
- [free](#free)
- [block_size](#block_size)
- [encrypt](#encrypt)
- [decrypt](#decrypt)
## Constants
[[Return to contents]](#Contents)
## new_cipher
[[Return to contents]](#Contents)
## AesCipher
## free
[[Return to contents]](#Contents)
## block_size
[[Return to contents]](#Contents)
## encrypt
[[Return to contents]](#Contents)
## decrypt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

48
vdocs/crypto.bcrypt.md Normal file
View File

@@ -0,0 +1,48 @@
# module crypto.bcrypt
## Contents
- [Constants](#Constants)
- [compare_hash_and_password](#compare_hash_and_password)
- [generate_from_password](#generate_from_password)
- [generate_salt](#generate_salt)
- [Hashed](#Hashed)
- [free](#free)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## compare_hash_and_password
[[Return to contents]](#Contents)
## generate_from_password
[[Return to contents]](#Contents)
## generate_salt
[[Return to contents]](#Contents)
## Hashed
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

100
vdocs/crypto.blake2b.md Normal file
View File

@@ -0,0 +1,100 @@
# module crypto.blake2b
## Contents
- [Constants](#Constants)
- [new160](#new160)
- [new256](#new256)
- [new384](#new384)
- [new512](#new512)
- [new_digest](#new_digest)
- [new_pmac160](#new_pmac160)
- [new_pmac256](#new_pmac256)
- [new_pmac384](#new_pmac384)
- [new_pmac512](#new_pmac512)
- [pmac160](#pmac160)
- [pmac256](#pmac256)
- [pmac384](#pmac384)
- [pmac512](#pmac512)
- [sum160](#sum160)
- [sum256](#sum256)
- [sum384](#sum384)
- [sum512](#sum512)
- [Digest](#Digest)
- [str](#str)
- [write](#write)
- [checksum](#checksum)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## new160
[[Return to contents]](#Contents)
## new256
[[Return to contents]](#Contents)
## new384
[[Return to contents]](#Contents)
## new512
[[Return to contents]](#Contents)
## new_digest
[[Return to contents]](#Contents)
## new_pmac160
[[Return to contents]](#Contents)
## new_pmac256
[[Return to contents]](#Contents)
## new_pmac384
[[Return to contents]](#Contents)
## new_pmac512
[[Return to contents]](#Contents)
## pmac160
[[Return to contents]](#Contents)
## pmac256
[[Return to contents]](#Contents)
## pmac384
[[Return to contents]](#Contents)
## pmac512
[[Return to contents]](#Contents)
## sum160
[[Return to contents]](#Contents)
## sum256
[[Return to contents]](#Contents)
## sum384
[[Return to contents]](#Contents)
## sum512
[[Return to contents]](#Contents)
## Digest
## str
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## checksum
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

100
vdocs/crypto.blake2s.md Normal file
View File

@@ -0,0 +1,100 @@
# module crypto.blake2s
## Contents
- [Constants](#Constants)
- [new128](#new128)
- [new160](#new160)
- [new224](#new224)
- [new256](#new256)
- [new_digest](#new_digest)
- [new_pmac128](#new_pmac128)
- [new_pmac160](#new_pmac160)
- [new_pmac224](#new_pmac224)
- [new_pmac256](#new_pmac256)
- [pmac128](#pmac128)
- [pmac160](#pmac160)
- [pmac224](#pmac224)
- [pmac256](#pmac256)
- [sum128](#sum128)
- [sum160](#sum160)
- [sum224](#sum224)
- [sum256](#sum256)
- [Digest](#Digest)
- [str](#str)
- [write](#write)
- [checksum](#checksum)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## new128
[[Return to contents]](#Contents)
## new160
[[Return to contents]](#Contents)
## new224
[[Return to contents]](#Contents)
## new256
[[Return to contents]](#Contents)
## new_digest
[[Return to contents]](#Contents)
## new_pmac128
[[Return to contents]](#Contents)
## new_pmac160
[[Return to contents]](#Contents)
## new_pmac224
[[Return to contents]](#Contents)
## new_pmac256
[[Return to contents]](#Contents)
## pmac128
[[Return to contents]](#Contents)
## pmac160
[[Return to contents]](#Contents)
## pmac224
[[Return to contents]](#Contents)
## pmac256
[[Return to contents]](#Contents)
## sum128
[[Return to contents]](#Contents)
## sum160
[[Return to contents]](#Contents)
## sum224
[[Return to contents]](#Contents)
## sum256
[[Return to contents]](#Contents)
## Digest
## str
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## checksum
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

50
vdocs/crypto.blake3.md Normal file
View File

@@ -0,0 +1,50 @@
# module crypto.blake3
## Contents
- [Constants](#Constants)
- [sum256](#sum256)
- [sum_derive_key256](#sum_derive_key256)
- [sum_keyed256](#sum_keyed256)
- [Digest.new_derive_key_hash](#Digest.new_derive_key_hash)
- [Digest.new_hash](#Digest.new_hash)
- [Digest.new_keyed_hash](#Digest.new_keyed_hash)
- [Digest](#Digest)
- [write](#write)
- [checksum](#checksum)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## sum256
[[Return to contents]](#Contents)
## sum_derive_key256
[[Return to contents]](#Contents)
## sum_keyed256
[[Return to contents]](#Contents)
## Digest.new_derive_key_hash
[[Return to contents]](#Contents)
## Digest.new_hash
[[Return to contents]](#Contents)
## Digest.new_keyed_hash
[[Return to contents]](#Contents)
## Digest
## write
[[Return to contents]](#Contents)
## checksum
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

36
vdocs/crypto.blowfish.md Normal file
View File

@@ -0,0 +1,36 @@
# module crypto.blowfish
## Contents
- [Constants](#Constants)
- [expand_key](#expand_key)
- [expand_key_with_salt](#expand_key_with_salt)
- [new_cipher](#new_cipher)
- [new_salted_cipher](#new_salted_cipher)
- [Blowfish](#Blowfish)
- [encrypt](#encrypt)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## expand_key
[[Return to contents]](#Contents)
## expand_key_with_salt
[[Return to contents]](#Contents)
## new_cipher
[[Return to contents]](#Contents)
## new_salted_cipher
[[Return to contents]](#Contents)
## Blowfish
[[Return to contents]](#Contents)
## encrypt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

90
vdocs/crypto.cipher.md Normal file
View File

@@ -0,0 +1,90 @@
# module crypto.cipher
## Contents
- [new_cbc](#new_cbc)
- [new_cfb_decrypter](#new_cfb_decrypter)
- [new_cfb_encrypter](#new_cfb_encrypter)
- [new_ctr](#new_ctr)
- [new_ofb](#new_ofb)
- [safe_xor_bytes](#safe_xor_bytes)
- [xor_bytes](#xor_bytes)
- [xor_words](#xor_words)
- [Block](#Block)
- [BlockMode](#BlockMode)
- [Stream](#Stream)
- [Cbc](#Cbc)
- [free](#free)
- [encrypt_blocks](#encrypt_blocks)
- [decrypt_blocks](#decrypt_blocks)
- [Cfb](#Cfb)
- [free](#free)
- [xor_key_stream](#xor_key_stream)
- [Ctr](#Ctr)
- [free](#free)
- [xor_key_stream](#xor_key_stream)
- [Ofb](#Ofb)
- [xor_key_stream](#xor_key_stream)
## new_cbc
[[Return to contents]](#Contents)
## new_cfb_decrypter
[[Return to contents]](#Contents)
## new_cfb_encrypter
[[Return to contents]](#Contents)
## new_ctr
[[Return to contents]](#Contents)
## new_ofb
[[Return to contents]](#Contents)
## safe_xor_bytes
[[Return to contents]](#Contents)
## xor_bytes
[[Return to contents]](#Contents)
## xor_words
[[Return to contents]](#Contents)
## Block
[[Return to contents]](#Contents)
## BlockMode
[[Return to contents]](#Contents)
## Stream
[[Return to contents]](#Contents)
## Cbc
## free
[[Return to contents]](#Contents)
## encrypt_blocks
[[Return to contents]](#Contents)
## decrypt_blocks
[[Return to contents]](#Contents)
## Cfb
## free
[[Return to contents]](#Contents)
## xor_key_stream
[[Return to contents]](#Contents)
## Ctr
## free
[[Return to contents]](#Contents)
## xor_key_stream
[[Return to contents]](#Contents)
## Ofb
## xor_key_stream
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

38
vdocs/crypto.des.md Normal file
View File

@@ -0,0 +1,38 @@
# module crypto.des
## Contents
- [encrypt_block](#encrypt_block)
- [new_cipher](#new_cipher)
- [new_triple_des_cipher](#new_triple_des_cipher)
- [DesCipher](#DesCipher)
- [encrypt](#encrypt)
- [decrypt](#decrypt)
- [TripleDesCipher](#TripleDesCipher)
- [encrypt](#encrypt)
- [decrypt](#decrypt)
## encrypt_block
[[Return to contents]](#Contents)
## new_cipher
[[Return to contents]](#Contents)
## new_triple_des_cipher
[[Return to contents]](#Contents)
## DesCipher
## encrypt
[[Return to contents]](#Contents)
## decrypt
[[Return to contents]](#Contents)
## TripleDesCipher
## encrypt
[[Return to contents]](#Contents)
## decrypt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

102
vdocs/crypto.ecdsa.md Normal file
View File

@@ -0,0 +1,102 @@
# module crypto.ecdsa
## Contents
- [generate_key](#generate_key)
- [new_key_from_seed](#new_key_from_seed)
- [privkey_from_string](#privkey_from_string)
- [pubkey_from_bytes](#pubkey_from_bytes)
- [pubkey_from_string](#pubkey_from_string)
- [PrivateKey.new](#PrivateKey.new)
- [HashConfig](#HashConfig)
- [Nid](#Nid)
- [C.BIO](#C.BIO)
- [CurveOptions](#CurveOptions)
- [PrivateKey](#PrivateKey)
- [sign](#sign)
- [sign_with_options](#sign_with_options)
- [bytes](#bytes)
- [seed](#seed)
- [public_key](#public_key)
- [equal](#equal)
- [free](#free)
- [PublicKey](#PublicKey)
- [bytes](#bytes)
- [equal](#equal)
- [free](#free)
- [verify](#verify)
- [SignerOpts](#SignerOpts)
## generate_key
[[Return to contents]](#Contents)
## new_key_from_seed
[[Return to contents]](#Contents)
## privkey_from_string
[[Return to contents]](#Contents)
## pubkey_from_bytes
[[Return to contents]](#Contents)
## pubkey_from_string
[[Return to contents]](#Contents)
## PrivateKey.new
[[Return to contents]](#Contents)
## HashConfig
[[Return to contents]](#Contents)
## Nid
[[Return to contents]](#Contents)
## C.BIO
[[Return to contents]](#Contents)
## CurveOptions
[[Return to contents]](#Contents)
## PrivateKey
[[Return to contents]](#Contents)
## sign
[[Return to contents]](#Contents)
## sign_with_options
[[Return to contents]](#Contents)
## bytes
[[Return to contents]](#Contents)
## seed
[[Return to contents]](#Contents)
## public_key
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## PublicKey
[[Return to contents]](#Contents)
## bytes
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## verify
[[Return to contents]](#Contents)
## SignerOpts
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

View File

@@ -0,0 +1,224 @@
# module crypto.ed25519.internal.edwards25519
## Contents
- [Constants](#Constants)
- [new_generator_point](#new_generator_point)
- [new_identity_point](#new_identity_point)
- [new_scalar](#new_scalar)
- [Scalar](#Scalar)
- [add](#add)
- [bytes](#bytes)
- [equal](#equal)
- [invert](#invert)
- [multiply](#multiply)
- [multiply_add](#multiply_add)
- [negate](#negate)
- [non_adjacent_form](#non_adjacent_form)
- [set](#set)
- [set_bytes_with_clamping](#set_bytes_with_clamping)
- [set_canonical_bytes](#set_canonical_bytes)
- [set_uniform_bytes](#set_uniform_bytes)
- [subtract](#subtract)
- [Element](#Element)
- [zero](#zero)
- [one](#one)
- [reduce](#reduce)
- [add](#add)
- [subtract](#subtract)
- [negate](#negate)
- [invert](#invert)
- [square](#square)
- [multiply](#multiply)
- [pow_22523](#pow_22523)
- [sqrt_ratio](#sqrt_ratio)
- [selected](#selected)
- [is_negative](#is_negative)
- [absolute](#absolute)
- [set](#set)
- [set_bytes](#set_bytes)
- [bytes](#bytes)
- [equal](#equal)
- [swap](#swap)
- [mult_32](#mult_32)
- [Point](#Point)
- [add](#add)
- [bytes](#bytes)
- [bytes_montgomery](#bytes_montgomery)
- [equal](#equal)
- [mult_by_cofactor](#mult_by_cofactor)
- [multi_scalar_mult](#multi_scalar_mult)
- [negate](#negate)
- [scalar_base_mult](#scalar_base_mult)
- [scalar_mult](#scalar_mult)
- [set](#set)
- [set_bytes](#set_bytes)
- [subtract](#subtract)
- [vartime_double_scalar_base_mult](#vartime_double_scalar_base_mult)
- [vartime_multiscalar_mult](#vartime_multiscalar_mult)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## new_generator_point
[[Return to contents]](#Contents)
## new_identity_point
[[Return to contents]](#Contents)
## new_scalar
[[Return to contents]](#Contents)
## Scalar
## add
[[Return to contents]](#Contents)
## bytes
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## invert
[[Return to contents]](#Contents)
## multiply
[[Return to contents]](#Contents)
## multiply_add
[[Return to contents]](#Contents)
## negate
[[Return to contents]](#Contents)
## non_adjacent_form
[[Return to contents]](#Contents)
## set
[[Return to contents]](#Contents)
## set_bytes_with_clamping
[[Return to contents]](#Contents)
## set_canonical_bytes
[[Return to contents]](#Contents)
## set_uniform_bytes
[[Return to contents]](#Contents)
## subtract
[[Return to contents]](#Contents)
## Element
[[Return to contents]](#Contents)
## zero
[[Return to contents]](#Contents)
## one
[[Return to contents]](#Contents)
## reduce
[[Return to contents]](#Contents)
## add
[[Return to contents]](#Contents)
## subtract
[[Return to contents]](#Contents)
## negate
[[Return to contents]](#Contents)
## invert
[[Return to contents]](#Contents)
## square
[[Return to contents]](#Contents)
## multiply
[[Return to contents]](#Contents)
## pow_22523
[[Return to contents]](#Contents)
## sqrt_ratio
[[Return to contents]](#Contents)
## selected
[[Return to contents]](#Contents)
## is_negative
[[Return to contents]](#Contents)
## absolute
[[Return to contents]](#Contents)
## set
[[Return to contents]](#Contents)
## set_bytes
[[Return to contents]](#Contents)
## bytes
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## swap
[[Return to contents]](#Contents)
## mult_32
[[Return to contents]](#Contents)
## Point
[[Return to contents]](#Contents)
## add
[[Return to contents]](#Contents)
## bytes
[[Return to contents]](#Contents)
## bytes_montgomery
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## mult_by_cofactor
[[Return to contents]](#Contents)
## multi_scalar_mult
[[Return to contents]](#Contents)
## negate
[[Return to contents]](#Contents)
## scalar_base_mult
[[Return to contents]](#Contents)
## scalar_mult
[[Return to contents]](#Contents)
## set
[[Return to contents]](#Contents)
## set_bytes
[[Return to contents]](#Contents)
## subtract
[[Return to contents]](#Contents)
## vartime_double_scalar_base_mult
[[Return to contents]](#Contents)
## vartime_multiscalar_mult
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

60
vdocs/crypto.ed25519.md Normal file
View File

@@ -0,0 +1,60 @@
# module crypto.ed25519
## Contents
- [Constants](#Constants)
- [generate_key](#generate_key)
- [new_key_from_seed](#new_key_from_seed)
- [sign](#sign)
- [verify](#verify)
- [PrivateKey](#PrivateKey)
- [seed](#seed)
- [public_key](#public_key)
- [equal](#equal)
- [sign](#sign)
- [PublicKey](#PublicKey)
- [equal](#equal)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## generate_key
[[Return to contents]](#Contents)
## new_key_from_seed
[[Return to contents]](#Contents)
## sign
[[Return to contents]](#Contents)
## verify
[[Return to contents]](#Contents)
## PrivateKey
[[Return to contents]](#Contents)
## seed
[[Return to contents]](#Contents)
## public_key
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
## sign
[[Return to contents]](#Contents)
## PublicKey
[[Return to contents]](#Contents)
## equal
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

14
vdocs/crypto.hmac.md Normal file
View File

@@ -0,0 +1,14 @@
# module crypto.hmac
## Contents
- [equal](#equal)
- [new](#new)
## equal
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

View File

@@ -0,0 +1,38 @@
# module crypto.internal.subtle
## Contents
- [any_overlap](#any_overlap)
- [constant_time_byte_eq](#constant_time_byte_eq)
- [constant_time_compare](#constant_time_compare)
- [constant_time_copy](#constant_time_copy)
- [constant_time_eq](#constant_time_eq)
- [constant_time_less_or_eq](#constant_time_less_or_eq)
- [constant_time_select](#constant_time_select)
- [inexact_overlap](#inexact_overlap)
## any_overlap
[[Return to contents]](#Contents)
## constant_time_byte_eq
[[Return to contents]](#Contents)
## constant_time_compare
[[Return to contents]](#Contents)
## constant_time_copy
[[Return to contents]](#Contents)
## constant_time_eq
[[Return to contents]](#Contents)
## constant_time_less_or_eq
[[Return to contents]](#Contents)
## constant_time_select
[[Return to contents]](#Contents)
## inexact_overlap
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

10
vdocs/crypto.md Normal file
View File

@@ -0,0 +1,10 @@
# module crypto
## Contents
- [Hash](#Hash)
## Hash
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

57
vdocs/crypto.md5.md Normal file
View File

@@ -0,0 +1,57 @@
# module crypto.md5
## Contents
- [Constants](#Constants)
- [hexhash](#hexhash)
- [new](#new)
- [sum](#sum)
- [Digest](#Digest)
- [free](#free)
- [reset](#reset)
- [write](#write)
- [sum](#sum)
- [size](#size)
- [block_size](#block_size)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## hexhash
Example
```v
assert md5.hexhash('V') == '5206560a306a2e085a437fd258eb57ce'
```
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## Digest
## free
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## block_size
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

10
vdocs/crypto.pbkdf2.md Normal file
View File

@@ -0,0 +1,10 @@
# module crypto.pbkdf2
## Contents
- [key](#key)
## key
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

46
vdocs/crypto.pem.md Normal file
View File

@@ -0,0 +1,46 @@
# module crypto.pem
## Contents
- [decode](#decode)
- [decode_only](#decode_only)
- [Block.new](#Block.new)
- [Header](#Header)
- [str](#str)
- [Block](#Block)
- [encode](#encode)
- [free](#free)
- [header_by_key](#header_by_key)
- [EncodeConfig](#EncodeConfig)
## decode
[[Return to contents]](#Contents)
## decode_only
[[Return to contents]](#Contents)
## Block.new
[[Return to contents]](#Contents)
## Header
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## Block
[[Return to contents]](#Contents)
## encode
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## header_by_key
[[Return to contents]](#Contents)
## EncodeConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

28
vdocs/crypto.rand.md Normal file
View File

@@ -0,0 +1,28 @@
# module crypto.rand
## Contents
- [bytes](#bytes)
- [int_big](#int_big)
- [int_u64](#int_u64)
- [read](#read)
- [ReadError](#ReadError)
- [msg](#msg)
## bytes
[[Return to contents]](#Contents)
## int_big
[[Return to contents]](#Contents)
## int_u64
[[Return to contents]](#Contents)
## read
[[Return to contents]](#Contents)
## ReadError
## msg
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

24
vdocs/crypto.rc4.md Normal file
View File

@@ -0,0 +1,24 @@
# module crypto.rc4
## Contents
- [new_cipher](#new_cipher)
- [Cipher](#Cipher)
- [free](#free)
- [reset](#reset)
- [xor_key_stream](#xor_key_stream)
## new_cipher
[[Return to contents]](#Contents)
## Cipher
## free
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## xor_key_stream
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

16
vdocs/crypto.scrypt.md Normal file
View File

@@ -0,0 +1,16 @@
# module crypto.scrypt
## Contents
- [Constants](#Constants)
- [scrypt](#scrypt)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## scrypt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

50
vdocs/crypto.sha1.md Normal file
View File

@@ -0,0 +1,50 @@
# module crypto.sha1
## Contents
- [Constants](#Constants)
- [hexhash](#hexhash)
- [new](#new)
- [sum](#sum)
- [Digest](#Digest)
- [free](#free)
- [reset](#reset)
- [write](#write)
- [sum](#sum)
- [size](#size)
- [block_size](#block_size)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## hexhash
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## Digest
## free
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## block_size
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

82
vdocs/crypto.sha256.md Normal file
View File

@@ -0,0 +1,82 @@
# module crypto.sha256
## Contents
- [Constants](#Constants)
- [hexhash](#hexhash)
- [hexhash_224](#hexhash_224)
- [new](#new)
- [new224](#new224)
- [sum](#sum)
- [sum224](#sum224)
- [sum256](#sum256)
- [Digest](#Digest)
- [free](#free)
- [reset](#reset)
- [write](#write)
- [sum](#sum)
- [size](#size)
- [block_size](#block_size)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## hexhash
Example
```v
assert sha256.hexhash('V') == 'de5a6f78116eca62d7fc5ce159d23ae6b889b365a1739ad2cf36f925a140d0cc'
```
[[Return to contents]](#Contents)
## hexhash_224
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## new224
[[Return to contents]](#Contents)
## sum
Example
```v
assert sha256.sum('V'.bytes()).len > 0 == true
```
[[Return to contents]](#Contents)
## sum224
[[Return to contents]](#Contents)
## sum256
[[Return to contents]](#Contents)
## Digest
## free
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## block_size
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

118
vdocs/crypto.sha3.md Normal file
View File

@@ -0,0 +1,118 @@
# module crypto.sha3
## Contents
- [Constants](#Constants)
- [keccak256](#keccak256)
- [keccak512](#keccak512)
- [new128xof](#new128xof)
- [new224](#new224)
- [new256](#new256)
- [new256keccak](#new256keccak)
- [new256xof](#new256xof)
- [new384](#new384)
- [new512](#new512)
- [new512keccak](#new512keccak)
- [new_digest](#new_digest)
- [new_xof_digest](#new_xof_digest)
- [shake128](#shake128)
- [shake256](#shake256)
- [sum224](#sum224)
- [sum256](#sum256)
- [sum384](#sum384)
- [sum512](#sum512)
- [Digest](#Digest)
- [write](#write)
- [checksum](#checksum)
- [Padding](#Padding)
- [PaddingConfig](#PaddingConfig)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## keccak256
[[Return to contents]](#Contents)
## keccak512
[[Return to contents]](#Contents)
## new128xof
[[Return to contents]](#Contents)
## new224
[[Return to contents]](#Contents)
## new256
[[Return to contents]](#Contents)
## new256keccak
[[Return to contents]](#Contents)
## new256xof
[[Return to contents]](#Contents)
## new384
[[Return to contents]](#Contents)
## new512
[[Return to contents]](#Contents)
## new512keccak
[[Return to contents]](#Contents)
## new_digest
[[Return to contents]](#Contents)
## new_xof_digest
[[Return to contents]](#Contents)
## shake128
[[Return to contents]](#Contents)
## shake256
[[Return to contents]](#Contents)
## sum224
[[Return to contents]](#Contents)
## sum256
[[Return to contents]](#Contents)
## sum384
[[Return to contents]](#Contents)
## sum512
[[Return to contents]](#Contents)
## Digest
## write
[[Return to contents]](#Contents)
## checksum
[[Return to contents]](#Contents)
## Padding
[[Return to contents]](#Contents)
## PaddingConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

92
vdocs/crypto.sha512.md Normal file
View File

@@ -0,0 +1,92 @@
# module crypto.sha512
## Contents
- [Constants](#Constants)
- [hexhash](#hexhash)
- [hexhash_384](#hexhash_384)
- [hexhash_512_224](#hexhash_512_224)
- [hexhash_512_256](#hexhash_512_256)
- [new](#new)
- [new384](#new384)
- [new512_224](#new512_224)
- [new512_256](#new512_256)
- [sum384](#sum384)
- [sum512](#sum512)
- [sum512_224](#sum512_224)
- [sum512_256](#sum512_256)
- [Digest](#Digest)
- [free](#free)
- [reset](#reset)
- [write](#write)
- [sum](#sum)
- [size](#size)
- [block_size](#block_size)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## hexhash
[[Return to contents]](#Contents)
## hexhash_384
[[Return to contents]](#Contents)
## hexhash_512_224
[[Return to contents]](#Contents)
## hexhash_512_256
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## new384
[[Return to contents]](#Contents)
## new512_224
[[Return to contents]](#Contents)
## new512_256
[[Return to contents]](#Contents)
## sum384
[[Return to contents]](#Contents)
## sum512
[[Return to contents]](#Contents)
## sum512_224
[[Return to contents]](#Contents)
## sum512_256
[[Return to contents]](#Contents)
## Digest
## free
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## write
[[Return to contents]](#Contents)
## sum
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## block_size
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

42
vdocs/datatypes.fsm.md Normal file
View File

@@ -0,0 +1,42 @@
# module datatypes.fsm
## Contents
- [new](#new)
- [ConditionFn](#ConditionFn)
- [EventHandlerFn](#EventHandlerFn)
- [StateMachine](#StateMachine)
- [set_state](#set_state)
- [get_state](#get_state)
- [add_state](#add_state)
- [add_transition](#add_transition)
- [run](#run)
## new
[[Return to contents]](#Contents)
## ConditionFn
[[Return to contents]](#Contents)
## EventHandlerFn
[[Return to contents]](#Contents)
## StateMachine
[[Return to contents]](#Contents)
## set_state
[[Return to contents]](#Contents)
## get_state
[[Return to contents]](#Contents)
## add_state
[[Return to contents]](#Contents)
## add_transition
[[Return to contents]](#Contents)
## run
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

510
vdocs/datatypes.md Normal file
View File

@@ -0,0 +1,510 @@
# module datatypes
## Contents
- [new_bloom_filter](#new_bloom_filter)
- [new_bloom_filter_fast](#new_bloom_filter_fast)
- [new_ringbuffer](#new_ringbuffer)
- [BSTree[T]](#BSTree[T])
- [insert](#insert)
- [contains](#contains)
- [remove](#remove)
- [is_empty](#is_empty)
- [in_order_traversal](#in_order_traversal)
- [post_order_traversal](#post_order_traversal)
- [pre_order_traversal](#pre_order_traversal)
- [to_left](#to_left)
- [to_right](#to_right)
- [max](#max)
- [min](#min)
- [BloomFilter[T]](#BloomFilter[T])
- [add](#add)
- [exists](#exists)
- [@union](#@union)
- [intersection](#intersection)
- [DoublyLinkedList[T]](#DoublyLinkedList[T])
- [is_empty](#is_empty)
- [len](#len)
- [first](#first)
- [last](#last)
- [push_back](#push_back)
- [push_front](#push_front)
- [push_many](#push_many)
- [pop_back](#pop_back)
- [pop_front](#pop_front)
- [insert](#insert)
- [index](#index)
- [delete](#delete)
- [str](#str)
- [array](#array)
- [next](#next)
- [iterator](#iterator)
- [back_iterator](#back_iterator)
- [DoublyListIterBack[T]](#DoublyListIterBack[T])
- [next](#next)
- [DoublyListIter[T]](#DoublyListIter[T])
- [next](#next)
- [LinkedList[T]](#LinkedList[T])
- [is_empty](#is_empty)
- [len](#len)
- [first](#first)
- [last](#last)
- [index](#index)
- [push](#push)
- [push_many](#push_many)
- [pop](#pop)
- [shift](#shift)
- [insert](#insert)
- [prepend](#prepend)
- [str](#str)
- [array](#array)
- [next](#next)
- [iterator](#iterator)
- [ListIter[T]](#ListIter[T])
- [next](#next)
- [MinHeap[T]](#MinHeap[T])
- [insert](#insert)
- [insert_many](#insert_many)
- [pop](#pop)
- [peek](#peek)
- [len](#len)
- [Queue[T]](#Queue[T])
- [is_empty](#is_empty)
- [len](#len)
- [peek](#peek)
- [last](#last)
- [index](#index)
- [push](#push)
- [pop](#pop)
- [str](#str)
- [array](#array)
- [RingBuffer[T]](#RingBuffer[T])
- [push](#push)
- [pop](#pop)
- [push_many](#push_many)
- [pop_many](#pop_many)
- [is_empty](#is_empty)
- [is_full](#is_full)
- [capacity](#capacity)
- [clear](#clear)
- [occupied](#occupied)
- [remaining](#remaining)
- [Set[T]](#Set[T])
- [exists](#exists)
- [add](#add)
- [remove](#remove)
- [pick](#pick)
- [rest](#rest)
- [pop](#pop)
- [clear](#clear)
- [==](#==)
- [is_empty](#is_empty)
- [size](#size)
- [copy](#copy)
- [add_all](#add_all)
- [@union](#@union)
- [intersection](#intersection)
- [-](#-)
- [subset](#subset)
- [Stack[T]](#Stack[T])
- [is_empty](#is_empty)
- [len](#len)
- [peek](#peek)
- [push](#push)
- [pop](#pop)
- [str](#str)
- [array](#array)
- [Direction](#Direction)
- [AABB](#AABB)
- [BSTree](#BSTree)
- [DoublyLinkedList](#DoublyLinkedList)
- [DoublyListIter](#DoublyListIter)
- [DoublyListIterBack](#DoublyListIterBack)
- [LinkedList](#LinkedList)
- [ListIter](#ListIter)
- [ListNode](#ListNode)
- [MinHeap](#MinHeap)
- [Quadtree](#Quadtree)
- [create](#create)
- [insert](#insert)
- [retrieve](#retrieve)
- [clear](#clear)
- [get_nodes](#get_nodes)
- [Queue](#Queue)
- [RingBuffer](#RingBuffer)
- [Set](#Set)
- [Stack](#Stack)
## new_bloom_filter
[[Return to contents]](#Contents)
## new_bloom_filter_fast
[[Return to contents]](#Contents)
## new_ringbuffer
[[Return to contents]](#Contents)
## BSTree[T]
## insert
[[Return to contents]](#Contents)
## contains
[[Return to contents]](#Contents)
## remove
[[Return to contents]](#Contents)
## is_empty
[[Return to contents]](#Contents)
## in_order_traversal
[[Return to contents]](#Contents)
## post_order_traversal
[[Return to contents]](#Contents)
## pre_order_traversal
[[Return to contents]](#Contents)
## to_left
[[Return to contents]](#Contents)
## to_right
[[Return to contents]](#Contents)
## max
[[Return to contents]](#Contents)
## min
[[Return to contents]](#Contents)
## BloomFilter[T]
## add
[[Return to contents]](#Contents)
## exists
[[Return to contents]](#Contents)
## @union
[[Return to contents]](#Contents)
## intersection
[[Return to contents]](#Contents)
## DoublyLinkedList[T]
## is_empty
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## first
[[Return to contents]](#Contents)
## last
[[Return to contents]](#Contents)
## push_back
[[Return to contents]](#Contents)
## push_front
[[Return to contents]](#Contents)
## push_many
[[Return to contents]](#Contents)
## pop_back
[[Return to contents]](#Contents)
## pop_front
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## index
[[Return to contents]](#Contents)
## delete
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## array
[[Return to contents]](#Contents)
## next
[[Return to contents]](#Contents)
## iterator
[[Return to contents]](#Contents)
## back_iterator
[[Return to contents]](#Contents)
## DoublyListIterBack[T]
## next
[[Return to contents]](#Contents)
## DoublyListIter[T]
## next
[[Return to contents]](#Contents)
## LinkedList[T]
## is_empty
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## first
[[Return to contents]](#Contents)
## last
[[Return to contents]](#Contents)
## index
[[Return to contents]](#Contents)
## push
[[Return to contents]](#Contents)
## push_many
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## shift
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## prepend
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## array
[[Return to contents]](#Contents)
## next
[[Return to contents]](#Contents)
## iterator
[[Return to contents]](#Contents)
## ListIter[T]
## next
[[Return to contents]](#Contents)
## MinHeap[T]
## insert
[[Return to contents]](#Contents)
## insert_many
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## peek
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## Queue[T]
## is_empty
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## peek
[[Return to contents]](#Contents)
## last
[[Return to contents]](#Contents)
## index
[[Return to contents]](#Contents)
## push
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## array
[[Return to contents]](#Contents)
## RingBuffer[T]
## push
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## push_many
[[Return to contents]](#Contents)
## pop_many
[[Return to contents]](#Contents)
## is_empty
[[Return to contents]](#Contents)
## is_full
[[Return to contents]](#Contents)
## capacity
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## occupied
[[Return to contents]](#Contents)
## remaining
[[Return to contents]](#Contents)
## Set[T]
## exists
[[Return to contents]](#Contents)
## add
[[Return to contents]](#Contents)
## remove
[[Return to contents]](#Contents)
## pick
[[Return to contents]](#Contents)
## rest
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## ==
[[Return to contents]](#Contents)
## is_empty
[[Return to contents]](#Contents)
## size
[[Return to contents]](#Contents)
## copy
[[Return to contents]](#Contents)
## add_all
[[Return to contents]](#Contents)
## @union
[[Return to contents]](#Contents)
## intersection
[[Return to contents]](#Contents)
## -
[[Return to contents]](#Contents)
## subset
[[Return to contents]](#Contents)
## Stack[T]
## is_empty
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## peek
[[Return to contents]](#Contents)
## push
[[Return to contents]](#Contents)
## pop
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## array
[[Return to contents]](#Contents)
## Direction
[[Return to contents]](#Contents)
## AABB
[[Return to contents]](#Contents)
## BSTree
[[Return to contents]](#Contents)
## DoublyLinkedList
[[Return to contents]](#Contents)
## DoublyListIter
[[Return to contents]](#Contents)
## DoublyListIterBack
[[Return to contents]](#Contents)
## LinkedList
[[Return to contents]](#Contents)
## ListIter
[[Return to contents]](#Contents)
## ListNode
[[Return to contents]](#Contents)
## MinHeap
[[Return to contents]](#Contents)
## Quadtree
[[Return to contents]](#Contents)
## create
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## retrieve
[[Return to contents]](#Contents)
## clear
[[Return to contents]](#Contents)
## get_nodes
[[Return to contents]](#Contents)
## Queue
[[Return to contents]](#Contents)
## RingBuffer
[[Return to contents]](#Contents)
## Set
[[Return to contents]](#Contents)
## Stack
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

38
vdocs/db.mssql.md Normal file
View File

@@ -0,0 +1,38 @@
# module db.mssql
## Contents
- [Config](#Config)
- [get_conn_str](#get_conn_str)
- [Connection](#Connection)
- [connect](#connect)
- [close](#close)
- [query](#query)
- [Result](#Result)
- [Row](#Row)
## Config
[[Return to contents]](#Contents)
## get_conn_str
[[Return to contents]](#Contents)
## Connection
[[Return to contents]](#Contents)
## connect
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## query
[[Return to contents]](#Contents)
## Result
[[Return to contents]](#Contents)
## Row
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

400
vdocs/db.mysql.md Normal file
View File

@@ -0,0 +1,400 @@
# module db.mysql
## Contents
- [Constants](#Constants)
- [connect](#connect)
- [debug](#debug)
- [get_client_info](#get_client_info)
- [get_client_version](#get_client_version)
- [ConnectionFlag](#ConnectionFlag)
- [FieldType](#FieldType)
- [str](#str)
- [get_len](#get_len)
- [C.MYSQL](#C.MYSQL)
- [C.MYSQL_BIND](#C.MYSQL_BIND)
- [C.MYSQL_FIELD](#C.MYSQL_FIELD)
- [C.MYSQL_RES](#C.MYSQL_RES)
- [C.MYSQL_STMT](#C.MYSQL_STMT)
- [Config](#Config)
- [DB](#DB)
- [affected_rows](#affected_rows)
- [autocommit](#autocommit)
- [change_user](#change_user)
- [close](#close)
- [commit](#commit)
- [create](#create)
- [delete](#delete)
- [drop](#drop)
- [dump_debug_info](#dump_debug_info)
- [escape_string](#escape_string)
- [exec](#exec)
- [exec_none](#exec_none)
- [exec_one](#exec_one)
- [exec_param](#exec_param)
- [exec_param_many](#exec_param_many)
- [get_host_info](#get_host_info)
- [get_option](#get_option)
- [get_server_info](#get_server_info)
- [get_server_version](#get_server_version)
- [info](#info)
- [init_stmt](#init_stmt)
- [insert](#insert)
- [last_id](#last_id)
- [ping](#ping)
- [prepare](#prepare)
- [query](#query)
- [real_query](#real_query)
- [refresh](#refresh)
- [reset](#reset)
- [select](#select)
- [select_db](#select_db)
- [set_option](#set_option)
- [tables](#tables)
- [update](#update)
- [use_result](#use_result)
- [Field](#Field)
- [str](#str)
- [Result](#Result)
- [fetch_row](#fetch_row)
- [n_rows](#n_rows)
- [n_fields](#n_fields)
- [rows](#rows)
- [maps](#maps)
- [fields](#fields)
- [free](#free)
- [Row](#Row)
- [Stmt](#Stmt)
- [str](#str)
- [prepare](#prepare)
- [bind_params](#bind_params)
- [execute](#execute)
- [next](#next)
- [gen_metadata](#gen_metadata)
- [fetch_fields](#fetch_fields)
- [fetch_stmt](#fetch_stmt)
- [close](#close)
- [error](#error)
- [bind_bool](#bind_bool)
- [bind_byte](#bind_byte)
- [bind_u8](#bind_u8)
- [bind_i8](#bind_i8)
- [bind_i16](#bind_i16)
- [bind_u16](#bind_u16)
- [bind_int](#bind_int)
- [bind_u32](#bind_u32)
- [bind_i64](#bind_i64)
- [bind_u64](#bind_u64)
- [bind_f32](#bind_f32)
- [bind_f64](#bind_f64)
- [bind_text](#bind_text)
- [bind_null](#bind_null)
- [bind](#bind)
- [bind_res](#bind_res)
- [bind_result_buffer](#bind_result_buffer)
- [store_result](#store_result)
- [fetch_column](#fetch_column)
- [StmtHandle](#StmtHandle)
- [execute](#execute)
- [close](#close)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## connect
[[Return to contents]](#Contents)
## debug
[[Return to contents]](#Contents)
## get_client_info
[[Return to contents]](#Contents)
## get_client_version
[[Return to contents]](#Contents)
## ConnectionFlag
[[Return to contents]](#Contents)
## FieldType
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## get_len
[[Return to contents]](#Contents)
## C.MYSQL
[[Return to contents]](#Contents)
## C.MYSQL_BIND
[[Return to contents]](#Contents)
## C.MYSQL_FIELD
[[Return to contents]](#Contents)
## C.MYSQL_RES
[[Return to contents]](#Contents)
## C.MYSQL_STMT
[[Return to contents]](#Contents)
## Config
[[Return to contents]](#Contents)
## DB
[[Return to contents]](#Contents)
## affected_rows
[[Return to contents]](#Contents)
## autocommit
[[Return to contents]](#Contents)
## change_user
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## commit
[[Return to contents]](#Contents)
## create
[[Return to contents]](#Contents)
## delete
[[Return to contents]](#Contents)
## drop
[[Return to contents]](#Contents)
## dump_debug_info
[[Return to contents]](#Contents)
## escape_string
[[Return to contents]](#Contents)
## exec
[[Return to contents]](#Contents)
## exec_none
[[Return to contents]](#Contents)
## exec_one
[[Return to contents]](#Contents)
## exec_param
[[Return to contents]](#Contents)
## exec_param_many
[[Return to contents]](#Contents)
## get_host_info
[[Return to contents]](#Contents)
## get_option
[[Return to contents]](#Contents)
## get_server_info
[[Return to contents]](#Contents)
## get_server_version
[[Return to contents]](#Contents)
## info
[[Return to contents]](#Contents)
## init_stmt
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## last_id
[[Return to contents]](#Contents)
## ping
[[Return to contents]](#Contents)
## prepare
[[Return to contents]](#Contents)
## query
[[Return to contents]](#Contents)
## real_query
[[Return to contents]](#Contents)
## refresh
[[Return to contents]](#Contents)
## reset
[[Return to contents]](#Contents)
## select
[[Return to contents]](#Contents)
## select_db
[[Return to contents]](#Contents)
## set_option
[[Return to contents]](#Contents)
## tables
[[Return to contents]](#Contents)
## update
[[Return to contents]](#Contents)
## use_result
[[Return to contents]](#Contents)
## Field
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## Result
[[Return to contents]](#Contents)
## fetch_row
[[Return to contents]](#Contents)
## n_rows
[[Return to contents]](#Contents)
## n_fields
[[Return to contents]](#Contents)
## rows
[[Return to contents]](#Contents)
## maps
[[Return to contents]](#Contents)
## fields
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## Row
[[Return to contents]](#Contents)
## Stmt
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## prepare
[[Return to contents]](#Contents)
## bind_params
[[Return to contents]](#Contents)
## execute
[[Return to contents]](#Contents)
## next
[[Return to contents]](#Contents)
## gen_metadata
[[Return to contents]](#Contents)
## fetch_fields
[[Return to contents]](#Contents)
## fetch_stmt
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## error
[[Return to contents]](#Contents)
## bind_bool
[[Return to contents]](#Contents)
## bind_byte
[[Return to contents]](#Contents)
## bind_u8
[[Return to contents]](#Contents)
## bind_i8
[[Return to contents]](#Contents)
## bind_i16
[[Return to contents]](#Contents)
## bind_u16
[[Return to contents]](#Contents)
## bind_int
[[Return to contents]](#Contents)
## bind_u32
[[Return to contents]](#Contents)
## bind_i64
[[Return to contents]](#Contents)
## bind_u64
[[Return to contents]](#Contents)
## bind_f32
[[Return to contents]](#Contents)
## bind_f64
[[Return to contents]](#Contents)
## bind_text
[[Return to contents]](#Contents)
## bind_null
[[Return to contents]](#Contents)
## bind
[[Return to contents]](#Contents)
## bind_res
[[Return to contents]](#Contents)
## bind_result_buffer
[[Return to contents]](#Contents)
## store_result
[[Return to contents]](#Contents)
## fetch_column
[[Return to contents]](#Contents)
## StmtHandle
[[Return to contents]](#Contents)
## execute
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

130
vdocs/db.pg.md Normal file
View File

@@ -0,0 +1,130 @@
# module db.pg
## Contents
- [connect](#connect)
- [connect_with_conninfo](#connect_with_conninfo)
- [ConnStatusType](#ConnStatusType)
- [ExecStatusType](#ExecStatusType)
- [Oid](#Oid)
- [C.PGconn](#C.PGconn)
- [C.PGresult](#C.PGresult)
- [C.pg_conn](#C.pg_conn)
- [C.pg_result](#C.pg_result)
- [Config](#Config)
- [DB](#DB)
- [close](#close)
- [copy_expert](#copy_expert)
- [create](#create)
- [delete](#delete)
- [drop](#drop)
- [exec](#exec)
- [exec_one](#exec_one)
- [exec_param](#exec_param)
- [exec_param2](#exec_param2)
- [exec_param_many](#exec_param_many)
- [exec_prepared](#exec_prepared)
- [insert](#insert)
- [last_id](#last_id)
- [prepare](#prepare)
- [q_int](#q_int)
- [q_string](#q_string)
- [q_strings](#q_strings)
- [select](#select)
- [update](#update)
- [Row](#Row)
## connect
[[Return to contents]](#Contents)
## connect_with_conninfo
[[Return to contents]](#Contents)
## ConnStatusType
[[Return to contents]](#Contents)
## ExecStatusType
[[Return to contents]](#Contents)
## Oid
[[Return to contents]](#Contents)
## C.PGconn
[[Return to contents]](#Contents)
## C.PGresult
[[Return to contents]](#Contents)
## C.pg_conn
[[Return to contents]](#Contents)
## C.pg_result
[[Return to contents]](#Contents)
## Config
[[Return to contents]](#Contents)
## DB
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## copy_expert
[[Return to contents]](#Contents)
## create
[[Return to contents]](#Contents)
## delete
[[Return to contents]](#Contents)
## drop
[[Return to contents]](#Contents)
## exec
[[Return to contents]](#Contents)
## exec_one
[[Return to contents]](#Contents)
## exec_param
[[Return to contents]](#Contents)
## exec_param2
[[Return to contents]](#Contents)
## exec_param_many
[[Return to contents]](#Contents)
## exec_prepared
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## last_id
[[Return to contents]](#Contents)
## prepare
[[Return to contents]](#Contents)
## q_int
[[Return to contents]](#Contents)
## q_string
[[Return to contents]](#Contents)
## q_strings
[[Return to contents]](#Contents)
## select
[[Return to contents]](#Contents)
## update
[[Return to contents]](#Contents)
## Row
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

234
vdocs/db.sqlite.md Normal file
View File

@@ -0,0 +1,234 @@
# module db.sqlite
## Contents
- [Constants](#Constants)
- [connect](#connect)
- [connect_full](#connect_full)
- [get_default_vfs](#get_default_vfs)
- [get_vfs](#get_vfs)
- [is_error](#is_error)
- [Sqlite3_file](#Sqlite3_file)
- [Sqlite3_io_methods](#Sqlite3_io_methods)
- [Sqlite3_vfs](#Sqlite3_vfs)
- [register_as_nondefault](#register_as_nondefault)
- [unregister](#unregister)
- [JournalMode](#JournalMode)
- [OpenModeFlag](#OpenModeFlag)
- [Result](#Result)
- [is_error](#is_error)
- [SyncMode](#SyncMode)
- [C.sqlite3](#C.sqlite3)
- [C.sqlite3_file](#C.sqlite3_file)
- [C.sqlite3_io_methods](#C.sqlite3_io_methods)
- [C.sqlite3_stmt](#C.sqlite3_stmt)
- [C.sqlite3_vfs](#C.sqlite3_vfs)
- [DB](#DB)
- [busy_timeout](#busy_timeout)
- [close](#close)
- [create](#create)
- [create_table](#create_table)
- [delete](#delete)
- [drop](#drop)
- [error_message](#error_message)
- [exec](#exec)
- [exec_map](#exec_map)
- [exec_none](#exec_none)
- [exec_one](#exec_one)
- [exec_param](#exec_param)
- [exec_param_many](#exec_param_many)
- [get_affected_rows_count](#get_affected_rows_count)
- [insert](#insert)
- [journal_mode](#journal_mode)
- [last_id](#last_id)
- [last_insert_rowid](#last_insert_rowid)
- [q_int](#q_int)
- [q_string](#q_string)
- [select](#select)
- [str](#str)
- [synchronization_mode](#synchronization_mode)
- [update](#update)
- [Row](#Row)
- [Stmt](#Stmt)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## connect
[[Return to contents]](#Contents)
## connect_full
[[Return to contents]](#Contents)
## get_default_vfs
[[Return to contents]](#Contents)
## get_vfs
[[Return to contents]](#Contents)
## is_error
[[Return to contents]](#Contents)
## Sqlite3_file
[[Return to contents]](#Contents)
## Sqlite3_io_methods
[[Return to contents]](#Contents)
## Sqlite3_vfs
[[Return to contents]](#Contents)
## register_as_nondefault
[[Return to contents]](#Contents)
## unregister
[[Return to contents]](#Contents)
## JournalMode
[[Return to contents]](#Contents)
## OpenModeFlag
[[Return to contents]](#Contents)
## Result
[[Return to contents]](#Contents)
## is_error
[[Return to contents]](#Contents)
## SyncMode
[[Return to contents]](#Contents)
## C.sqlite3
[[Return to contents]](#Contents)
## C.sqlite3_file
[[Return to contents]](#Contents)
## C.sqlite3_io_methods
[[Return to contents]](#Contents)
## C.sqlite3_stmt
[[Return to contents]](#Contents)
## C.sqlite3_vfs
[[Return to contents]](#Contents)
## DB
[[Return to contents]](#Contents)
## busy_timeout
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## create
[[Return to contents]](#Contents)
## create_table
[[Return to contents]](#Contents)
## delete
[[Return to contents]](#Contents)
## drop
[[Return to contents]](#Contents)
## error_message
[[Return to contents]](#Contents)
## exec
[[Return to contents]](#Contents)
## exec_map
[[Return to contents]](#Contents)
## exec_none
[[Return to contents]](#Contents)
## exec_one
[[Return to contents]](#Contents)
## exec_param
[[Return to contents]](#Contents)
## exec_param_many
[[Return to contents]](#Contents)
## get_affected_rows_count
[[Return to contents]](#Contents)
## insert
[[Return to contents]](#Contents)
## journal_mode
[[Return to contents]](#Contents)
## last_id
[[Return to contents]](#Contents)
## last_insert_rowid
[[Return to contents]](#Contents)
## q_int
[[Return to contents]](#Contents)
## q_string
[[Return to contents]](#Contents)
## select
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## synchronization_mode
[[Return to contents]](#Contents)
## update
[[Return to contents]](#Contents)
## Row
[[Return to contents]](#Contents)
## Stmt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

60
vdocs/dl.loader.md Normal file
View File

@@ -0,0 +1,60 @@
# module dl.loader
## Contents
- [Constants](#Constants)
- [get_or_create_dynamic_lib_loader](#get_or_create_dynamic_lib_loader)
- [registered_dl_loader_keys](#registered_dl_loader_keys)
- [DynamicLibLoader](#DynamicLibLoader)
- [open](#open)
- [close](#close)
- [get_sym](#get_sym)
- [unregister](#unregister)
- [DynamicLibLoaderConfig](#DynamicLibLoaderConfig)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## get_or_create_dynamic_lib_loader
[[Return to contents]](#Contents)
## registered_dl_loader_keys
[[Return to contents]](#Contents)
## DynamicLibLoader
[[Return to contents]](#Contents)
## open
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## get_sym
[[Return to contents]](#Contents)
## unregister
[[Return to contents]](#Contents)
## DynamicLibLoaderConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

58
vdocs/dl.md Normal file
View File

@@ -0,0 +1,58 @@
# module dl
## Contents
- [Constants](#Constants)
- [close](#close)
- [dlerror](#dlerror)
- [get_libname](#get_libname)
- [get_shared_library_extension](#get_shared_library_extension)
- [open](#open)
- [open_opt](#open_opt)
- [sym](#sym)
- [sym_opt](#sym_opt)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## close
[[Return to contents]](#Contents)
## dlerror
[[Return to contents]](#Contents)
## get_libname
[[Return to contents]](#Contents)
## get_shared_library_extension
[[Return to contents]](#Contents)
## open
[[Return to contents]](#Contents)
## open_opt
[[Return to contents]](#Contents)
## sym
[[Return to contents]](#Contents)
## sym_opt
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

86
vdocs/dlmalloc.md Normal file
View File

@@ -0,0 +1,86 @@
# module dlmalloc
## Contents
- [Constants](#Constants)
- [calloc](#calloc)
- [free](#free)
- [get_system_allocator](#get_system_allocator)
- [malloc](#malloc)
- [memalign](#memalign)
- [new](#new)
- [realloc](#realloc)
- [Map_flags](#Map_flags)
- [Mm_prot](#Mm_prot)
- [Allocator](#Allocator)
- [Dlmalloc](#Dlmalloc)
- [calloc_must_clear](#calloc_must_clear)
- [calloc](#calloc)
- [free_](#free_)
- [malloc](#malloc)
- [realloc](#realloc)
- [memalign](#memalign)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## calloc
[[Return to contents]](#Contents)
## free
[[Return to contents]](#Contents)
## get_system_allocator
[[Return to contents]](#Contents)
## malloc
[[Return to contents]](#Contents)
## memalign
[[Return to contents]](#Contents)
## new
[[Return to contents]](#Contents)
## realloc
[[Return to contents]](#Contents)
## Map_flags
[[Return to contents]](#Contents)
## Mm_prot
[[Return to contents]](#Contents)
## Allocator
[[Return to contents]](#Contents)
## Dlmalloc
[[Return to contents]](#Contents)
## calloc_must_clear
[[Return to contents]](#Contents)
## calloc
[[Return to contents]](#Contents)
## free_
[[Return to contents]](#Contents)
## malloc
[[Return to contents]](#Contents)
## realloc
[[Return to contents]](#Contents)
## memalign
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

78
vdocs/encoding.base32.md Normal file
View File

@@ -0,0 +1,78 @@
# module encoding.base32
## Contents
- [Constants](#Constants)
- [decode](#decode)
- [decode_string_to_string](#decode_string_to_string)
- [decode_to_string](#decode_to_string)
- [encode](#encode)
- [encode_string_to_string](#encode_string_to_string)
- [encode_to_string](#encode_to_string)
- [new_encoding](#new_encoding)
- [new_encoding_with_padding](#new_encoding_with_padding)
- [new_std_encoding](#new_std_encoding)
- [new_std_encoding_with_padding](#new_std_encoding_with_padding)
- [Encoding](#Encoding)
- [encode_to_string](#encode_to_string)
- [encode_string_to_string](#encode_string_to_string)
- [decode_string](#decode_string)
- [decode_string_to_string](#decode_string_to_string)
- [decode](#decode)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## decode
[[Return to contents]](#Contents)
## decode_string_to_string
[[Return to contents]](#Contents)
## decode_to_string
[[Return to contents]](#Contents)
## encode
[[Return to contents]](#Contents)
## encode_string_to_string
[[Return to contents]](#Contents)
## encode_to_string
[[Return to contents]](#Contents)
## new_encoding
[[Return to contents]](#Contents)
## new_encoding_with_padding
[[Return to contents]](#Contents)
## new_std_encoding
[[Return to contents]](#Contents)
## new_std_encoding_with_padding
[[Return to contents]](#Contents)
## Encoding
## encode_to_string
[[Return to contents]](#Contents)
## encode_string_to_string
[[Return to contents]](#Contents)
## decode_string
[[Return to contents]](#Contents)
## decode_string_to_string
[[Return to contents]](#Contents)
## decode
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

74
vdocs/encoding.base58.md Normal file
View File

@@ -0,0 +1,74 @@
# module encoding.base58
## Contents
- [Constants](#Constants)
- [decode](#decode)
- [decode_bytes](#decode_bytes)
- [decode_int](#decode_int)
- [decode_int_walpha](#decode_int_walpha)
- [decode_walpha](#decode_walpha)
- [decode_walpha_bytes](#decode_walpha_bytes)
- [encode](#encode)
- [encode_bytes](#encode_bytes)
- [encode_int](#encode_int)
- [encode_int_walpha](#encode_int_walpha)
- [encode_walpha](#encode_walpha)
- [encode_walpha_bytes](#encode_walpha_bytes)
- [new_alphabet](#new_alphabet)
- [Alphabet](#Alphabet)
- [str](#str)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## decode
[[Return to contents]](#Contents)
## decode_bytes
[[Return to contents]](#Contents)
## decode_int
[[Return to contents]](#Contents)
## decode_int_walpha
[[Return to contents]](#Contents)
## decode_walpha
[[Return to contents]](#Contents)
## decode_walpha_bytes
[[Return to contents]](#Contents)
## encode
[[Return to contents]](#Contents)
## encode_bytes
[[Return to contents]](#Contents)
## encode_int
[[Return to contents]](#Contents)
## encode_int_walpha
[[Return to contents]](#Contents)
## encode_walpha
[[Return to contents]](#Contents)
## encode_walpha_bytes
[[Return to contents]](#Contents)
## new_alphabet
[[Return to contents]](#Contents)
## Alphabet
## str
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

64
vdocs/encoding.base64.md Normal file
View File

@@ -0,0 +1,64 @@
# module encoding.base64
## Contents
- [decode](#decode)
- [decode_in_buffer](#decode_in_buffer)
- [decode_in_buffer_bytes](#decode_in_buffer_bytes)
- [decode_str](#decode_str)
- [encode](#encode)
- [encode_in_buffer](#encode_in_buffer)
- [encode_str](#encode_str)
- [url_decode](#url_decode)
- [url_decode_str](#url_decode_str)
- [url_encode](#url_encode)
- [url_encode_str](#url_encode_str)
## decode
Example
```v
assert base64.decode('ViBpbiBiYXNlIDY0') == 'V in base 64'
```
[[Return to contents]](#Contents)
## decode_in_buffer
[[Return to contents]](#Contents)
## decode_in_buffer_bytes
[[Return to contents]](#Contents)
## decode_str
[[Return to contents]](#Contents)
## encode
Example
```v
assert base64.encode('V in base 64') == 'ViBpbiBiYXNlIDY0'
```
[[Return to contents]](#Contents)
## encode_in_buffer
[[Return to contents]](#Contents)
## encode_str
[[Return to contents]](#Contents)
## url_decode
[[Return to contents]](#Contents)
## url_decode_str
[[Return to contents]](#Contents)
## url_encode
[[Return to contents]](#Contents)
## url_encode_str
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

226
vdocs/encoding.binary.md Normal file
View File

@@ -0,0 +1,226 @@
# module encoding.binary
## Contents
- [big_endian_get_u16](#big_endian_get_u16)
- [big_endian_get_u32](#big_endian_get_u32)
- [big_endian_get_u64](#big_endian_get_u64)
- [big_endian_put_u16](#big_endian_put_u16)
- [big_endian_put_u16_at](#big_endian_put_u16_at)
- [big_endian_put_u16_end](#big_endian_put_u16_end)
- [big_endian_put_u16_fixed](#big_endian_put_u16_fixed)
- [big_endian_put_u32](#big_endian_put_u32)
- [big_endian_put_u32_at](#big_endian_put_u32_at)
- [big_endian_put_u32_end](#big_endian_put_u32_end)
- [big_endian_put_u32_fixed](#big_endian_put_u32_fixed)
- [big_endian_put_u64](#big_endian_put_u64)
- [big_endian_put_u64_at](#big_endian_put_u64_at)
- [big_endian_put_u64_end](#big_endian_put_u64_end)
- [big_endian_put_u64_fixed](#big_endian_put_u64_fixed)
- [big_endian_u16](#big_endian_u16)
- [big_endian_u16_at](#big_endian_u16_at)
- [big_endian_u16_end](#big_endian_u16_end)
- [big_endian_u16_fixed](#big_endian_u16_fixed)
- [big_endian_u32](#big_endian_u32)
- [big_endian_u32_at](#big_endian_u32_at)
- [big_endian_u32_end](#big_endian_u32_end)
- [big_endian_u32_fixed](#big_endian_u32_fixed)
- [big_endian_u64](#big_endian_u64)
- [big_endian_u64_at](#big_endian_u64_at)
- [big_endian_u64_end](#big_endian_u64_end)
- [big_endian_u64_fixed](#big_endian_u64_fixed)
- [little_endian_f32_at](#little_endian_f32_at)
- [little_endian_get_u16](#little_endian_get_u16)
- [little_endian_get_u32](#little_endian_get_u32)
- [little_endian_get_u64](#little_endian_get_u64)
- [little_endian_put_u16](#little_endian_put_u16)
- [little_endian_put_u16_at](#little_endian_put_u16_at)
- [little_endian_put_u16_end](#little_endian_put_u16_end)
- [little_endian_put_u16_fixed](#little_endian_put_u16_fixed)
- [little_endian_put_u32](#little_endian_put_u32)
- [little_endian_put_u32_at](#little_endian_put_u32_at)
- [little_endian_put_u32_end](#little_endian_put_u32_end)
- [little_endian_put_u32_fixed](#little_endian_put_u32_fixed)
- [little_endian_put_u64](#little_endian_put_u64)
- [little_endian_put_u64_at](#little_endian_put_u64_at)
- [little_endian_put_u64_end](#little_endian_put_u64_end)
- [little_endian_put_u64_fixed](#little_endian_put_u64_fixed)
- [little_endian_u16](#little_endian_u16)
- [little_endian_u16_at](#little_endian_u16_at)
- [little_endian_u16_end](#little_endian_u16_end)
- [little_endian_u16_fixed](#little_endian_u16_fixed)
- [little_endian_u32](#little_endian_u32)
- [little_endian_u32_at](#little_endian_u32_at)
- [little_endian_u32_end](#little_endian_u32_end)
- [little_endian_u32_fixed](#little_endian_u32_fixed)
- [little_endian_u64](#little_endian_u64)
- [little_endian_u64_at](#little_endian_u64_at)
- [little_endian_u64_end](#little_endian_u64_end)
- [little_endian_u64_fixed](#little_endian_u64_fixed)
## big_endian_get_u16
[[Return to contents]](#Contents)
## big_endian_get_u32
[[Return to contents]](#Contents)
## big_endian_get_u64
[[Return to contents]](#Contents)
## big_endian_put_u16
[[Return to contents]](#Contents)
## big_endian_put_u16_at
[[Return to contents]](#Contents)
## big_endian_put_u16_end
[[Return to contents]](#Contents)
## big_endian_put_u16_fixed
[[Return to contents]](#Contents)
## big_endian_put_u32
[[Return to contents]](#Contents)
## big_endian_put_u32_at
[[Return to contents]](#Contents)
## big_endian_put_u32_end
[[Return to contents]](#Contents)
## big_endian_put_u32_fixed
[[Return to contents]](#Contents)
## big_endian_put_u64
[[Return to contents]](#Contents)
## big_endian_put_u64_at
[[Return to contents]](#Contents)
## big_endian_put_u64_end
[[Return to contents]](#Contents)
## big_endian_put_u64_fixed
[[Return to contents]](#Contents)
## big_endian_u16
[[Return to contents]](#Contents)
## big_endian_u16_at
[[Return to contents]](#Contents)
## big_endian_u16_end
[[Return to contents]](#Contents)
## big_endian_u16_fixed
[[Return to contents]](#Contents)
## big_endian_u32
[[Return to contents]](#Contents)
## big_endian_u32_at
[[Return to contents]](#Contents)
## big_endian_u32_end
[[Return to contents]](#Contents)
## big_endian_u32_fixed
[[Return to contents]](#Contents)
## big_endian_u64
[[Return to contents]](#Contents)
## big_endian_u64_at
[[Return to contents]](#Contents)
## big_endian_u64_end
[[Return to contents]](#Contents)
## big_endian_u64_fixed
[[Return to contents]](#Contents)
## little_endian_f32_at
[[Return to contents]](#Contents)
## little_endian_get_u16
[[Return to contents]](#Contents)
## little_endian_get_u32
[[Return to contents]](#Contents)
## little_endian_get_u64
[[Return to contents]](#Contents)
## little_endian_put_u16
[[Return to contents]](#Contents)
## little_endian_put_u16_at
[[Return to contents]](#Contents)
## little_endian_put_u16_end
[[Return to contents]](#Contents)
## little_endian_put_u16_fixed
[[Return to contents]](#Contents)
## little_endian_put_u32
[[Return to contents]](#Contents)
## little_endian_put_u32_at
[[Return to contents]](#Contents)
## little_endian_put_u32_end
[[Return to contents]](#Contents)
## little_endian_put_u32_fixed
[[Return to contents]](#Contents)
## little_endian_put_u64
[[Return to contents]](#Contents)
## little_endian_put_u64_at
[[Return to contents]](#Contents)
## little_endian_put_u64_end
[[Return to contents]](#Contents)
## little_endian_put_u64_fixed
[[Return to contents]](#Contents)
## little_endian_u16
[[Return to contents]](#Contents)
## little_endian_u16_at
[[Return to contents]](#Contents)
## little_endian_u16_end
[[Return to contents]](#Contents)
## little_endian_u16_fixed
[[Return to contents]](#Contents)
## little_endian_u32
[[Return to contents]](#Contents)
## little_endian_u32_at
[[Return to contents]](#Contents)
## little_endian_u32_end
[[Return to contents]](#Contents)
## little_endian_u32_fixed
[[Return to contents]](#Contents)
## little_endian_u64
[[Return to contents]](#Contents)
## little_endian_u64_at
[[Return to contents]](#Contents)
## little_endian_u64_end
[[Return to contents]](#Contents)
## little_endian_u64_fixed
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

144
vdocs/encoding.csv.md Normal file
View File

@@ -0,0 +1,144 @@
# module encoding.csv
## Contents
- [Constants](#Constants)
- [csv_reader](#csv_reader)
- [csv_reader_from_string](#csv_reader_from_string)
- [csv_sequential_reader](#csv_sequential_reader)
- [decode](#decode)
- [new_reader](#new_reader)
- [new_reader_from_file](#new_reader_from_file)
- [new_writer](#new_writer)
- [CellValue](#CellValue)
- [Reader](#Reader)
- [read](#read)
- [Writer](#Writer)
- [write](#write)
- [str](#str)
- [ColumType](#ColumType)
- [GetCellConfig](#GetCellConfig)
- [GetHeaderConf](#GetHeaderConf)
- [HeaderItem](#HeaderItem)
- [RandomAccessReader](#RandomAccessReader)
- [dispose_csv_reader](#dispose_csv_reader)
- [map_csv](#map_csv)
- [get_row](#get_row)
- [get_cell](#get_cell)
- [get_cellt](#get_cellt)
- [build_header_dict](#build_header_dict)
- [rows_count](#rows_count)
- [RandomAccessReaderConfig](#RandomAccessReaderConfig)
- [ReaderConfig](#ReaderConfig)
- [SequentialReader](#SequentialReader)
- [dispose_csv_reader](#dispose_csv_reader)
- [has_data](#has_data)
- [get_next_row](#get_next_row)
- [SequentialReaderConfig](#SequentialReaderConfig)
- [WriterConfig](#WriterConfig)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## csv_reader
[[Return to contents]](#Contents)
## csv_reader_from_string
[[Return to contents]](#Contents)
## csv_sequential_reader
[[Return to contents]](#Contents)
## decode
[[Return to contents]](#Contents)
## new_reader
[[Return to contents]](#Contents)
## new_reader_from_file
[[Return to contents]](#Contents)
## new_writer
[[Return to contents]](#Contents)
## CellValue
[[Return to contents]](#Contents)
## Reader
## read
[[Return to contents]](#Contents)
## Writer
## write
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## ColumType
[[Return to contents]](#Contents)
## GetCellConfig
[[Return to contents]](#Contents)
## GetHeaderConf
[[Return to contents]](#Contents)
## HeaderItem
[[Return to contents]](#Contents)
## RandomAccessReader
[[Return to contents]](#Contents)
## dispose_csv_reader
[[Return to contents]](#Contents)
## map_csv
[[Return to contents]](#Contents)
## get_row
[[Return to contents]](#Contents)
## get_cell
[[Return to contents]](#Contents)
## get_cellt
[[Return to contents]](#Contents)
## build_header_dict
[[Return to contents]](#Contents)
## rows_count
[[Return to contents]](#Contents)
## RandomAccessReaderConfig
[[Return to contents]](#Contents)
## ReaderConfig
[[Return to contents]](#Contents)
## SequentialReader
[[Return to contents]](#Contents)
## dispose_csv_reader
[[Return to contents]](#Contents)
## has_data
[[Return to contents]](#Contents)
## get_next_row
[[Return to contents]](#Contents)
## SequentialReaderConfig
[[Return to contents]](#Contents)
## WriterConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

14
vdocs/encoding.hex.md Normal file
View File

@@ -0,0 +1,14 @@
# module encoding.hex
## Contents
- [decode](#decode)
- [encode](#encode)
## decode
[[Return to contents]](#Contents)
## encode
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

22
vdocs/encoding.html.md Normal file
View File

@@ -0,0 +1,22 @@
# module encoding.html
## Contents
- [escape](#escape)
- [unescape](#unescape)
- [EscapeConfig](#EscapeConfig)
- [UnescapeConfig](#UnescapeConfig)
## escape
[[Return to contents]](#Contents)
## unescape
[[Return to contents]](#Contents)
## EscapeConfig
[[Return to contents]](#Contents)
## UnescapeConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

30
vdocs/encoding.iconv.md Normal file
View File

@@ -0,0 +1,30 @@
# module encoding.iconv
## Contents
- [create_utf_string_with_bom](#create_utf_string_with_bom)
- [encoding_to_vstring](#encoding_to_vstring)
- [read_file_encoding](#read_file_encoding)
- [remove_utf_string_with_bom](#remove_utf_string_with_bom)
- [vstring_to_encoding](#vstring_to_encoding)
- [write_file_encoding](#write_file_encoding)
## create_utf_string_with_bom
[[Return to contents]](#Contents)
## encoding_to_vstring
[[Return to contents]](#Contents)
## read_file_encoding
[[Return to contents]](#Contents)
## remove_utf_string_with_bom
[[Return to contents]](#Contents)
## vstring_to_encoding
[[Return to contents]](#Contents)
## write_file_encoding
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

38
vdocs/encoding.leb128.md Normal file
View File

@@ -0,0 +1,38 @@
# module encoding.leb128
## Contents
- [decode_i32](#decode_i32)
- [decode_i64](#decode_i64)
- [decode_u32](#decode_u32)
- [decode_u64](#decode_u64)
- [encode_i32](#encode_i32)
- [encode_i64](#encode_i64)
- [encode_u32](#encode_u32)
- [encode_u64](#encode_u64)
## decode_i32
[[Return to contents]](#Contents)
## decode_i64
[[Return to contents]](#Contents)
## decode_u32
[[Return to contents]](#Contents)
## decode_u64
[[Return to contents]](#Contents)
## encode_i32
[[Return to contents]](#Contents)
## encode_i64
[[Return to contents]](#Contents)
## encode_u32
[[Return to contents]](#Contents)
## encode_u64
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

38
vdocs/encoding.txtar.md Normal file
View File

@@ -0,0 +1,38 @@
# module encoding.txtar
## Contents
- [pack](#pack)
- [parse](#parse)
- [parse_file](#parse_file)
- [unpack](#unpack)
- [Archive](#Archive)
- [str](#str)
- [unpack_to](#unpack_to)
- [File](#File)
## pack
[[Return to contents]](#Contents)
## parse
[[Return to contents]](#Contents)
## parse_file
[[Return to contents]](#Contents)
## unpack
[[Return to contents]](#Contents)
## Archive
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## unpack_to
[[Return to contents]](#Contents)
## File
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

View File

@@ -0,0 +1,18 @@
# module encoding.utf8.east_asian
## Contents
- [display_width](#display_width)
- [east_asian_width_property_at](#east_asian_width_property_at)
- [EastAsianWidthProperty](#EastAsianWidthProperty)
## display_width
[[Return to contents]](#Contents)
## east_asian_width_property_at
[[Return to contents]](#Contents)
## EastAsianWidthProperty
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

82
vdocs/encoding.utf8.md Normal file
View File

@@ -0,0 +1,82 @@
# module encoding.utf8
## Contents
- [get_rune](#get_rune)
- [get_uchar](#get_uchar)
- [is_control](#is_control)
- [is_global_punct](#is_global_punct)
- [is_letter](#is_letter)
- [is_number](#is_number)
- [is_punct](#is_punct)
- [is_rune_global_punct](#is_rune_global_punct)
- [is_rune_punct](#is_rune_punct)
- [is_space](#is_space)
- [is_uchar_global_punct](#is_uchar_global_punct)
- [is_uchar_punct](#is_uchar_punct)
- [len](#len)
- [raw_index](#raw_index)
- [reverse](#reverse)
- [to_lower](#to_lower)
- [to_upper](#to_upper)
- [validate](#validate)
- [validate_str](#validate_str)
## get_rune
[[Return to contents]](#Contents)
## get_uchar
[[Return to contents]](#Contents)
## is_control
[[Return to contents]](#Contents)
## is_global_punct
[[Return to contents]](#Contents)
## is_letter
[[Return to contents]](#Contents)
## is_number
[[Return to contents]](#Contents)
## is_punct
[[Return to contents]](#Contents)
## is_rune_global_punct
[[Return to contents]](#Contents)
## is_rune_punct
[[Return to contents]](#Contents)
## is_space
[[Return to contents]](#Contents)
## is_uchar_global_punct
[[Return to contents]](#Contents)
## is_uchar_punct
[[Return to contents]](#Contents)
## len
[[Return to contents]](#Contents)
## raw_index
[[Return to contents]](#Contents)
## reverse
[[Return to contents]](#Contents)
## to_lower
[[Return to contents]](#Contents)
## to_upper
[[Return to contents]](#Contents)
## validate
[[Return to contents]](#Contents)
## validate_str
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

124
vdocs/encoding.xml.md Normal file
View File

@@ -0,0 +1,124 @@
# module encoding.xml
## Contents
- [Constants](#Constants)
- [escape_text](#escape_text)
- [parse_single_node](#parse_single_node)
- [unescape_text](#unescape_text)
- [XMLDocument.from_file](#XMLDocument.from_file)
- [XMLDocument.from_reader](#XMLDocument.from_reader)
- [XMLDocument.from_string](#XMLDocument.from_string)
- [DTDListItem](#DTDListItem)
- [XMLNodeContents](#XMLNodeContents)
- [DTDElement](#DTDElement)
- [DTDEntity](#DTDEntity)
- [DocumentType](#DocumentType)
- [DocumentTypeDefinition](#DocumentTypeDefinition)
- [EscapeConfig](#EscapeConfig)
- [UnescapeConfig](#UnescapeConfig)
- [XMLCData](#XMLCData)
- [XMLComment](#XMLComment)
- [XMLDocument](#XMLDocument)
- [get_element_by_id](#get_element_by_id)
- [get_elements_by_attribute](#get_elements_by_attribute)
- [get_elements_by_tag](#get_elements_by_tag)
- [pretty_str](#pretty_str)
- [str](#str)
- [validate](#validate)
- [XMLNode](#XMLNode)
- [get_element_by_id](#get_element_by_id)
- [get_elements_by_attribute](#get_elements_by_attribute)
- [get_elements_by_tag](#get_elements_by_tag)
- [pretty_str](#pretty_str)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## escape_text
[[Return to contents]](#Contents)
## parse_single_node
[[Return to contents]](#Contents)
## unescape_text
[[Return to contents]](#Contents)
## XMLDocument.from_file
[[Return to contents]](#Contents)
## XMLDocument.from_reader
[[Return to contents]](#Contents)
## XMLDocument.from_string
[[Return to contents]](#Contents)
## DTDListItem
[[Return to contents]](#Contents)
## XMLNodeContents
[[Return to contents]](#Contents)
## DTDElement
[[Return to contents]](#Contents)
## DTDEntity
[[Return to contents]](#Contents)
## DocumentType
[[Return to contents]](#Contents)
## DocumentTypeDefinition
[[Return to contents]](#Contents)
## EscapeConfig
[[Return to contents]](#Contents)
## UnescapeConfig
[[Return to contents]](#Contents)
## XMLCData
[[Return to contents]](#Contents)
## XMLComment
[[Return to contents]](#Contents)
## XMLDocument
[[Return to contents]](#Contents)
## get_element_by_id
[[Return to contents]](#Contents)
## get_elements_by_attribute
[[Return to contents]](#Contents)
## get_elements_by_tag
[[Return to contents]](#Contents)
## pretty_str
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## validate
[[Return to contents]](#Contents)
## XMLNode
[[Return to contents]](#Contents)
## get_element_by_id
[[Return to contents]](#Contents)
## get_elements_by_attribute
[[Return to contents]](#Contents)
## get_elements_by_tag
[[Return to contents]](#Contents)
## pretty_str
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

78
vdocs/eventbus.md Normal file
View File

@@ -0,0 +1,78 @@
# module eventbus
## Contents
- [new](#new)
- [EventBus.new](#EventBus.new)
- [EventBus[T]](#EventBus[T])
- [publish](#publish)
- [clear_all](#clear_all)
- [has_subscriber](#has_subscriber)
- [EventHandlerFn](#EventHandlerFn)
- [Subscriber[T]](#Subscriber[T])
- [subscribe](#subscribe)
- [subscribe_method](#subscribe_method)
- [unsubscribe_method](#unsubscribe_method)
- [unsubscribe_receiver](#unsubscribe_receiver)
- [subscribe_once](#subscribe_once)
- [is_subscribed](#is_subscribed)
- [is_subscribed_method](#is_subscribed_method)
- [unsubscribe](#unsubscribe)
- [EventBus](#EventBus)
- [Publisher](#Publisher)
- [Subscriber](#Subscriber)
## new
[[Return to contents]](#Contents)
## EventBus.new
[[Return to contents]](#Contents)
## EventBus[T]
## publish
[[Return to contents]](#Contents)
## clear_all
[[Return to contents]](#Contents)
## has_subscriber
[[Return to contents]](#Contents)
## EventHandlerFn
[[Return to contents]](#Contents)
## Subscriber[T]
## subscribe
[[Return to contents]](#Contents)
## subscribe_method
[[Return to contents]](#Contents)
## unsubscribe_method
[[Return to contents]](#Contents)
## unsubscribe_receiver
[[Return to contents]](#Contents)
## subscribe_once
[[Return to contents]](#Contents)
## is_subscribed
[[Return to contents]](#Contents)
## is_subscribed_method
[[Return to contents]](#Contents)
## unsubscribe
[[Return to contents]](#Contents)
## EventBus
[[Return to contents]](#Contents)
## Publisher
[[Return to contents]](#Contents)
## Subscriber
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

212
vdocs/flag.md Normal file
View File

@@ -0,0 +1,212 @@
# module flag
## Contents
- [Constants](#Constants)
- [new_flag_parser](#new_flag_parser)
- [to_doc](#to_doc)
- [to_struct](#to_struct)
- [using](#using)
- [[]Flag](#[]Flag)
- [str](#str)
- [FieldHints](#FieldHints)
- [ParseMode](#ParseMode)
- [Show](#Show)
- [Style](#Style)
- [DocConfig](#DocConfig)
- [DocLayout](#DocLayout)
- [max_width](#max_width)
- [DocOptions](#DocOptions)
- [Flag](#Flag)
- [str](#str)
- [FlagConfig](#FlagConfig)
- [FlagMapper](#FlagMapper)
- [no_matches](#no_matches)
- [parse](#parse)
- [to_doc](#to_doc)
- [fields_docs](#fields_docs)
- [to_struct](#to_struct)
- [FlagParser](#FlagParser)
- [usage_example](#usage_example)
- [footer](#footer)
- [application](#application)
- [version](#version)
- [description](#description)
- [skip_executable](#skip_executable)
- [allow_unknown_args](#allow_unknown_args)
- [bool_opt](#bool_opt)
- [bool](#bool)
- [int_multi](#int_multi)
- [int_opt](#int_opt)
- [int](#int)
- [float_multi](#float_multi)
- [float_opt](#float_opt)
- [float](#float)
- [string_multi](#string_multi)
- [string_opt](#string_opt)
- [string](#string)
- [limit_free_args_to_at_least](#limit_free_args_to_at_least)
- [limit_free_args_to_exactly](#limit_free_args_to_exactly)
- [limit_free_args](#limit_free_args)
- [arguments_description](#arguments_description)
- [usage](#usage)
- [finalize](#finalize)
- [remaining_parameters](#remaining_parameters)
- [ParseConfig](#ParseConfig)
## Constants
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
[[Return to contents]](#Contents)
## new_flag_parser
[[Return to contents]](#Contents)
## to_doc
[[Return to contents]](#Contents)
## to_struct
[[Return to contents]](#Contents)
## using
[[Return to contents]](#Contents)
## []Flag
## str
[[Return to contents]](#Contents)
## FieldHints
[[Return to contents]](#Contents)
## ParseMode
[[Return to contents]](#Contents)
## Show
[[Return to contents]](#Contents)
## Style
[[Return to contents]](#Contents)
## DocConfig
[[Return to contents]](#Contents)
## DocLayout
[[Return to contents]](#Contents)
## max_width
[[Return to contents]](#Contents)
## DocOptions
[[Return to contents]](#Contents)
## Flag
[[Return to contents]](#Contents)
## str
[[Return to contents]](#Contents)
## FlagConfig
[[Return to contents]](#Contents)
## FlagMapper
[[Return to contents]](#Contents)
## no_matches
[[Return to contents]](#Contents)
## parse
[[Return to contents]](#Contents)
## to_doc
[[Return to contents]](#Contents)
## fields_docs
[[Return to contents]](#Contents)
## to_struct
[[Return to contents]](#Contents)
## FlagParser
[[Return to contents]](#Contents)
## usage_example
[[Return to contents]](#Contents)
## footer
[[Return to contents]](#Contents)
## application
[[Return to contents]](#Contents)
## version
[[Return to contents]](#Contents)
## description
[[Return to contents]](#Contents)
## skip_executable
[[Return to contents]](#Contents)
## allow_unknown_args
[[Return to contents]](#Contents)
## bool_opt
[[Return to contents]](#Contents)
## bool
[[Return to contents]](#Contents)
## int_multi
[[Return to contents]](#Contents)
## int_opt
[[Return to contents]](#Contents)
## int
[[Return to contents]](#Contents)
## float_multi
[[Return to contents]](#Contents)
## float_opt
[[Return to contents]](#Contents)
## float
[[Return to contents]](#Contents)
## string_multi
[[Return to contents]](#Contents)
## string_opt
[[Return to contents]](#Contents)
## string
[[Return to contents]](#Contents)
## limit_free_args_to_at_least
[[Return to contents]](#Contents)
## limit_free_args_to_exactly
[[Return to contents]](#Contents)
## limit_free_args
[[Return to contents]](#Contents)
## arguments_description
[[Return to contents]](#Contents)
## usage
[[Return to contents]](#Contents)
## finalize
[[Return to contents]](#Contents)
## remaining_parameters
[[Return to contents]](#Contents)
## ParseConfig
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

158
vdocs/fontstash.md Normal file
View File

@@ -0,0 +1,158 @@
# module fontstash
## Contents
- [Constants](#Constants)
- [create_internal](#create_internal)
- [delete_internal](#delete_internal)
- [Context](#Context)
- [set_error_callback](#set_error_callback)
- [get_atlas_size](#get_atlas_size)
- [expand_atlas](#expand_atlas)
- [reset_atlas](#reset_atlas)
- [get_font_by_name](#get_font_by_name)
- [add_fallback_font](#add_fallback_font)
- [add_font_mem](#add_font_mem)
- [push_state](#push_state)
- [pop_state](#pop_state)
- [clear_state](#clear_state)
- [set_size](#set_size)
- [set_color](#set_color)
- [set_spacing](#set_spacing)
- [set_blur](#set_blur)
- [set_align](#set_align)
- [set_alignment](#set_alignment)
- [set_font](#set_font)
- [draw_text](#draw_text)
- [text_bounds](#text_bounds)
- [line_bounds](#line_bounds)
- [vert_metrics](#vert_metrics)
- [text_iter_init](#text_iter_init)
- [text_iter_next](#text_iter_next)
- [get_texture_data](#get_texture_data)
- [validate_texture](#validate_texture)
- [draw_debug](#draw_debug)
- [Align](#Align)
- [ErrorCode](#ErrorCode)
- [Flags](#Flags)
- [C.FONScontext](#C.FONScontext)
- [C.FONSfont](#C.FONSfont)
- [C.FONSparams](#C.FONSparams)
- [C.FONSquad](#C.FONSquad)
- [C.FONStextIter](#C.FONStextIter)
## Constants
[[Return to contents]](#Contents)
## create_internal
[[Return to contents]](#Contents)
## delete_internal
[[Return to contents]](#Contents)
## Context
[[Return to contents]](#Contents)
## set_error_callback
[[Return to contents]](#Contents)
## get_atlas_size
[[Return to contents]](#Contents)
## expand_atlas
[[Return to contents]](#Contents)
## reset_atlas
[[Return to contents]](#Contents)
## get_font_by_name
[[Return to contents]](#Contents)
## add_fallback_font
[[Return to contents]](#Contents)
## add_font_mem
[[Return to contents]](#Contents)
## push_state
[[Return to contents]](#Contents)
## pop_state
[[Return to contents]](#Contents)
## clear_state
[[Return to contents]](#Contents)
## set_size
[[Return to contents]](#Contents)
## set_color
[[Return to contents]](#Contents)
## set_spacing
[[Return to contents]](#Contents)
## set_blur
[[Return to contents]](#Contents)
## set_align
[[Return to contents]](#Contents)
## set_alignment
[[Return to contents]](#Contents)
## set_font
[[Return to contents]](#Contents)
## draw_text
[[Return to contents]](#Contents)
## text_bounds
[[Return to contents]](#Contents)
## line_bounds
[[Return to contents]](#Contents)
## vert_metrics
[[Return to contents]](#Contents)
## text_iter_init
[[Return to contents]](#Contents)
## text_iter_next
[[Return to contents]](#Contents)
## get_texture_data
[[Return to contents]](#Contents)
## validate_texture
[[Return to contents]](#Contents)
## draw_debug
[[Return to contents]](#Contents)
## Align
[[Return to contents]](#Contents)
## ErrorCode
[[Return to contents]](#Contents)
## Flags
[[Return to contents]](#Contents)
## C.FONScontext
[[Return to contents]](#Contents)
## C.FONSfont
[[Return to contents]](#Contents)
## C.FONSparams
[[Return to contents]](#Contents)
## C.FONSquad
[[Return to contents]](#Contents)
## C.FONStextIter
[[Return to contents]](#Contents)
#### Powered by vdoc. Generated on: 7 Feb 2025 12:06:55

Some files were not shown because too many files have changed in this diff Show More