client

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadP12 added in v0.15.0

func LoadP12(filename, password string) (*tls.Certificate, []*x509.Certificate, error)

Types

type CertificateConfig added in v0.15.0

type CertificateConfig struct {
	XMLName      xml.Name `xml:"certificateConfig"`
	ValidityDays string   `xml:"validityDays,attr"`
	NameEntries  struct {
		NameEntry []struct {
			Value string `xml:"value,attr"`
			Name  string `xml:"name,attr"`
		} `xml:"nameEntry"`
	} `xml:"nameEntries"`
}

type ClientHandler

type ClientHandler interface {
	GetName() string
	HasUID(uid string) bool
	GetUids() map[string]string
	GetUser() *model.User
	GetSerial() string
	GetVersion() int32
	SendMsg(msg *cot.CotMessage) error
	GetLastSeen() *time.Time
	CanSeeScope(scope string) bool
	Stop()
}

type ConnClientHandler

type ConnClientHandler struct {
	// contains filtered or unexported fields
}

func NewConnClientHandler

func NewConnClientHandler(name string, conn net.Conn, config *HandlerConfig) *ConnClientHandler

func (*ConnClientHandler) CanSeeScope

func (h *ConnClientHandler) CanSeeScope(scope string) bool

func (*ConnClientHandler) ForAllUID added in v0.14.7

func (h *ConnClientHandler) ForAllUID(fn func(string, string) bool)

func (*ConnClientHandler) GetLastSeen

func (h *ConnClientHandler) GetLastSeen() *time.Time

func (*ConnClientHandler) GetName

func (h *ConnClientHandler) GetName() string

func (*ConnClientHandler) GetSerial added in v0.18.0

func (h *ConnClientHandler) GetSerial() string

func (*ConnClientHandler) GetUID added in v0.14.7

func (h *ConnClientHandler) GetUID(callsign string) string

func (*ConnClientHandler) GetUids

func (h *ConnClientHandler) GetUids() map[string]string

func (*ConnClientHandler) GetUser

func (h *ConnClientHandler) GetUser() *model.User

func (*ConnClientHandler) GetVersion

func (h *ConnClientHandler) GetVersion() int32

func (*ConnClientHandler) HasUID added in v0.14.7

func (h *ConnClientHandler) HasUID(uid string) bool

func (*ConnClientHandler) IsActive

func (h *ConnClientHandler) IsActive() bool

func (*ConnClientHandler) SendCot added in v0.14.0

func (h *ConnClientHandler) SendCot(msg *cotproto.TakMessage) error

func (*ConnClientHandler) SendMsg

func (h *ConnClientHandler) SendMsg(msg *cot.CotMessage) error

func (*ConnClientHandler) SetVersion

func (h *ConnClientHandler) SetVersion(n int32)

func (*ConnClientHandler) Start

func (h *ConnClientHandler) Start()

func (*ConnClientHandler) Stop added in v0.18.0

func (h *ConnClientHandler) Stop()

type Enroller added in v0.15.0

type Enroller struct {
	// contains filtered or unexported fields
}

func NewEnroller added in v0.15.0

func NewEnroller(host, user, passwd string, save bool, p12Password string) *Enroller

func (*Enroller) GetOrEnrollCert added in v0.15.0

func (e *Enroller) GetOrEnrollCert(ctx context.Context, uid, version string) (*tls.Certificate, []*x509.Certificate, error)

type HandlerConfig

type HandlerConfig struct {
	User         *model.User
	Serial       string
	UID          string
	IsClient     bool
	MessageCb    func(msg *cot.CotMessage)
	RemoveCb     func(ch ClientHandler)
	NewContactCb func(uid, callsign string)
	Logger       *slog.Logger
	DropMetric   *prometheus.CounterVec
	UidChecker   func(uid string) bool
}

Jump to

Keyboard shortcuts

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