rest

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePageToRest added in v0.1.4

func BasePageToRest(page *entity.PageBase) openapi.Page

func FormatFromRest

func FormatFromRest(format []openapi.Format) ([]entity.Format, error)

func FormatToRest

func FormatToRest(format entity.Format) openapi.Format

func PageToRest

func PageToRest(page *entity.Page) openapi.Page

func PageToRestWithResults

func PageToRestWithResults(page *entity.Page) openapi.PageWithResults

func StatusToRest

func StatusToRest(s entity.Status) openapi.Status

Types

type Pages

type Pages interface {
	ListAll(ctx context.Context) ([]*entity.Page, error)
	Save(ctx context.Context, site *entity.Page) error
	Get(ctx context.Context, id uuid.UUID) (*entity.Page, error)
	GetFile(ctx context.Context, pageID, fileID uuid.UUID) (*entity.File, error)
}

type Service

type Service struct {
	openapi.UnimplementedHandler
	// contains filtered or unexported fields
}

func NewService

func NewService(pages Pages, ch chan *entity.Page, processor entity.Processor) *Service

func (*Service) AddPage

func (*Service) GetFile

func (s *Service) GetFile(ctx context.Context, params openapi.GetFileParams) (openapi.GetFileRes, error)

func (*Service) GetPage

func (s *Service) GetPage(ctx context.Context, params openapi.GetPageParams) (openapi.GetPageRes, error)

func (*Service) GetPages

func (s *Service) GetPages(ctx context.Context) (openapi.Pages, error)

func (*Service) NewError

func (s *Service) NewError(_ context.Context, err error) *openapi.ErrorStatusCode

type UI added in v0.1.3

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

func NewUI added in v0.1.3

func NewUI(cfg config.UI) *UI

func (*UI) ServeHTTP added in v0.1.3

func (u *UI) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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