architecture

package
v0.0.0-...-7f6939c Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchitecturePattern

type ArchitecturePattern string
const (
	PatternMicroservice ArchitecturePattern = "microservice"
	PatternModular      ArchitecturePattern = "modular_monolith"
	PatternHybrid       ArchitecturePattern = "hybrid"
)

type ComplianceReport

type ComplianceReport struct {
	ServiceName     string
	CouplingScore   float64
	Dependencies    []string
	Recommendations []string
	RefactorPlan    string
}

type DependencyContract

type DependencyContract struct {
	Service string `json:"service"`
	Type    string `json:"type"`
}

type EndpointContract

type EndpointContract struct {
	Path           string           `json:"path"`
	Method         string           `json:"method"`
	RequestSchema  json.RawMessage  `json:"request_schema"`
	ResponseSchema json.RawMessage  `json:"response_schema"`
	ErrorCodes     []int            `json:"error_codes"`
	RateLimit      *RateLimitConfig `json:"rate_limit,omitempty"`
	Authorization  []string         `json:"authorization"`
}

type HealthCheckContract

type HealthCheckContract struct {
	Path string `json:"path"`
}

type MetricsContract

type MetricsContract struct {
	Enabled bool `json:"enabled"`
}

type PatternManager

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

func NewPatternManager

func NewPatternManager(db *sql.DB) *PatternManager

func (*PatternManager) AnalyzeServiceCompliance

func (pm *PatternManager) AnalyzeServiceCompliance(serviceName string) (*ComplianceReport, error)

type RateLimitConfig

type RateLimitConfig struct {
	Requests int    `json:"requests"`
	Window   string `json:"window"`
}

type ServiceContract

type ServiceContract struct {
	ServiceName  string               `json:"service_name"`
	Version      string               `json:"version"`
	Endpoints    []EndpointContract   `json:"endpoints"`
	Dependencies []DependencyContract `json:"dependencies"`
	HealthCheck  HealthCheckContract  `json:"health_check"`
	Metrics      MetricsContract      `json:"metrics"`
}

ServiceContract defines the interface contract for a service.

type ServiceRegistry

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

ServiceRegistry manages service contracts and provides contract validation.

func NewServiceRegistry

func NewServiceRegistry(db *sql.DB) *ServiceRegistry

NewServiceRegistry creates a new registry instance.

func (*ServiceRegistry) GetServiceContract

func (sr *ServiceRegistry) GetServiceContract(name string) (*ServiceContract, bool)

GetServiceContract retrieves a contract by service name.

func (*ServiceRegistry) RegisterService

func (sr *ServiceRegistry) RegisterService(contract *ServiceContract) error

RegisterService validates and stores a service contract.

Jump to

Keyboard shortcuts

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