docs

package
v0.5.61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TypeBook string = "book"
View Source
const TypeChapter string = "chapter"
View Source
const TypeDocs string = "docs"

TypeDocs is the resource string for a Docs resource

View Source
const TypeTask string = "task"

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	types.ResourceMetadata `hcl:",remain"`

	Title    string    `hcl:"title" json:"title"`
	Chapters []Chapter `hcl:"chapters" json:"chapters"`

	// Output parameters
	Index BookIndex `hcl:"index,optional" json:"index"`
}

func (*Book) Process

func (b *Book) Process() error

type BookIndex added in v0.5.40

type BookIndex struct {
	Title    string         `hcl:"title,optional" json:"title"`
	Chapters []ChapterIndex `hcl:"chapters,optional" json:"chapters"`
}

type BookProvider

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

func (*BookProvider) Changed

func (p *BookProvider) Changed() (bool, error)

func (*BookProvider) Create

func (p *BookProvider) Create() error

func (*BookProvider) Destroy

func (p *BookProvider) Destroy() error

func (*BookProvider) Init

func (p *BookProvider) Init(cfg htypes.Resource, l sdk.Logger) error

func (*BookProvider) Lookup

func (p *BookProvider) Lookup() ([]string, error)

func (*BookProvider) Refresh

func (p *BookProvider) Refresh() error

type Chapter

type Chapter struct {
	types.ResourceMetadata `hcl:",remain"`

	Prerequisites []string `hcl:"prerequisites,optional" json:"prerequisites"`

	Title string          `hcl:"title,optional" json:"title,omitempty"`
	Pages []Page          `hcl:"page,block" json:"pages"`
	Tasks map[string]Task `hcl:"tasks,optional" json:"tasks"`

	Index ChapterIndex `hcl:"index,optional" json:"index"`
}

func (*Chapter) Process

func (c *Chapter) Process() error

type ChapterIndex added in v0.5.40

type ChapterIndex struct {
	Title string             `hcl:"title,optional" json:"title,omitempty"`
	Pages []ChapterIndexPage `hcl:"pages" json:"pages"`
}

type ChapterIndexPage added in v0.5.40

type ChapterIndexPage struct {
	Title string `hcl:"title" json:"title"`
	URI   string `hcl:"uri" json:"uri"`
}

type ChapterProvider

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

func (*ChapterProvider) Changed

func (p *ChapterProvider) Changed() (bool, error)

func (*ChapterProvider) Create

func (p *ChapterProvider) Create() error

func (*ChapterProvider) Destroy

func (p *ChapterProvider) Destroy() error

func (*ChapterProvider) Init

func (p *ChapterProvider) Init(cfg htypes.Resource, l sdk.Logger) error

func (*ChapterProvider) Lookup

func (p *ChapterProvider) Lookup() ([]string, error)

func (*ChapterProvider) Refresh

func (p *ChapterProvider) Refresh() error

type Condition

type Condition struct {
	Name        string       `hcl:"id,label" json:"id"`
	Description string       `hcl:"description" json:"description"`
	Checks      []Validation `hcl:"check,block" json:"checks"`
	Solves      []Validation `hcl:"solve,block" json:"solves,omitempty"`
	Setups      []Validation `hcl:"setup,block" json:"setups,omitempty"`
	Cleanups    []Validation `hcl:"cleanup,block" json:"cleanups,omitempty"`
	Status      string       `hcl:"status,optional" json:"status"`
}

type Config added in v0.5.40

type Config struct {
	Timeout          int    `hcl:"timeout,optional" json:"timeout"`
	Target           string `hcl:"target,optional" json:"target,omitempty"`
	User             string `hcl:"user,optional" json:"user,omitempty"`
	Group            string `hcl:"group,optional" json:"group,omitempty"`
	WorkingDirectory string `hcl:"working_directory,optional" json:"working_directory,omitempty"`
}

type Docs

