structfs

package
v3.10.76 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-structfs

Expose struct data via http.FileServer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServer

func FileServer(iface interface{}, tag string, modtime time.Time) http.Handler

FileServer creates new file server from the struct iface with specific tag and specific modtime

Types

type DigitalOceanMetadata

type DigitalOceanMetadata struct {
	Metadata struct {
		V1 struct {
			DropletID  int64    `json:"droplet_id"`
			Hostname   string   `json:"hostname"`
			VendorData string   `json:"vendor_data"`
			PublicKeys []string `json:"public_keys"`
			Region     string   `json:"region"`
			Interfaces struct {
				Private []struct {
					IPv4 struct {
						Address string `json:"ip_address"`
						Netmask string `json:"netmask"`
						Gateway string `json:"gateway"`
					}
					Mac  string `json:"mac"`
					Type string `json:"type"`
				} `json:"private"`
				Public []struct {
					IPv4 struct {
						Address string `json:"ip_address"`
						Netmask string `json:"netmask"`
						Gateway string `json:"gateway"`
					} `json:"ipv4"`
					IPv6 struct {
						Address string `json:"ip_address"`
						CIDR    int    `json:"cidr"`
						Gateway string `json:"gateway"`
					} `json:"ipv6"`
					Mac  string `json:"mac"`
					Type string `json:"type"`
				} `json:"public"`
			} `json:"interfaces"`
			FloatingIP struct {
				IPv4 struct {
					Active bool `json:"active"`
				} `json:"ipv4"`
			} `json:"floating_ip"`
			DNS struct {
				Nameservers []string `json:"nameservers"`
			} `json:"dns"`
			Features map[string]interface{} `json:"features"`
		} `json:"v1"`
	} `json:"metadata"`
}

func (*DigitalOceanMetadata) ServeHTTP

func (stfs *DigitalOceanMetadata) ServeHTTP(w http.ResponseWriter, r *http.Request)

type EC2Metadata

type EC2Metadata struct {
	Latest struct {
		Metadata struct {
			AMIID              int      `json:"ami-id"`
			AMILaunchIndex     int      `json:"ami-launch-index"`
			AMIManifestPath    string   `json:"ami-manifest-path"`
			AncestorAMIIDs     []int    `json:"ancestor-ami-ids"`
			BlockDeviceMapping []string `json:"block-device-mapping"`
			InstanceID         int      `json:"instance-id"`
			InstanceType       string   `json:"instance-type"`
			LocalHostname      string   `json:"local-hostname"`
			LocalIPv4          string   `json:"local-ipv4"`

			Placement        string `json:"placement"`
			AvailabilityZone string `json:"availability-zone"`
			ProductCodes     string `json:"product-codes"`
			PublicHostname   string `json:"public-hostname"`
			PublicIPv4       string `json:"public-ipv4"`
			PublicKeys       []struct {
				Key []string `json:"-"`
			} `json:"public-keys"`
			RamdiskID      int      `json:"ramdisk-id"`
			ReservationID  int      `json:"reservation-id"`
			SecurityGroups []string `json:"security-groups"`
			// contains filtered or unexported fields
		} `json:"meta-data"`
		Userdata string `json:"user-data"`
	} `json:"latest"`
}

Jump to

Keyboard shortcuts

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