matchkey

package
v0.0.0-...-fdb1c1b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

matchkey a datatype which is a superposition of a literal string, a wildcarded path, and/or a Regular Expression.

Index

Constants

View Source
const (
	//## Exported Constants
	//### Static Error Codes
	ERROR_CODE_INVALID_ARGUMENT_MATCHKEY_TYPE int64 = 2
	ERROR_CODE_REGEXP_COMPILE                 int64 = 16
	ERROR_CODE_INVALID_PROPERTY_MATCHKEY_TYPE int64 = 3
	ERROR_CODE_PATH_MATCH                     int64 = 17
	//### Non-Error Constants
	MATCHKEY_TYPE_UNSPECIFIED uint8 = 0 //Null
	MATCHKEY_TYPE_STRING      uint8 = 1 //String literal
	MATCHKEY_TYPE_PATH        uint8 = 2 //Path-expanded string
	MATCHKEY_TYPE_REGEX       uint8 = 3 //Compiled Regular Expression

)
  • Constants

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchKey_interface

type MatchKey_interface interface {
	Match(name string) (match_bool bool, return_error error)
}

MatchKey_interface is the interface for `MatchKey`s

type MatchKey_struct

type MatchKey_struct struct {
	Matchkey_type   uint8
	Matchkey_string string
	// contains filtered or unexported fields
}

MatchKey_struct is the struct which implements the MatchKey interface and holds neccessary data for initialised MatchKeys.

var (
	//Exported Variables
	MATCHKEY_NIL_VALUE MatchKey_struct = MatchKey_struct{MATCHKEY_TYPE_UNSPECIFIED, "", nil}
)

Global Variables

func New

func New(matchkey_type uint8, matchkey_string string) (new_matchkey MatchKey_struct, return_error error_report.ErrorReport_struct)

New creates a new MatchKey, for a specified type, from a given string value.

func (MatchKey_struct) Match

func (matchkey MatchKey_struct) Match(check_string string) (match bool, return_error error_report.ErrorReport_struct)

Match returns true if the given string matches the MatchKey dependent on the MatchKey type; false otherwise.

Jump to

Keyboard shortcuts

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