type Docs struct {
	types.ResourceMetadata `hcl:",remain"`

	Networks ctypes.NetworkAttachments `hcl:"network,block" json:"networks,omitempty"` // Attach to the correct network // only when Image is specified

	Image *ctypes.Image `hcl:"image,block" json:"image,omitempty"` // image to use for the container

	Content []Book `hcl:"content" json:"content"`

	Port          int  `hcl:"port,optional" json:"port"`
	OpenInBrowser bool `hcl:"open_in_browser,optional" json:"open_in_browser"` // When a host port is defined open the location in a browser

	Assets string `hcl:"assets,optional" json:"assets,omitempty"`

	// ContainerName is the fully qualified resource name for the container, this can be used
	// to access the container from other sources
	ContainerName string `hcl:"fqdn,optional" json:"fqdn,omitempty"`

	// ContentChecksum is the checksum of the content directory, this is used to determine if the
	// docs need to be recreated
	ContentChecksum string `hcl:"content_checksum,optional" json:"content_checksum,omitempty"`
}

Docs allows the running of a Docusaurus container which can be used for online tutorials or documentation

func (*Docs) Process

func (d *Docs) Process() error

type DocsConfig

type DocsConfig struct {
	DefaultPath string `json:"defaultPath"`
}

type DocsProvider

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

Docs defines a provider for creating documentation containers

func (*DocsProvider) Changed

func (p *DocsProvider) Changed() (bool, error)

func (*DocsProvider) Create

func (p *DocsProvider) Create() error

Create a new documentation container

func (*DocsProvider) Destroy

func (p *DocsProvider) Destroy() error

Destroy the documentation container

func (*DocsProvider) Init

func (p *DocsProvider) Init(cfg htypes.Resource, l sdk.Logger) error

func (*DocsProvider) Lookup

func (p *DocsProvider) Lookup() ([]string, error)

Lookup the ID of the documentation container

func (*DocsProvider) Refresh

func (p *DocsProvider) Refresh() error
type Logo struct {
	URL    string `hcl:"url" json:"url"`
	Width  int    `hcl:"width" json:"width"`
	Height int    `hcl:"height" json:"height"`
}

type Page

type Page struct {
	Name    string `hcl:"name,label" json:"name"`
	Content string `hcl:"content" json:"content"`
}

type Progress

type Progress struct {
	ID            string              `json:"id"`
	Prerequisites []string            `json:"prerequisites"`
	Conditions    []ProgressCondition `json:"conditions"`
	Status        string              `json:"status"`
}

type ProgressCondition

type ProgressCondition struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	Status      string `json:"status"`
}

type State added in v0.5.40

type State struct {
	Index struct {
		Title    string `json:"title"`
		Chapters []struct {
			Title string `json:"title,omitempty"`
			Pages []struct {
				Title string `json:"title"`
				URI   string `json:"uri"`
			} `json:"pages"`
		} `json:"chapters"`
	} `json:"index"`

	Progress []struct {
		ID            string   `json:"id"`
		Prerequisites []string `json:"prerequisites"`
		Conditions    []struct {
			ID          string `json:"id"`
			Description string `json:"description"`
			Status      string `json:"status"`
		} `json:"conditions"`
		Status string `json:"status"`
	} `json:"progress"`
}

type Task

type Task struct {
	types.ResourceMetadata `hcl:",remain"`

	Prerequisites []string    `hcl:"prerequisites,optional" json:"prerequisites"`
	Config        *Config     `hcl:"config,block" json:"config,omitempty"`
	Conditions    []Condition `hcl:"condition,block" json:"conditions"`
	Status        string      `hcl:"status,optional" json:"status"`
}

func (*Task) Process

func (t *Task) Process() error

type Validation

type Validation struct {
	Script         string `hcl:"script" json:"script"`
	FailureMessage string `hcl:"failure_message,optional" json:"failure_message,omitempty"`
	SuccessMessage string `hcl:"success_message,optional" json:"success_message,omitempty"`
	Config         `hcl:",remain"`
}

Jump to

Keyboard shortcuts

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