web_pkg_fs_controller

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the config identifier.

View Source
const ControllerID = "bldr/web/pkg/fs/controller"

ControllerID is the controller identifier.

Variables

View Source
var Version = semver.MustParse("0.0.1")

Version is the controller version.

Functions

func NewWebPkgGetter

func NewWebPkgGetter(b bus.Bus, unixFsID, unixFsPrefix string, returnIfIdle bool) web_pkg_controller.WebPkgGetter

NewWebPkgGetter constructs a new web pkg getter function.

Types

type Config

type Config struct {

	// UnixfsId is the identifier for the UnixFS on the bus.
	// The fs should be provided with the AccessUnixFS controller.
	UnixfsId string `protobuf:"bytes,1,opt,name=unixfs_id,json=unixfsId,proto3" json:"unixfsId,omitempty"`
	// UnixfsPrefix is a path prefix to apply to paths in the FS.
	// This applies a chroot to the UnixFS.
	UnixfsPrefix string `protobuf:"bytes,2,opt,name=unixfs_prefix,json=unixfsPrefix,proto3" json:"unixfsPrefix,omitempty"`
	// NotFoundIfIdle returns 404 not found if the FS lookup becomes idle.
	// Lookup becomes idle if no FS is available for the URL.
	// If unset, waits until the FS is available.
	NotFoundIfIdle bool `protobuf:"varint,3,opt,name=not_found_if_idle,json=notFoundIfIdle,proto3" json:"notFoundIfIdle,omitempty"`
	// WebPkgIdList is a list of web pkg IDs to resolve.
	// Ignored if empty.
	WebPkgIdList []string `protobuf:"bytes,4,rep,name=web_pkg_id_list,json=webPkgIdList,proto3" json:"webPkgIdList,omitempty"`
	// contains filtered or unexported fields
}

Config configures the web pkg fs controller. Looks up a UnixFS using AccessUnixFS. Accesses a sub-directory of that UnixFS as a static web pkg FS.

func NewConfig

func NewConfig(unixFsID, unixFsPrefix string, notFoundIfIdle bool, webPkgIdList []string) *Config

NewConfig constructs a new config.

func (*Config) CloneMessageVT

func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetNotFoundIfIdle

func (x *Config) GetNotFoundIfIdle() bool

func (*Config) GetUnixfsId

func (x *Config) GetUnixfsId() string

func (*Config) GetUnixfsPrefix

func (x *Config) GetUnixfsPrefix() string

func (*Config) GetWebPkgIdList

func (x *Config) GetWebPkgIdList() []string

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

func (x *Config) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

type Controller = web_pkg_controller.Controller

Controller uses AccessUnixFS to resolve LookupWebPkg directives.

func NewController

func NewController(
	le *logrus.Entry,
	b bus.Bus,
	cc *Config,
) (*Controller, error)

NewController constructs a new web pkg fs controller.

type Factory

type Factory = bus.BusFactory[*Config, *Controller]

Factory constructs a controller.

func NewFactory

func NewFactory(b bus.Bus) *Factory

NewFactory builds the controller factory.

Jump to

Keyboard shortcuts

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