mayfairutils

package module
v0.0.0-...-881fac5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

README

Mayfair utils

This library implements functions used in the mayfair distributed database project

the libraries can be tested by the terminal command go test .

Documentation

Overview

* * Frank Willem Mulder * __________________ * * Copyright 2026 Frank Willem Mulder. All rights reserved. * Use of this source code is governed license that can be found in the LICENSE file.

************************************************************************ * * Frank Willem Mulder * __________________ * // Copyright 2026 Frank Willem Mulder. All rights reserved. // Use of this source code is governed license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseFileName

func BaseFileName(fn string) string

func CompValueFromField

func CompValueFromField(o1 any, o2 any, fieldName string, comp string) (bool, error)

func ContainsWhiteSpace

func ContainsWhiteSpace(mystr string) bool

func DetValueType

func DetValueType(s string) (any, reflect.Kind)

func FileExists

func FileExists(filePath string) (bool, error)

func FindGoPathExec

func FindGoPathExec(fileName string) (string, bool)

func GetOpts

func GetOpts[T comparable](opts []Optional[T]) []T

func GetValueFromField

func GetValueFromField(obj any, fieldName string) (any, bool)

func IsFileClosed

func IsFileClosed(filename string) bool

func IsNull

func IsNull(s string) bool

func MakeAbsFileName

func MakeAbsFileName(fileName string) string

func MergeFilePath

func MergeFilePath(fileName ...string) (string, bool)

func MkTitle

func MkTitle(nm string) string

func RemEndSlash

func RemEndSlash(pwd string) string

func RemQuotes

func RemQuotes(sw string) string

func RemStartSlash

func RemStartSlash(pwd string) string

func RemWhiteSpace

func RemWhiteSpace(mystr string) string

func SortOptionalValues

func SortOptionalValues[T comparable](o1, o2 Optional[T], op string) int

func SortOptionalValuesFromField

func SortOptionalValuesFromField[T comparable](o1, o2 Optional[T], fieldName, comp string) int

func SortValues

func SortValues(v1 any, v2 any, comp string) (int, error)

func SortValuesFromField

func SortValuesFromField(o1 any, o2 any, fieldName string, comp string) (int, error)

func TerminateProcs

func TerminateProcs(name string) int

func TopoSort

func TopoSort(tuples []Tuple) map[int][]int

func TopoSortedTuples

func TopoSortedTuples(chains map[int][]int, tuples []Tuple) [][]Tuple

func WaitReady

func WaitReady(name string)

Types

type Cluster

type Cluster struct {
	Tables []int
	Tuples []Tuple
}

a Cluster corresponds with the predicate tables and bipredicate Tuples of a RETE network */

func NewClusters

func NewClusters(ts []Tuple) []Cluster

func (Cluster) String

func (c Cluster) String() string

type Optional

type Optional[T comparable] struct {
	Val     T
	Present bool
}

func OptionalEmpty

func OptionalEmpty[T comparable]() Optional[T]

func OptionalOf

func OptionalOf[T comparable](v T) Optional[T]

func SetOpts

func SetOpts[T comparable](opts []T) []Optional[T]

func (*Optional[T]) Empty

func (t *Optional[T]) Empty() bool

func (*Optional[T]) Equals

func (t *Optional[T]) Equals(o Optional[T]) bool

func (*Optional[T]) Get

func (t *Optional[T]) Get() T

func (*Optional[T]) IsPresent

func (t *Optional[T]) IsPresent() bool

func (*Optional[T]) OrElse

func (t *Optional[T]) OrElse(deflt T) T

func (*Optional[T]) String

func (o *Optional[T]) String() string

type Tuple

type Tuple struct {
	No       int
	T1       int
	T2       int
	JoinType int
}

func NewTuple

func NewTuple(no, t1, t2, joinType int) Tuple

func Reverse

func Reverse(tuples []Tuple) []Tuple

Reverse is for testing purposes

func (Tuple) String

func (b Tuple) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL