Documentation
¶
Overview ¶
Package objectstore provides access to Infrahub object and file storage.
Index ¶
- type Client
- type Service
- func (s *Service) Get(ctx context.Context, identifier string) (string, error)
- func (s *Service) GetFileByHFID(ctx context.Context, kind string, hfid []string) (string, error)
- func (s *Service) GetFileByID(ctx context.Context, nodeID string) (string, error)
- func (s *Service) GetFileByStorageID(ctx context.Context, storageID string) (string, error)
- func (s *Service) Upload(ctx context.Context, content string) (*UploadResult, error)
- type UnsupportedContentTypeError
- type UploadResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
EndpointSegments([]string, url.Values) *url.URL
DoResponse(context.Context, string, *url.URL, io.Reader, http.Header, string) (*api.HTTPResponse, error)
}
Client is the minimal REST behavior required by Service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages Infrahub object and file storage.
func NewService ¶
NewService creates an object-store service backed by client.
func (*Service) GetFileByHFID ¶
GetFileByHFID returns text file content by kind and human-friendly ID.
func (*Service) GetFileByID ¶
GetFileByID returns text file content by Infrahub node ID.
func (*Service) GetFileByStorageID ¶
GetFileByStorageID returns text file content by storage identifier.
type UnsupportedContentTypeError ¶
UnsupportedContentTypeError reports binary content returned by a text-only file method.
func (*UnsupportedContentTypeError) Error ¶
func (e *UnsupportedContentTypeError) Error() string
type UploadResult ¶
type UploadResult struct {
Identifier string `json:"identifier"`
Checksum string `json:"checksum"`
}
UploadResult identifies content stored by Infrahub.
Click to show internal directories.
Click to hide internal directories.