objectstore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package objectstore provides access to Infrahub object and file storage.

Index

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

func NewService(client Client) *Service

NewService creates an object-store service backed by client.

func (*Service) Get

func (s *Service) Get(ctx context.Context, identifier string) (string, error)

Get returns object-store content by identifier without MIME restrictions.

func (*Service) GetFileByHFID

func (s *Service) GetFileByHFID(ctx context.Context, kind string, hfid []string) (string, error)

GetFileByHFID returns text file content by kind and human-friendly ID.

func (*Service) GetFileByID

func (s *Service) GetFileByID(ctx context.Context, nodeID string) (string, error)

GetFileByID returns text file content by Infrahub node ID.

func (*Service) GetFileByStorageID

func (s *Service) GetFileByStorageID(ctx context.Context, storageID string) (string, error)

GetFileByStorageID returns text file content by storage identifier.

func (*Service) Upload

func (s *Service) Upload(ctx context.Context, content string) (*UploadResult, error)

Upload stores textual content and returns its identifier and checksum.

type UnsupportedContentTypeError

type UnsupportedContentTypeError struct {
	Identifier  string
	ContentType string
}

UnsupportedContentTypeError reports binary content returned by a text-only file method.

func (*UnsupportedContentTypeError) Error

type UploadResult

type UploadResult struct {
	Identifier string `json:"identifier"`
	Checksum   string `json:"checksum"`
}

UploadResult identifies content stored by Infrahub.

Jump to

Keyboard shortcuts

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