# jszwedko/ec2-metadatafs architecture

> Architecture diagram of the GitHub repository jszwedko/ec2-metadatafs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jszwedko/ec2-metadatafs
- Repository: https://github.com/jszwedko/ec2-metadatafs

## Overview

No explanation provided

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph OS["Host Operating System"]
        UC["Unix Commands (ls, cat, grep)"]
        MP["Mount Point (/var/run/aws)"]
    end

    subgraph FUSE["FUSE Interface Layer"]
        FI["Filesystem Operations Handler"]:::clickable
        click FI "https://github.com/jszwedko/ec2-metadatafs/blob/master/metadatafs/metadatafs.go"
    end

    subgraph CORE["EC2-metadatafs Core"]
        direction TB
        subgraph CL["Client Layer"]
            V1["Metadata Client v1"]:::clickable
            V2["Metadata Client v2"]:::clickable
            TC["Tags Client"]:::clickable
            click V1 "https://github.com/jszwedko/ec2-metadatafs/blob/master/metadatafs/client_v1.go"
            click V2 "https://github.com/jszwedko/ec2-metadatafs/blob/master/metadatafs/client_v2.go"
            click TC "https://github.com/jszwedko/ec2-metadatafs/blob/master/tagsfs/tagsfs.go"
        end
        
        subgraph SYS["System Components"]
            LS["Logging System"]:::clickable
            FSI["Filesystem Implementation"]:::clickable
            click LS "https://github.com/jszwedko/ec2-metadatafs/blob/master/internal/logging/logging.go"
            click FSI "https://github.com/jszwedko/ec2-metadatafs/blob/master/metadatafs/metadatafs.go"
        end
        
        CACHE["File Attributes Cache"]
        MAIN["Application Entry Point"]:::clickable
        click MAIN "https://github.com/jszwedko/ec2-metadatafs/blob/master/main.go"
    end

    subgraph EXT["External Services"]
        MDS["EC2 Metadata Service<br/>(169.254.169.254)"]
        API["AWS EC2 API"]
    end

    %% Connections
    UC --> MP
    MP --> FI
    FI --> V1 & V2
    V1 & V2 --> MDS
    TC --> API
    FI --> TC
    FI --> CACHE
    MAIN --> FI

    %% Testing Components (shown as notes)
    subgraph TEST["Testing Components"]
        MT["Metadata Tests"]:::clickable
        TT["Tags Tests"]:::clickable
        click MT "https://github.com/jszwedko/ec2-metadatafs/blob/master/metadatafs/metadatafs_test.go"
        click TT "https://github.com/jszwedko/ec2-metadatafs/blob/master/tagsfs/tagsfs_test.go"
    end

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef external fill:#90EE90,stroke:#333,stroke-width:1px
    classDef cache fill:#FFE5CC,stroke:#333,stroke-width:1px
    classDef clickable fill:#ADD8E6,stroke:#0066CC,stroke-width:2px
    
    class MDS,API external
    class CACHE cache

    %% Legend
    subgraph Legend
        L1["Core Components"]
        L2["External Services"]:::external
        L3["Cache"]:::cache
        L4["Clickable Components"]:::clickable
    end
```
