searchindex

package
v0.0.0-...-e9a8072 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WebhookHandler

func WebhookHandler(conf Config) (cmswebhook.Handler, error)

Types

type Config

type Config struct {
	CMSBase           string
	CMSToken          string
	CMSStorageProject string
	// optioanl
	CMSStorageModel string
	CMSModel        string
	Delegate        bool
	DelegateURL     string
	Debug           bool
	// contains filtered or unexported fields
}

func (*Config) Default

func (c *Config) Default()

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(cms cms.Interface, pid string, base *url.URL, debug bool) *Indexer

func NewZipIndexer

func NewZipIndexer(cms cms.Interface, pid string, base *url.URL, debug bool) *Indexer

func (*Indexer) BuildIndex

func (i *Indexer) BuildIndex(ctx context.Context, name string) (string, error)

type Item

type Item struct {
	ID string `json:"id,omitempty" cms:"id"`
	// asset: bldg
	Bldg []string `json:"bldg,omitempty" cms:"bldg,asset"`
	// asset: search_index
	SearchIndex []string `json:"search_index,omitempty" cms:"search_index,asset"`
	// select: search_index_status: 未実行, 実行中, 完了, エラー
	SearchIndexStatus Status `json:"search_index_status,omitempty" cms:"search_index_status,select"`
}

func ItemFrom

func ItemFrom(item cms.Item) (i Item)

func (Item) Fields

func (i Item) Fields() (fields []*cms.Field)

type OutputFS

type OutputFS struct {
	// contains filtered or unexported fields
}

func NewOutputFS

func NewOutputFS(ctx context.Context, c cms.Interface, projectID string, cb func(assetID string, err error)) *OutputFS

func (*OutputFS) Open

func (f *OutputFS) Open(p string) (indexer.WriteCloser, error)

type Status

type Status string
const (
	StatusReady      Status = "未実行"
	StatusProcessing Status = "実行中"
	StatusOK         Status = "完了"
	StatusError      Status = "エラー"
)

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(c cms.Interface, pid, mid string) *Storage

func (*Storage) All

func (s *Storage) All(ctx context.Context) (r StorageItems, err error)

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, id string) error

func (*Storage) FindByAsset

func (s *Storage) FindByAsset(ctx context.Context, assetid string) (r StorageItem, err error)

func (*Storage) FindByItem

func (s *Storage) FindByItem(ctx context.Context, itemid string) (r StorageItem, err error)

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, item StorageItem) (err error)

type StorageItem

type StorageItem struct {
	ID    string   `json:"id,omitempty" cms:"id"`
	Item  string   `json:"item,omitempty" cms:"item,text"`
	Asset []string `json:"asset,omitempty" cms:"asset,asset"`
}

func (StorageItem) RemoveAsset

func (s StorageItem) RemoveAsset(aid string) StorageItem

type StorageItems

type StorageItems []StorageItem

func (StorageItems) FindByAsset

func (s StorageItems) FindByAsset(aid string) *StorageItem

func (StorageItems) FindByItem

func (s StorageItems) FindByItem(iid string) *StorageItem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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