Documentation
¶
Index ¶
- Constants
- Variables
- func GetClassTree() map[ResourceClass][]ResourceSubClass
- func ParseFileInfoSortKeys(sortKeysStr string) ([]string, error)
- func SortFileInfos(infos []FileInfo, sortKeys []string) error
- func WithFlag(ctx context.Context, flag StorageFlag) context.Context
- type Attribute
- type ConnectorType
- type Country
- type EndpointType
- type Exporter
- type ExporterFn
- type FileInfo
- func (f FileInfo) Dev() uint64
- func (fileinfo *FileInfo) Equal(fi *FileInfo) bool
- func (fileinfo *FileInfo) EqualIgnoreSize(fi *FileInfo) bool
- func (f FileInfo) Gid() uint64
- func (f FileInfo) Groupname() string
- func (fileinfo *FileInfo) HumanSize() string
- func (f FileInfo) Ino() uint64
- func (f FileInfo) IsDir() bool
- func (f FileInfo) ModTime() time.Time
- func (f FileInfo) Mode() os.FileMode
- func (f FileInfo) Name() string
- func (f FileInfo) Nlink() uint16
- func (f FileInfo) Size() int64
- func (f FileInfo) Sys() any
- func (fileinfo *FileInfo) ToBytes() ([]byte, error)
- func (fileinfo *FileInfo) Type() string
- func (f FileInfo) Uid() uint64
- func (f FileInfo) Username() string
- type HostEndpoint
- type Importer
- type ImporterFn
- type Inventory
- type InventoryEntry
- type LazyReader
- type MAC
- type Mode
- type Options
- type Range
- type Record
- type ResourceClass
- type ResourceSubClass
- type Result
- type SecretProvider
- type StorageFlag
- type StorageResource
- type Store
- type StoreFn
Constants ¶
const ( ResourceClassUndefined ResourceClass = "" ResourceClassUnknown ResourceClass = "unknown" ResourceClassAnalytics ResourceClass = "analytics" ResourceClassBlockStorage ResourceClass = "block-storage" ResourceClassCompute ResourceClass = "compute" ResourceClassDatabase ResourceClass = "database" ResourceClassFileStorage ResourceClass = "file-storage" ResourceClassHypervisor ResourceClass = "hypervisor" ResourceClassIdentity ResourceClass = "identity" ResourceClassMessaging ResourceClass = "messaging" ResourceClassNetwork ResourceClass = "network" ResourceClassObjectStorage ResourceClass = "object-storage" ResourceClassObservability ResourceClass = "observability" ResourceClassRegistry ResourceClass = "registry" ResourceClassSecurity ResourceClass = "security" ResourceClassService ResourceClass = "service" ResourceSubClassUndefined ResourceSubClass = "" ResourceSubClassUnknown ResourceSubClass = "unknown" ResourceSubClassAzBlob ResourceSubClass = "azblob" ResourceSubClassFTP ResourceSubClass = "ftp" ResourceSubClassGCS ResourceSubClass = "gcs" ResourceSubClassIMAP ResourceSubClass = "imap" ResourceSubClassMongoDB ResourceSubClass = "mongodb" ResourceSubClassMySQL ResourceSubClass = "mysql" ResourceSubClassPVC ResourceSubClass = "pvc" ResourceSubClassPostgreSQL ResourceSubClass = "postgresql" ResourceSubClassProxmox ResourceSubClass = "proxmox" ResourceSubClassRedis ResourceSubClass = "redis" ResourceSubClassS3 ResourceSubClass = "s3" ResourceSubClassSecretManager ResourceSubClass = "secret-manager" ResourceSubClassSFTP ResourceSubClass = "sftp" ResourceSubClassVMware ResourceSubClass = "vmware" ConnectorTypeImporter ConnectorType = "importer" ConnectorTypeExporter ConnectorType = "exporter" ConnectorTypeStorage ConnectorType = "storage" ConnectorTypeSecretProvider ConnectorType = "secret_provider" ConnectorTypeInventory ConnectorType = "inventory" )
Variables ¶
Functions ¶
func GetClassTree ¶
func GetClassTree() map[ResourceClass][]ResourceSubClass
func ParseFileInfoSortKeys ¶ added in v1.1.2
func SortFileInfos ¶ added in v1.1.2
Types ¶
type ConnectorType ¶
type ConnectorType string
func (ConnectorType) IsValid ¶
func (c ConnectorType) IsValid() bool
type Country ¶
type Country string
Country is where a resource physically sits, as an ISO 3166-1 alpha-2 code. It is an observation, not a rule: whether data is allowed to be there is the control plane's question, not the integration's.
Empty means we cannot tell -- correct for an SFTP host or a local filesystem. It never means "same as the inventory": nothing is inferred from anything else.
func CountryOf ¶
CountryOf normalizes a code, returning "" for anything that is not one. Use it on the way out so an unmapped region becomes "unknown" rather than a bad code.
The shape is checked rather than the code looked up in a list of countries: that list changes, and an integration somewhere we have not heard of should not wait for an SDK release.
type EndpointType ¶
type EndpointType string
const ( EndpointUndefined EndpointType = "" EndpointHost EndpointType = "host" EndpointInet4 EndpointType = "inet4" EndpointInet6 EndpointType = "inet6" EndpointUUID EndpointType = "uuid" EndpointNetwork EndpointType = "network" EndpointIdentifier EndpointType = "identifier" )
func EndpointTypeFromString ¶
func EndpointTypeFromString(t string) (EndpointType, error)
type ExporterFn ¶ added in v1.1.2
type FileInfo ¶ added in v1.1.2
type FileInfo struct {
Lname string `json:"name" msgpack:"name"`
Lsize int64 `json:"size" msgpack:"size"`
Lmode fs.FileMode `json:"mode" msgpack:"mode"`
LmodTime time.Time `json:"mod_time" msgpack:"mod_time"`
Ldev uint64 `json:"dev" msgpack:"dev"`
Lino uint64 `json:"ino" msgpack:"ino"`
Luid uint64 `json:"uid" msgpack:"uid"`
Lgid uint64 `json:"gid" msgpack:"gid"`
Lnlink uint16 `json:"nlink" msgpack:"nlink"`
Lusername string `json:"username" msgpack:"username"` // local addition
Lgroupname string `json:"groupname" msgpack:"groupname"` // local addition
// Just in case we need something special to handle special
// OSes.
Flags uint32 `json:"flags" msgpack:"flags"`
}
Danger: If you add any fields here, be sure to adapt the Equal and EqualIgnoreSize methods.
func FileInfoFromStat ¶ added in v1.1.2
func NewFileInfo ¶ added in v1.1.2
func (*FileInfo) EqualIgnoreSize ¶ added in v1.1.2
type HostEndpoint ¶
type HostEndpoint struct {
Type EndpointType
Endpoint string
Attributes map[string]string
}
type ImporterFn ¶ added in v1.1.2
type InventoryEntry ¶
type InventoryEntry struct {
Class ResourceClass // interpreted
SubClass ResourceSubClass // interpreted
Tags []string // <value>, <key>=<value>
// The rest is provider data
URN string //
Name string //
Region string // eu-west-3, paris/dc-1, ...
Service string // s3, ec2, instance, dedicated-server, ...
Resource string // s3:bucket, ec2:volume, ...
Details []byte // Additional backend-specific content
Endpoints []HostEndpoint
// Fill via CountryOf. Report it on every entry you can.
Country Country
}
type LazyReader ¶ added in v1.1.2
type LazyReader struct {
// contains filtered or unexported fields
}
func NewLazyReader ¶ added in v1.1.2
func NewLazyReader(open func() (io.ReadCloser, error)) *LazyReader
func (*LazyReader) Close ¶ added in v1.1.2
func (lr *LazyReader) Close() error
type MAC ¶ added in v1.1.2
type MAC [32]byte
var (
NilMac MAC
)
func (MAC) MarshalJSON ¶ added in v1.1.2
func (*MAC) UnmarshalJSON ¶ added in v1.1.2
type Record ¶ added in v1.1.2
type Record struct {
// kloset doesn't make use of this field at all, it's just
// echoed back in the record.
ID string
Reader io.ReadCloser
Pathname string
Err error
IsXattr bool
XattrName string
XattrType Attribute
Target string
FileInfo FileInfo
ExtendedAttributes []string
FileAttributes uint32
}
requests
type ResourceClass ¶
type ResourceClass string
func (ResourceClass) IsValid ¶
func (c ResourceClass) IsValid() bool
type ResourceSubClass ¶
type ResourceSubClass string
func (ResourceSubClass) IsSubClassOf ¶
func (c ResourceSubClass) IsSubClassOf(parent ResourceClass) bool
func (ResourceSubClass) IsValid ¶
func (c ResourceSubClass) IsValid() bool
type SecretProvider ¶
type StorageFlag ¶ added in v1.1.2
type StorageFlag uint32
const (
StorageHot StorageFlag = 1 << iota
)
func Flag ¶ added in v1.1.2
func Flag(ctx context.Context) StorageFlag
type StorageResource ¶ added in v1.1.2
type StorageResource uint32
const ( StorageResourceUndefined StorageResource = 0 StorageResourcePackfile StorageResource = 1 StorageResourceState StorageResource = 2 StorageResourceLock StorageResource = 3 StorageResourceECCPackfile StorageResource = 4 StorageResourceECCState StorageResource = 5 )
func (StorageResource) String ¶ added in v1.1.2
func (s StorageResource) String() string
type Store ¶ added in v1.1.2
type Store interface {
Create(context.Context, []byte) error
Open(context.Context) ([]byte, error)
Ping(context.Context) error
Origin() string
Type() string
Root() string
Flags() location.Flags
Mode(context.Context) (Mode, error)
Size(context.Context) (int64, error) // this can be costly, call with caution
List(context.Context, StorageResource) ([]MAC, error)
Put(context.Context, StorageResource, MAC, io.Reader) (int64, error)
Get(context.Context, StorageResource, MAC, *Range) (io.ReadCloser, error)
Delete(context.Context, StorageResource, MAC) error
Close(ctx context.Context) error
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
inventory-run
command
|
|
|
secret-run
command
|
|
|
cmd/example-inventory
command
|
|
|
cmd/rot13
command
|
|
|
Package stdioconn provides a net.Conn over a pair of files, such as the standard input and output of a process or the pipes to a child.
|
Package stdioconn provides a net.Conn over a pair of files, such as the standard input and output of a process or the pipes to a child. |