Documentation
¶
Index ¶
- type IMDSv1Client
- type IMDSv2Client
- type Logger
- type MetadataClient
- type MetadataFs
- func (fs *MetadataFs) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (fs *MetadataFs) Open(name string, flags uint32, context *fuse.Context) (file nodefs.File, code fuse.Status)
- func (fs *MetadataFs) OpenDir(name string, context *fuse.Context) (c []fuse.DirEntry, code fuse.Status)
- func (fs *MetadataFs) StatFs(name string) *fuse.StatfsOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMDSv1Client ¶
type IMDSv1Client struct { Client *http.Client Endpoint string Logger logger.LeveledLogger }
IMDSv1Client wraps an HTTP client to access v1 of the Instance Metadata Service API
func NewIMDSv1Client ¶
func NewIMDSv1Client(endpoint string, l logger.LeveledLogger) *IMDSv1Client
NewIMDSv1Client returns a new IMDSv1Client
type IMDSv2Client ¶
type IMDSv2Client struct { Client *http.Client Endpoint string TokenTTL time.Duration Logger logger.LeveledLogger // contains filtered or unexported fields }
IMDSv2Client wraps an HTTP client to access v2 of the Instance Metadata Service API
func NewIMDSv2Client ¶
func NewIMDSv2Client(endpoint string, tokenTTL time.Duration, l logger.LeveledLogger) *IMDSv2Client
NewIMDSv2Client returns a new IMDSv2Client
type Logger ¶
type Logger interface { Fatalf(m string, args ...interface{}) Debugf(m string, args ...interface{}) Errorf(m string, args ...interface{}) Infof(m string, args ...interface{}) Warningf(m string, args ...interface{}) }
Logger is an interface that specifies methods that are needed for leveled logging
type MetadataClient ¶
type MetadataClient interface { Head(path string) (resp *http.Response, err error) Get(path string) (resp *http.Response, err error) }
MetadataClient is a client for accessing the AWS Instance Metadata Service
type MetadataFs ¶
type MetadataFs struct { pathfs.FileSystem Client MetadataClient Logger logger.LeveledLogger }
MetadataFs represents a filesystem that exposes metadata about EC2 instances Satisfies pathfs.FileSystem
func New ¶
func New(client MetadataClient, l logger.LeveledLogger) *MetadataFs
New initializes a new MetadataFs that uses the given endpoint as the target of metadata requests
func (*MetadataFs) GetAttr ¶
GetAttr returns an fuse.Attr representing a read-only file or directory
func (*MetadataFs) Open ¶
func (fs *MetadataFs) Open(name string, flags uint32, context *fuse.Context) (file nodefs.File, code fuse.Status)
Open returns a datafile representing the HTTP response body