Documentation ¶
Index ¶
- func CreateTempDir() (string, error)
- type Composer
- func (c *Composer) ComposeComponentDefinitions(ctx context.Context, compDef *oscalTypes.ComponentDefinition, baseDir string) error
- func (c *Composer) ComposeComponentValidations(ctx context.Context, compDef *oscalTypes.ComponentDefinition, baseDir string) error
- func (c *Composer) ComposeFromPath(ctx context.Context, path string) (model *oscalTypes.OscalCompleteSchema, err error)
- type Option
- type RenderedContent
- type ResourceStore
- func (s *ResourceStore) AddExisting(resource *oscalTypes.Resource)
- func (s *ResourceStore) AddFetched(resource *oscalTypes.Resource)
- func (s *ResourceStore) AddFromLink(link *oscalTypes.Link, baseDir string) (ids []string, err error)
- func (s *ResourceStore) AllFetched() []oscalTypes.Resource
- func (s *ResourceStore) Get(id string) (*oscalTypes.Resource, bool)
- func (s *ResourceStore) GetExisting(id string) (*oscalTypes.Resource, bool)
- func (s *ResourceStore) GetFetched(id string) (*oscalTypes.Resource, bool)
- func (s *ResourceStore) GetHrefIds(href string) (ids []string, err error)
- func (s *ResourceStore) Has(id string) bool
- func (s *ResourceStore) SetHrefIds(href string, ids []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempDir ¶ added in v0.4.3
CreateTempDir creates a temporary directory to store the composed OSCAL models
Types ¶
type Composer ¶ added in v0.9.0
type Composer struct {
// contains filtered or unexported fields
}
func (*Composer) ComposeComponentDefinitions ¶ added in v0.9.0
func (c *Composer) ComposeComponentDefinitions(ctx context.Context, compDef *oscalTypes.ComponentDefinition, baseDir string) error
ComposeComponentDefinitions composes an OSCAL component definition by adding the remote resources to the back matter and updating with back matter links.
func (*Composer) ComposeComponentValidations ¶ added in v0.9.0
func (c *Composer) ComposeComponentValidations(ctx context.Context, compDef *oscalTypes.ComponentDefinition, baseDir string) error
ComposeComponentValidations compiles the component validations by adding the remote resources to the back matter and updating with back matter links.
func (*Composer) ComposeFromPath ¶ added in v0.9.0
func (c *Composer) ComposeFromPath(ctx context.Context, path string) (model *oscalTypes.OscalCompleteSchema, err error)
ComposeFromPath composes an OSCAL model from a file path
type Option ¶ added in v0.9.0
func WithModelFromLocalPath ¶ added in v0.9.0
TODO: add remote option?
func WithRenderSettings ¶ added in v0.9.0
func WithTemplateRenderer ¶ added in v0.9.0
type RenderedContent ¶ added in v0.9.0
type RenderedContent string
type ResourceStore ¶
type ResourceStore struct {
// contains filtered or unexported fields
}
ResourceStore is a store of resources.
func NewResourceStoreFromBackMatter ¶
func NewResourceStoreFromBackMatter(composer *Composer, backMatter *oscalTypes.BackMatter) *ResourceStore
NewResourceStoreFromBackMatter creates a new resource store from the back matter of a component definition.
func (*ResourceStore) AddExisting ¶
func (s *ResourceStore) AddExisting(resource *oscalTypes.Resource)
AddExisting adds a resource to the store that is already in the back matter.
func (*ResourceStore) AddFetched ¶
func (s *ResourceStore) AddFetched(resource *oscalTypes.Resource)
AddFetched adds a resource to the store that was fetched from a remote source.
func (*ResourceStore) AddFromLink ¶
func (s *ResourceStore) AddFromLink(link *oscalTypes.Link, baseDir string) (ids []string, err error)
AddFromLink adds resources from a link to the store.
func (*ResourceStore) AllFetched ¶
func (s *ResourceStore) AllFetched() []oscalTypes.Resource
AllFetched returns all the resources that were fetched from a remote source.
func (*ResourceStore) Get ¶
func (s *ResourceStore) Get(id string) (*oscalTypes.Resource, bool)
Get returns the resource with the given ID, if it exists.
func (*ResourceStore) GetExisting ¶
func (s *ResourceStore) GetExisting(id string) (*oscalTypes.Resource, bool)
GetExisting returns the resource with the given ID, if it exists.
func (*ResourceStore) GetFetched ¶
func (s *ResourceStore) GetFetched(id string) (*oscalTypes.Resource, bool)
GetFetched returns the resource that was fetched from a remote source with the given ID, if it exists.
func (*ResourceStore) GetHrefIds ¶
func (s *ResourceStore) GetHrefIds(href string) (ids []string, err error)
GetHrefIds gets the resource ids for a given href
func (*ResourceStore) Has ¶
func (s *ResourceStore) Has(id string) bool
Has returns true if the resource store has a resource with the given ID.
func (*ResourceStore) SetHrefIds ¶
func (s *ResourceStore) SetHrefIds(href string, ids []string)
SetHrefIds sets the resource ids for a given href