Documentation
¶
Index ¶
- Constants
- Variables
- func QDString(v string) string
- type AttributeTypeSchema
- type DITContentRuleSchema
- type DITStructureRuleSchema
- type ErrMissingField
- type GenericSchema
- type LDAPSchemaStore
- func (store *LDAPSchemaStore) AddAttributeTypeSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddDITContentRuleSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddDITStructureRuleSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddLDAPSyntaxSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddMatchingRuleSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddMatchingRuleUseSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddNameFormSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) AddObjectClassSchemaText(schemaText string) (err error)
- func (store *LDAPSchemaStore) PullDependentSchema(source *LDAPSchemaStore, verbose bool) (err error)
- func (store *LDAPSchemaStore) ReadFromFile(name string) (err error)
- func (store *LDAPSchemaStore) WriteToFile(name string) (err error)
- func (store *LDAPSchemaStore) WriteToJSONFile(name string) (err error)
- type LDAPSyntaxSchema
- type MatchingRuleSchema
- type MatchingRuleUseSchema
- type NameFormSchema
- type ObjectClassSchema
- type ParameterizedKeyword
- type SchemaTextBuilder
- func (b *SchemaTextBuilder) AppendBareString(keyword string, value string)
- func (b *SchemaTextBuilder) AppendExtensions(extensions map[string][]string)
- func (b *SchemaTextBuilder) AppendFlag(keyword string, value bool)
- func (b *SchemaTextBuilder) AppendFragment(keyword string)
- func (b *SchemaTextBuilder) AppendOIDSlice(keyword string, values []string)
- func (b *SchemaTextBuilder) AppendQString(keyword string, value string)
- func (b *SchemaTextBuilder) AppendQStringSlice(keyword string, values []string)
- func (b *SchemaTextBuilder) String() string
- type SourceRuleType
Constants ¶
const ( AttributeUsageUserApplications string = "userApplications" AttributeUsageDirectoryOperation string = "directoryOperation" AttributeUsageDistributedOperation string = "distributedOperation" AttributeUsageDSAOperation string = "dSAOperation" )
AttributeUsageUserApplications, AttributeUsageDirectoryOperation, AttributeUsageDistributedOperation and AttributeUsageDSAOperation are usage of attribute types. (RFC-4512 4.1.2)
const ( ClassKindAbstract string = "ABSTRACT" ClassKindStructural string = "STRUCTURAL" ClassKindAuxiliary string = "AUXILIARY" )
ClassKindAbstract, ClassKindStructural and ClassKindAuxiliary indicates the kind of object class. (RFC-4512 4.1.1)
const DQSTRING = 57356
const KEYWORD = 57349
const NOIDS_ATTR_KEYWORD = 57351
const NUMBER = 57347
const NUMERIC_OID = 57348
const OIDLEN_ATTR_KEYWORD = 57352
const QSTRINGS_ATTR_KEYWORD = 57353
const QSTRING_ATTR_KEYWORD = 57354
const SPACES = 57346
const SQSTRING = 57355
const X_KEYWORD = 57350
Variables ¶
var ErrEmptyResult = errors.New("parsing LDAP schema failed with empty result")
ErrEmptyResult indicate parser resulted an empty result
var ErrMissingNumericOID = errors.New("NumericOID is required")
ErrMissingNumericOID indicates numeric OID is required but not given.
var ErrMissingRuleID = errors.New("RuleID is required")
ErrMissingRuleID indicates rule ID is required but not given.
var ErrParseFailed = errors.New("parsing LDAP schema failed with error parsing state")
ErrParseFailed indicate parser stopped at failed state
Functions ¶
Types ¶
type AttributeTypeSchema ¶
type AttributeTypeSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
SuperType string
Equality string
Ordering string
SubString string
Syntax string
SyntaxOID string
SyntaxLength int32
SingleValue bool
Collective bool
NoUserModification bool
Usage string
Extensions map[string][]string
}
AttributeTypeSchema represent schema of attribute type
func NewAttributeTypeSchemaViaGenericSchema ¶
func NewAttributeTypeSchemaViaGenericSchema(generic *GenericSchema) (result *AttributeTypeSchema, err error)
NewAttributeTypeSchemaViaGenericSchema creates attribute type schema instance from GenericSchema
func ParseAttributeTypeSchema ¶
func ParseAttributeTypeSchema(schemaText string) (attributeTypeSchema *AttributeTypeSchema, err error)
ParseAttributeTypeSchema parses attribute type schema text
func (*AttributeTypeSchema) ShortIdentifier ¶
func (s *AttributeTypeSchema) ShortIdentifier() string
ShortIdentifier return first short name or numeric OID if no short name available.
func (*AttributeTypeSchema) String ¶
func (s *AttributeTypeSchema) String() string
func (*AttributeTypeSchema) UsingMatchingRule ¶
func (s *AttributeTypeSchema) UsingMatchingRule(matchingRuleSchema *MatchingRuleSchema) bool
UsingMatchingRule check if uses given matching rule.
type DITContentRuleSchema ¶
type DITContentRuleSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
Aux []string
Must []string
May []string
Not []string
Extensions map[string][]string
}
DITContentRuleSchema represent schema of DIT content rule
func NewDITContentRuleSchemaViaGenericSchema ¶
func NewDITContentRuleSchemaViaGenericSchema(generic *GenericSchema) (result *DITContentRuleSchema, err error)
NewDITContentRuleSchemaViaGenericSchema creates DIT content rule schema instance from GenericSchema
func ParseDITContentRuleSchema ¶
func ParseDITContentRuleSchema(schemaText string) (ditContentRuleSchema *DITContentRuleSchema, err error)
ParseDITContentRuleSchema parses DIT content rule schema text
func (*DITContentRuleSchema) String ¶
func (s *DITContentRuleSchema) String() string
type DITStructureRuleSchema ¶
type DITStructureRuleSchema struct {
RuleID string
Name []string
Description string
Obsolete bool
NameForm string
SuperRules []string
Extensions map[string][]string
}
DITStructureRuleSchema represent schema of DIT structure rule
func NewDITStructureRuleSchemaViaGenericSchema ¶
func NewDITStructureRuleSchemaViaGenericSchema(generic *GenericSchema) (result *DITStructureRuleSchema, err error)
NewDITStructureRuleSchemaViaGenericSchema creates DIT structure rule schema instance from GenericSchema
func ParseDITStructureRuleSchema ¶
func ParseDITStructureRuleSchema(schemaText string) (ditStructureRuleSchema *DITStructureRuleSchema, err error)
ParseDITStructureRuleSchema parses DIT content rule schema text
func (*DITStructureRuleSchema) String ¶
func (s *DITStructureRuleSchema) String() string
type ErrMissingField ¶
type ErrMissingField struct {
FieldName string
}
ErrMissingField represents a required field is missing.
func (*ErrMissingField) Error ¶
func (missingField *ErrMissingField) Error() string
type GenericSchema ¶
type GenericSchema struct {
NumericOID string
FlagKeywords []string
ParameterizedKeywords map[string]*ParameterizedKeyword
}
GenericSchema is generic schema object
func Parse ¶
func Parse(schemaText string) (genericSchema *GenericSchema, err error)
Parse parsing given schema text into generic schema structure
func (*GenericSchema) HasFlagKeyword ¶
func (schema *GenericSchema) HasFlagKeyword(keyword string) bool
HasFlagKeyword checks if given keyword is contained in flag keywords
type LDAPSchemaStore ¶
type LDAPSchemaStore struct {
// contains filtered or unexported fields
}
LDAPSchemaStore is a container of LDAP schemas
func NewLDAPSchemaStore ¶
func NewLDAPSchemaStore() (store *LDAPSchemaStore)
NewLDAPSchemaStore create an instance of LDAPSchemaStore
func (*LDAPSchemaStore) AddAttributeTypeSchemaText ¶
func (store *LDAPSchemaStore) AddAttributeTypeSchemaText(schemaText string) (err error)
AddAttributeTypeSchemaText add attribute type schema in text form
func (*LDAPSchemaStore) AddDITContentRuleSchemaText ¶
func (store *LDAPSchemaStore) AddDITContentRuleSchemaText(schemaText string) (err error)
AddDITContentRuleSchemaText add DIT content rule schema in text form
func (*LDAPSchemaStore) AddDITStructureRuleSchemaText ¶
func (store *LDAPSchemaStore) AddDITStructureRuleSchemaText(schemaText string) (err error)
AddDITStructureRuleSchemaText add DIT structure rule schema in text form
func (*LDAPSchemaStore) AddLDAPSyntaxSchemaText ¶
func (store *LDAPSchemaStore) AddLDAPSyntaxSchemaText(schemaText string) (err error)
AddLDAPSyntaxSchemaText add LDAP syntax schema in text form
func (*LDAPSchemaStore) AddMatchingRuleSchemaText ¶
func (store *LDAPSchemaStore) AddMatchingRuleSchemaText(schemaText string) (err error)
AddMatchingRuleSchemaText add matching rule schema in text form
func (*LDAPSchemaStore) AddMatchingRuleUseSchemaText ¶
func (store *LDAPSchemaStore) AddMatchingRuleUseSchemaText(schemaText string) (err error)
AddMatchingRuleUseSchemaText add matching rule use schema in text form
func (*LDAPSchemaStore) AddNameFormSchemaText ¶
func (store *LDAPSchemaStore) AddNameFormSchemaText(schemaText string) (err error)
AddNameFormSchemaText add name form schema in text form
func (*LDAPSchemaStore) AddObjectClassSchemaText ¶
func (store *LDAPSchemaStore) AddObjectClassSchemaText(schemaText string) (err error)
AddObjectClassSchemaText add object class schema in text form
func (*LDAPSchemaStore) PullDependentSchema ¶
func (store *LDAPSchemaStore) PullDependentSchema(source *LDAPSchemaStore, verbose bool) (err error)
PullDependentSchema pull schemas used by contained schemas from source store into this store.
func (*LDAPSchemaStore) ReadFromFile ¶
func (store *LDAPSchemaStore) ReadFromFile(name string) (err error)
ReadFromFile read content into store from file at given path
func (*LDAPSchemaStore) WriteToFile ¶
func (store *LDAPSchemaStore) WriteToFile(name string) (err error)
WriteToFile write content of store into file at given path
func (*LDAPSchemaStore) WriteToJSONFile ¶
func (store *LDAPSchemaStore) WriteToJSONFile(name string) (err error)
WriteToJSONFile write content of store into given path in JSON form.
type LDAPSyntaxSchema ¶
type LDAPSyntaxSchema struct {
NumericOID string
Description string
Extensions map[string][]string
}
LDAPSyntaxSchema represent schema of LDAP syntax
func NewLDAPSyntaxSchemaViaGenericSchema ¶
func NewLDAPSyntaxSchemaViaGenericSchema(generic *GenericSchema) (result *LDAPSyntaxSchema, err error)
NewLDAPSyntaxSchemaViaGenericSchema creates matching rule use schema instance from GenericSchema
func ParseLDAPSyntaxSchema ¶
func ParseLDAPSyntaxSchema(schemaText string) (ldapSyntaxSchema *LDAPSyntaxSchema, err error)
ParseLDAPSyntaxSchema parses LDAP syntax schema text
func (*LDAPSyntaxSchema) String ¶
func (s *LDAPSyntaxSchema) String() string
type MatchingRuleSchema ¶
type MatchingRuleSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
Syntax string
Extensions map[string][]string
}
MatchingRuleSchema represent schema of matching rule
func NewMatchingRuleSchemaViaGenericSchema ¶
func NewMatchingRuleSchemaViaGenericSchema(generic *GenericSchema) (result *MatchingRuleSchema, err error)
NewMatchingRuleSchemaViaGenericSchema creates matching rule schema instance from GenericSchema
func ParseMatchingRuleSchema ¶
func ParseMatchingRuleSchema(schemaText string) (matchingRuleSchema *MatchingRuleSchema, err error)
ParseMatchingRuleSchema parses matching rule schema text
func (*MatchingRuleSchema) HasIdentifier ¶
func (s *MatchingRuleSchema) HasIdentifier(identifyText string) bool
HasIdentifier check this rule has given identity.
func (*MatchingRuleSchema) String ¶
func (s *MatchingRuleSchema) String() string
type MatchingRuleUseSchema ¶
type MatchingRuleUseSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
AppliesTo []string
Extensions map[string][]string
}
MatchingRuleUseSchema represent schema of matching rule uses
func NewMatchingRuleUseSchemaViaGenericSchema ¶
func NewMatchingRuleUseSchemaViaGenericSchema(generic *GenericSchema) (result *MatchingRuleUseSchema, err error)
NewMatchingRuleUseSchemaViaGenericSchema creates matching rule use schema instance from GenericSchema
func ParseMatchingRuleUseSchema ¶
func ParseMatchingRuleUseSchema(schemaText string) (matchingRuleUseSchema *MatchingRuleUseSchema, err error)
ParseMatchingRuleUseSchema parses matching rule use schema text
func (*MatchingRuleUseSchema) GenericSchema ¶
func (s *MatchingRuleUseSchema) GenericSchema() (generic *GenericSchema)
GenericSchema create an instance of generic schema from this instance of matching-rule-use schema.
func (*MatchingRuleUseSchema) String ¶
func (s *MatchingRuleUseSchema) String() string
type NameFormSchema ¶
type NameFormSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
ObjectClass string
Must []string
May []string
Extensions map[string][]string
}
NameFormSchema represent schema of name form
func NewNameFormSchemaViaGenericSchema ¶
func NewNameFormSchemaViaGenericSchema(generic *GenericSchema) (result *NameFormSchema, err error)
NewNameFormSchemaViaGenericSchema creates name form schema instance from GenericSchema
func ParseNameFormSchema ¶
func ParseNameFormSchema(schemaText string) (nameFormSchema *NameFormSchema, err error)
ParseNameFormSchema parses name form schema text
func (*NameFormSchema) String ¶
func (s *NameFormSchema) String() string
type ObjectClassSchema ¶
type ObjectClassSchema struct {
NumericOID string
Name []string
Description string
Obsolete bool
SuperClasses []string
ClassKind string
Must []string
May []string
Extensions map[string][]string
}
ObjectClassSchema represent schema of object class
func NewObjectClassSchemaViaGenericSchema ¶
func NewObjectClassSchemaViaGenericSchema(generic *GenericSchema) (result *ObjectClassSchema, err error)
NewObjectClassSchemaViaGenericSchema creates object class schema instance from GenericSchema
func ParseObjectClassSchema ¶
func ParseObjectClassSchema(schemaText string) (objectClassSchema *ObjectClassSchema, err error)
ParseObjectClassSchema parses object class schema text
func (*ObjectClassSchema) String ¶
func (s *ObjectClassSchema) String() string
type ParameterizedKeyword ¶
type ParameterizedKeyword struct {
SourceRule SourceRuleType
KeywordText string
Parameters []string
}
ParameterizedKeyword is keyword with parameters attached
type SchemaTextBuilder ¶
type SchemaTextBuilder struct {
// contains filtered or unexported fields
}
SchemaTextBuilder supports schema build process
func (*SchemaTextBuilder) AppendBareString ¶
func (b *SchemaTextBuilder) AppendBareString(keyword string, value string)
AppendBareString add quoted string to result
func (*SchemaTextBuilder) AppendExtensions ¶
func (b *SchemaTextBuilder) AppendExtensions(extensions map[string][]string)
AppendExtensions appends extensions to result
func (*SchemaTextBuilder) AppendFlag ¶
func (b *SchemaTextBuilder) AppendFlag(keyword string, value bool)
AppendFlag add flag to result if given value is true
func (*SchemaTextBuilder) AppendFragment ¶
func (b *SchemaTextBuilder) AppendFragment(keyword string)
AppendFragment add given keyword to result
func (*SchemaTextBuilder) AppendOIDSlice ¶
func (b *SchemaTextBuilder) AppendOIDSlice(keyword string, values []string)
AppendOIDSlice append OIDs into result OIDs are seperated by dollar signs
func (*SchemaTextBuilder) AppendQString ¶
func (b *SchemaTextBuilder) AppendQString(keyword string, value string)
AppendQString add quoted string to result
func (*SchemaTextBuilder) AppendQStringSlice ¶
func (b *SchemaTextBuilder) AppendQStringSlice(keyword string, values []string)
AppendQStringSlice add quoted string slice to result
func (*SchemaTextBuilder) String ¶
func (b *SchemaTextBuilder) String() string
type SourceRuleType ¶
type SourceRuleType int
SourceRuleType represent source parsing rule
const ( UnknownRule SourceRuleType = iota OIDsRule NumberIDsRule OIDWithLengthRule QuotedStringsRule QuotedStringRule )
constants for source parsing rules
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ldap-schema-parser
command
|
|
|
ldif-subschema-extract
command
|
|
|
pull-ldap-schema
command
|
|
|
rfc-ldap-schema-extract
command
|
|
|
dev-tool
|
|
|
keyword-type-lookup-table-gen
command
|