Overview
L8Types is the foundational library for Layer 8. It defines all Protocol Buffer schemas, Go interfaces, and utilities needed to build distributed applications with service discovery, health monitoring, and secure communication. Every other Layer 8 component depends on it.
Protocol Buffer Schemas
The core type system is defined in .proto files compiled to Go via Docker-based code generation.
api.proto
Query expressions, conditions, comparators, aggregate functions, time-series points, data import/export, file upload/download, CSV export
services.proto
Service discovery, area mappings, model mappings, replication indices, transactions
health.proto
Health monitoring, statistics, pprof profiling, system status
sysconfig.proto
System configuration, VNet settings, connection parameters
notification.proto
Property change notifications, TSDB notifications, event propagation
web.proto
Web service definitions and plugin system
reflect.proto
Type reflection, nodes, decorators, table views
Virtual Networking (VNic)
The VNic interface defines six communication patterns for distributed messaging.
Unicast
Point-to-point delivery to a specific node
Multicast
Broadcast to all instances of a service
Round-robin
Distribute requests evenly across providers
Proximity
Route to the nearest service instance
Leader
Route to the elected leader instance
Local
Same-VNic messaging for co-located services
Service Discovery
Services register by area with automatic discovery, health tracking, and replication-aware routing. Service groups allow shared leader election across related services, reducing election traffic by roughly 80%.
Query System
The L8Query protobuf message supports expression-based filtering with comparators, conditions, sorting, pagination, and MapReduce flags. Aggregation queries use group_by, having, and aggregate functions (count, sum, avg, min, max).
Security
AES symmetric encryption for message transport
Token-based authentication with validation and activation
Two-phase authentication with token hash verification
Two-factor authentication (TOTP) setup and verification
CAPTCHA challenge/response for bot protection
Resource-based access control with permission scoping
Additional Capabilities
Time-Series Database
ITSDBService interface for collecting and querying timestamped data points
Data Import/Export
Templates with 10 transform types, AI-assisted column mapping, CSV export
File Management
Upload/download with SHA-256 checksums and MIME type support
Map-Reduce
IMapReduceService interface for distributed computation
Health Monitoring
CPU, memory, message counts, pprof profiling data
Service Callbacks
Before/After hooks with continuation control
Project Structure
proto/
Protocol Buffer definitions and make-bindings.sh generation script
go/ifs/
Core Go interfaces (VNic, Registry, Services, Security, Web)
go/types/
Generated Protocol Buffer types
go/nets/
Network protocol implementation
go/aes/
AES encryption utilities
Test Coverage
95% overall coverage across message operations, encryption, network protocol, type conversion, authentication, SLA configuration, and registry operations.