configstore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("backend not found")
	ErrConflict = errors.New("backend revision conflict")
)

Functions

This section is empty.

Types

type Event

type Event struct {
	ID         int64     `json:"id"`
	BackendID  string    `json:"backend_id,omitempty"`
	SourceKind string    `json:"source_kind,omitempty"`
	SourceID   string    `json:"source_id,omitempty"`
	Actor      string    `json:"actor"`
	Action     string    `json:"action"`
	Success    bool      `json:"success"`
	Message    string    `json:"message,omitempty"`
	Revision   int64     `json:"revision,omitempty"`
	CreatedAt  time.Time `json:"created_at"`
}

type HTTPToolRecord

type HTTPToolRecord struct {
	GroupID   string
	Config    httptool.ToolConfig
	Revision  int64
	CreatedAt time.Time
	UpdatedAt time.Time
}

type OpenAPIImportRecord

type OpenAPIImportRecord struct {
	GroupID            string
	Config             openapiimport.ImportConfig
	Document           []byte
	SHA256             string
	Revision           int64
	CreatedAt          time.Time
	UpdatedAt          time.Time
	LastRefreshAt      *time.Time
	LastRefreshOK      *bool
	LastRefreshMessage string
}

type Record

type Record struct {
	Config      config.BackendConfig
	Enabled     bool
	Revision    int64
	CreatedAt   time.Time
	UpdatedAt   time.Time
	LastProbeAt *time.Time
	LastProbeOK *bool
	LastProbe   json.RawMessage
}

type Store

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

func Open

func Open(ctx context.Context, path string, key []byte) (*Store, error)

func OpenReadOnly

func OpenReadOnly(ctx context.Context, path string, key []byte) (*Store, error)

func (*Store) Bootstrap

func (s *Store) Bootstrap(ctx context.Context, backends []config.BackendConfig) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Create

func (s *Store) Create(ctx context.Context, record Record) (Record, error)

func (*Store) CreateHTTPTool

func (s *Store) CreateHTTPTool(ctx context.Context, record HTTPToolRecord) (HTTPToolRecord, error)

func (*Store) CreateOpenAPIImport

func (s *Store) CreateOpenAPIImport(ctx context.Context, record OpenAPIImportRecord, tools []HTTPToolRecord) (OpenAPIImportRecord, []HTTPToolRecord, error)

func (*Store) CreateToolGroup

func (s *Store) CreateToolGroup(ctx context.Context, record ToolGroupRecord) (ToolGroupRecord, error)

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string, expectedRevision int64) error

func (*Store) DeleteHTTPTool

func (s *Store) DeleteHTTPTool(ctx context.Context, groupID, name string, expected int64) error

func (*Store) DeleteOpenAPIImport

func (s *Store) DeleteOpenAPIImport(ctx context.Context, groupID, id string, expected int64) error

func (*Store) DeleteToolGroup

func (s *Store) DeleteToolGroup(ctx context.Context, id string, expected int64) error

func (*Store) Events

func (s *Store) Events(ctx context.Context, limit int) ([]Event, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (Record, error)

func (*Store) GetHTTPTool

func (s *Store) GetHTTPTool(ctx context.Context, groupID, name string) (HTTPToolRecord, error)

func (*Store) GetOpenAPIImport

func (s *Store) GetOpenAPIImport(ctx context.Context, groupID, id string) (OpenAPIImportRecord, error)

func (*Store) GetToolGroup

func (s *Store) GetToolGroup(ctx context.Context, id string) (ToolGroupRecord, error)

func (*Store) Initialized

func (s *Store) Initialized(ctx context.Context) (bool, error)

func (*Store) List

func (s *Store) List(ctx context.Context) ([]Record, error)

func (*Store) ListHTTPTools

func (s *Store) ListHTTPTools(ctx context.Context, groupID string) ([]HTTPToolRecord, error)

func (*Store) ListOpenAPIImports

func (s *Store) ListOpenAPIImports(ctx context.Context, groupID string) ([]OpenAPIImportRecord, error)

func (*Store) ListToolGroups

func (s *Store) ListToolGroups(ctx context.Context) ([]ToolGroupRecord, error)

func (*Store) MarkOpenAPIRefreshFailure

func (s *Store) MarkOpenAPIRefreshFailure(ctx context.Context, groupID, id string, expected int64, message string) error

func (*Store) MarkOpenAPIRefreshSuccess

func (s *Store) MarkOpenAPIRefreshSuccess(ctx context.Context, groupID, id string, expected int64) error

func (*Store) RecordFailure

func (s *Store) RecordFailure(ctx context.Context, backendID, action, message string)

func (*Store) ReplaceOpenAPIImport

func (s *Store) ReplaceOpenAPIImport(ctx context.Context, record OpenAPIImportRecord, expected int64, tools []HTTPToolRecord, action string) (OpenAPIImportRecord, []HTTPToolRecord, error)

func (*Store) Update

func (s *Store) Update(ctx context.Context, record Record, expectedRevision int64) (Record, error)

func (*Store) UpdateHTTPTool

func (s *Store) UpdateHTTPTool(ctx context.Context, record HTTPToolRecord, expected int64) (HTTPToolRecord, error)

func (*Store) UpdateProbe

func (s *Store) UpdateProbe(ctx context.Context, id string, ok bool, result json.RawMessage) error

func (*Store) UpdateToolGroup

func (s *Store) UpdateToolGroup(ctx context.Context, record ToolGroupRecord, expected int64) (ToolGroupRecord, error)

func (*Store) UpdateToolGroupProbe

func (s *Store) UpdateToolGroupProbe(ctx context.Context, id string, ok bool, result json.RawMessage) error

type ToolGroupRecord

type ToolGroupRecord struct {
	Config      httptool.GroupConfig
	Revision    int64
	CreatedAt   time.Time
	UpdatedAt   time.Time
	LastProbeAt *time.Time
	LastProbeOK *bool
	LastProbe   json.RawMessage
}

Jump to

Keyboard shortcuts

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