ldap

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRules

func DeleteRules(c *gin.Context)

DeleteRules deletes ldap rule from user submit

func ListRules

func ListRules(c *gin.Context)

ListRules lists all ldap rules those satisfy the filter

func Records

func Records(c *gin.Context)

func UpsertRules

func UpsertRules(c *gin.Context)

UpsertRules creates or updates ldap rule from user submit

Types

type Config

type Config struct {
	Enable bool
	Addr   string
}

type Record

type Record struct {
	Path string `form:"path" json:"path"`
	record.BaseRecord
	Rule Rule `gorm:"foreignKey:RuleName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" form:"-" json:"-" notice:"-"`
}

func NewRecord

func NewRecord(rule *Rule, flag, path, ip, area string) (r *Record, err error)

func (Record) Notice

func (r Record) Notice()

func (Record) TableName

func (Record) TableName() string

type Rule

type Rule struct {
	rule.BaseRule `yaml:",inline"`
}

Rule LDAP rule struct

func NewRule

func NewRule(name, flagFormat string, pushToClient, notice bool) *Rule

NewRule new ldap rule struct

func (*Rule) CreateOrUpdate

func (r *Rule) CreateOrUpdate() (err error)

CreateOrUpdate creates or updates the ldap rule in database and ruleSet

func (*Rule) Delete

func (r *Rule) Delete() (err error)

Delete deletes the ldap rule in database and ruleSet

func (Rule) TableName

func (Rule) TableName() string

type Server

type Server struct {
	Config
	// contains filtered or unexported fields
}

func GetServer

func GetServer() *Server

func (*Server) Restart

func (s *Server) Restart()

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) UpdateRules

func (s *Server) UpdateRules() error

Jump to

Keyboard shortcuts

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