ghrepository

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MPL-2.0 Imports: 3 Imported by: 1

README

ghrepository

Package ghrepository provides methods to create github_repository terraform resource

Functions

func New

func New(conf ConfigProvider) *hclwrite.Block

New returns the github_repository terraform resource as hclwrite.Block

It returns nil if resource is empty.

valGen := gh2tf.NewValueGenerator()
repoName := "repository_name"
visibility := "var.default_visibility"
trueBool := "true"
falseBool := "false"
topics := []string{"topic"}
description := "local.my_local"
homepageUrl := "homepage-url"
mergeCommitTitle := "merge-commit-title"
mergeCommitMessage := "merge-commit-message"
squashMergeCommitTitle := "squash-merge-commit-title"
squashMergeCommitMessage := "squash-merge-commit-message"
repoPageSourcePath := "branch"
repoPageSourceSource := "source"
templateOwner := "owner"
templateRepository := "repository"
res := &ghrepository.Config{
    valGen,
    "repository-id",
    &repoName,
    &visibility,
    &falseBool,
    &description,
    &falseBool,
    &trueBool,
    &falseBool,
    &trueBool,
    &falseBool,
    &homepageUrl,
    &topics,

    &trueBool,
    &falseBool,
    &trueBool,
    &falseBool,
    &trueBool,
    &mergeCommitTitle,
    &mergeCommitMessage,
    &squashMergeCommitTitle,
    &squashMergeCommitMessage,
    &falseBool,
    &trueBool,
    &ghrepository.PagesConfig{
        &ghrepository.PagesSourceConfig{valGen, &repoPageSourcePath, &repoPageSourceSource},
    },
    &ghrepository.TemplateConfig{valGen, &templateOwner, &templateRepository},
}

hclFile := hclwrite.NewEmptyFile()
hclFile.Body().AppendBlock(ghrepository.New(res))
fmt.Println(string(hclFile.Bytes()))

Output:

resource "github_repository" "repository-id" {
  name      = "repository_name"
  auto_init = false

  visibility  = var.default_visibility
  description = local.my_local

  template {
    owner      = "owner"
    repository = "repository"
  }

  topics       = ["topic"]
  homepage_url = "homepage-url"

  pages {
    source {
      branch = "branch"
      path   = "source"
    }
  }

  has_issues    = true
  has_projects  = false
  has_wiki      = true
  has_downloads = false

  allow_merge_commit     = false
  allow_rebase_merge     = true
  allow_squash_merge     = false
  allow_auto_merge       = true
  delete_branch_on_merge = false

  merge_commit_title          = "merge-commit-title"
  merge_commit_message        = "merge-commit-message"
  squash_merge_commit_title   = "squash-merge-commit-title"
  squash_merge_commit_message = "squash-merge-commit-message"

  vulnerability_alerts = true

  archived           = false
  archive_on_destroy = true
}
func NewPagesSignature

func NewPagesSignature(conf PagesConfigProvider) *tfsig.BlockSignature

NewPagesSignature returns the github_repository->pages terraform block as tfsig.BlockSignature

It returns nil if resource is empty.

func NewPagesSourceSignature

func NewPagesSourceSignature(conf PagesSourceConfigProvider) *tfsig.BlockSignature

NewPagesSourceSignature returns the github_repository->pages->source terraform block as tfsig.BlockSignature

It returns nil if resource is empty.

func NewSignature

func NewSignature(conf ConfigProvider) *tfsig.BlockSignature

NewSignature returns the github_branch_protection terraform resource as tfsig.BlockSignature

It returns nil if resource is empty.

func NewTemplateSignature

func NewTemplateSignature(conf TemplateConfigProvider) *tfsig.BlockSignature

NewTemplateSignature returns the github_repository->template terraform block as tfsig.BlockSignature

It returns nil if resource is empty.

Types

type Config

type Config struct { ... }

Config is the default implementation of ConfigProvider.

func (*Config) AllowAutoMergeValue

func (c *Config) AllowAutoMergeValue() *cty.Value

AllowAutoMergeValue returns the provided github_repository allow_auto_merge attribute value as cty.Bool or nil if not provided.

func (*Config) AllowMergeCommitValue

func (c *Config) AllowMergeCommitValue() *cty.Value

AllowMergeCommitValue returns the provided github_repository allow_merge_commit attribute value as cty.Bool or nil if not provided.

func (*Config) AllowRebaseMergeValue

func (c *Config) AllowRebaseMergeValue() *cty.Value

AllowRebaseMergeValue returns the provided github_repository allow_rebase_merge attribute value as cty.Bool or nil if not provided.

func (*Config) AllowSquashMergeValue

func (c *Config) AllowSquashMergeValue() *cty.Value

AllowSquashMergeValue returns the provided github_repository allow_squash_merge attribute value as cty.Bool or nil if not provided.

func (*Config) ArchiveOnDestroyValue

func (c *Config) ArchiveOnDestroyValue() *cty.Value

ArchiveOnDestroyValue returns the provided github_repository archive_on_destroy attribute value as cty.Bool or nil if not provided.

func (*Config) ArchivedValue

func (c *Config) ArchivedValue() *cty.Value

ArchivedValue returns the provided github_repository archived attribute value as cty.Bool or nil if not provided.

func (*Config) AutoInitValue

func (c *Config) AutoInitValue() *cty.Value

AutoInitValue returns the provided github_repository auto_init attribute value as cty.Bool or nil if not provided.

func (*Config) DeleteBranchOnMergeValue

func (c *Config) DeleteBranchOnMergeValue() *cty.Value

DeleteBranchOnMergeValue returns the provided github_repository delete_branch_on_merge attribute value as cty.Bool or nil if not provided.

func (*Config) DescriptionValue

func (c *Config) DescriptionValue() *cty.Value

DescriptionValue returns the provided github_repository description attribute value as cty.String or nil if not provided.

func (*Config) HasDownloadsValue

func (c *Config) HasDownloadsValue() *cty.Value

HasDownloadsValue returns the provided github_repository has_downloads attribute value as cty.Bool or nil if not provided.

func (*Config) HasIssuesValue

func (c *Config) HasIssuesValue() *cty.Value

HasIssuesValue returns the provided github_repository has_issues attribute value as cty.Bool or nil if not provided.

func (*Config) HasProjectsValue

func (c *Config) HasProjectsValue() *cty.Value

HasProjectsValue returns the provided github_repository has_projects attribute value as cty.Bool or nil if not provided.

func (*Config) HasResource

func (c *Config) HasResource() bool

HasResource returns true in case at least Name value exists, else false.

func (*Config) HasWikiValue

func (c *Config) HasWikiValue() *cty.Value

HasWikiValue returns the provided github_repository has_wiki attribute value as cty.Bool or nil if not provided.

func (*Config) HomepageUrlValue

func (c *Config) HomepageUrlValue() *cty.Value

HomepageUrlValue returns the provided github_repository homepage_url attribute value as cty.String or nil if not provided.

func (*Config) MergeCommitMessageValue

func (c *Config) MergeCommitMessageValue() *cty.Value

MergeCommitMessageValue returns the provided github_repository merge_commit_message attribute value as cty.String or nil if not provided.

func (*Config) MergeCommitTitleValue

func (c *Config) MergeCommitTitleValue() *cty.Value

MergeCommitTitleValue returns the provided github_repository merge_commit_title attribute value as cty.String or nil if not provided.

func (*Config) NameValue

func (c *Config) NameValue() *cty.Value

NameValue returns the provided github_repository name attribute value as cty.String or nil if not provided.

func (*Config) PagesConfig

func (c *Config) PagesConfig() PagesConfigProvider

PagesConfig returns the provided PagesConfigProvider.

func (*Config) ResourceIdentifier

func (c *Config) ResourceIdentifier() string

ResourceIdentifier returns the provided terraform resource identifier.

func (*Config) SquashMergeCommitMessageValue

func (c *Config) SquashMergeCommitMessageValue() *cty.Value

SquashMergeCommitMessageValue returns the provided github_repository squash_merge_commit_message attribute value as cty.String or nil if not provided.

func (*Config) SquashMergeCommitTitleValue

func (c *Config) SquashMergeCommitTitleValue() *cty.Value

SquashMergeCommitTitleValue returns the provided github_repository squash_merge_commit_title attribute value as cty.String or nil if not provided.

func (*Config) TemplateConfig

func (c *Config) TemplateConfig() TemplateConfigProvider

TemplateConfig returns the provided TemplateConfigProvider.

func (*Config) TopicsValue

func (c *Config) TopicsValue() *cty.Value

TopicsValue returns the provided github_repository topics attribute value as cty.List of cty.String or nil if not provided.

func (*Config) VisibilityValue

func (c *Config) VisibilityValue() *cty.Value

VisibilityValue returns the provided github_repository visibility attribute value as cty.String or nil if not provided.

func (*Config) VulnerabilityAlertsValue

func (c *Config) VulnerabilityAlertsValue() *cty.Value

VulnerabilityAlertsValue returns the provided github_repository vulnerabililty_alerts attribute value as cty.Bool or nil if not provided.

type ConfigProvider

type ConfigProvider interface { ... }

ConfigProvider defines required methods to be used when creating github_repository terraform resource.

type PagesConfig

type PagesConfig struct { ... }

PagesConfig is the default implementation of PagesConfigProvider.

func (*PagesConfig) HasResource

func (c *PagesConfig) HasResource() bool

HasResource returns true in case Source config exists and has resource, else false.

func (*PagesConfig) SourceConfig

func (c *PagesConfig) SourceConfig() PagesSourceConfigProvider

SourceConfig returns the provided PagesSourceConfigProvider.

type PagesConfigProvider

type PagesConfigProvider interface { ... }

PagesConfigProvider defines required methods to be used when creating github_repository->pages terraform block.

type PagesSourceConfig

type PagesSourceConfig struct { ... }

PagesSourceConfig is the default implementation of PagesSourceConfigProvider.

func (*PagesSourceConfig) BranchValue

func (c *PagesSourceConfig) BranchValue() *cty.Value

BranchValue returns the provided github_repository->pages->source branch attribute value as cty.String or nil if not provided.

func (*PagesSourceConfig) HasResource

func (c *PagesSourceConfig) HasResource() bool

HasResource returns true in case Branch value exists, else false.

func (*PagesSourceConfig) PathValue

func (c *PagesSourceConfig) PathValue() *cty.Value

PathValue returns the provided github_repository->pages->source path attribute value as cty.String or nil if not provided.

type PagesSourceConfigProvider

type PagesSourceConfigProvider interface { ... }

PagesSourceConfigProvider defines required methods to be used when creating github_repository->pages->source terraform block.

type TemplateConfig

type TemplateConfig struct { ... }

TemplateConfig is the default implementation of TemplateConfigProvider.

func (*TemplateConfig) HasResource

func (c *TemplateConfig) HasResource() bool

HasResource returns true in case both Repository and Owner values exist, else false.

func (*TemplateConfig) OwnerValue

func (c *TemplateConfig) OwnerValue() *cty.Value

OwnerValue returns the provided github_repository->template owner attribute value as cty.String or nil if not provided.

func (*TemplateConfig) RepositoryValue

func (c *TemplateConfig) RepositoryValue() *cty.Value

RepositoryValue returns the provided github_repository->template repository attribute value as cty.String or nil if not provided.

type TemplateConfigProvider

type TemplateConfigProvider interface { ... }

TemplateConfigProvider defines required methods to be used when creating github_repository->template terraform block.


Readme created from Go doc with goreadme

Documentation

Overview

Package ghrepository provides methods to create `github_repository` terraform resource

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf ConfigProvider) *hclwrite.Block

New returns the `github_repository` terraform resource as `hclwrite.Block`

It returns `nil` if resource is empty.

Example
valGen := gh2tf.NewValueGenerator()
repoName := "repository_name"
visibility := "var.default_visibility"
trueBool := "true"
falseBool := "false"
topics := []string{"topic"}
description := "local.my_local"
homepageUrl := "homepage-url"
mergeCommitTitle := "merge-commit-title"
mergeCommitMessage := "merge-commit-message"
squashMergeCommitTitle := "squash-merge-commit-title"
squashMergeCommitMessage := "squash-merge-commit-message"
repoPageSourcePath := "branch"
repoPageSourceSource := "source"
templateOwner := "owner"
templateRepository := "repository"
res := &ghrepository.Config{
	valGen,
	"repository-id",
	&repoName,
	&visibility,
	&falseBool,
	&description,
	&falseBool,
	&trueBool,
	&falseBool,
	&trueBool,
	&falseBool,
	&homepageUrl,
	&topics,

	&trueBool,
	&falseBool,
	&trueBool,
	&falseBool,
	&trueBool,
	&mergeCommitTitle,
	&mergeCommitMessage,
	&squashMergeCommitTitle,
	&squashMergeCommitMessage,
	&falseBool,
	&trueBool,
	&ghrepository.PagesConfig{
		&ghrepository.PagesSourceConfig{valGen, &repoPageSourcePath, &repoPageSourceSource},
	},
	&ghrepository.TemplateConfig{valGen, &templateOwner, &templateRepository},
}

hclFile := hclwrite.NewEmptyFile()
hclFile.Body().AppendBlock(ghrepository.New(res))
fmt.Println(string(hclFile.Bytes()))
Output:

resource "github_repository" "repository-id" {
  name      = "repository_name"
  auto_init = false

  visibility  = var.default_visibility
  description = local.my_local

  template {
    owner      = "owner"
    repository = "repository"
  }

  topics       = ["topic"]
  homepage_url = "homepage-url"

  pages {
    source {
      branch = "branch"
      path   = "source"
    }
  }

  has_issues    = true
  has_projects  = false
  has_wiki      = true
  has_downloads = false

  allow_merge_commit     = false
  allow_rebase_merge     = true
  allow_squash_merge     = false
  allow_auto_merge       = true
  delete_branch_on_merge = false

  merge_commit_title          = "merge-commit-title"
  merge_commit_message        = "merge-commit-message"
  squash_merge_commit_title   = "squash-merge-commit-title"
  squash_merge_commit_message = "squash-merge-commit-message"

  vulnerability_alerts = true

  archived           = false
  archive_on_destroy = true
}

func NewPagesSignature

func NewPagesSignature(conf PagesConfigProvider) *tfsig.BlockSignature

NewPagesSignature returns the `github_repository->pages` terraform block as `tfsig.BlockSignature`

It returns `nil` if resource is empty.

func NewPagesSourceSignature

func NewPagesSourceSignature(conf PagesSourceConfigProvider) *tfsig.BlockSignature

NewPagesSourceSignature returns the `github_repository->pages->source` terraform block as `tfsig.BlockSignature`

It returns `nil` if resource is empty.

func NewSignature

func NewSignature(conf ConfigProvider) *tfsig.BlockSignature

NewSignature returns the `github_branch_protection` terraform resource as `tfsig.BlockSignature`

It returns `nil` if resource is empty.

func NewTemplateSignature

func NewTemplateSignature(conf TemplateConfigProvider) *tfsig.BlockSignature

NewTemplateSignature returns the `github_repository->template` terraform block as `tfsig.BlockSignature`

It returns `nil` if resource is empty.

Types

type Config

type Config struct {
	ValueGenerator tfsig.ValueGenerator
	Identifier     string

	Name                     *string
	Visibility               *string
	Archived                 *string
	Description              *string
	AutoInit                 *string
	HasIssues                *string
	HasProjects              *string
	HasWiki                  *string
	HasDownloads             *string
	HomepageUrl              *string
	Topics                   *[]string
	VulnerabilityAlerts      *string
	AllowMergeCommit         *string
	AllowRebaseMerge         *string
	AllowSquashMerge         *string
	AllowAutoMerge           *string
	MergeCommitTitle         *string
	MergeCommitMessage       *string
	SquashMergeCommitTitle   *string
	SquashMergeCommitMessage *string
	DeleteBranchOnMerge      *string
	ArchiveOnDestroy         *string
	Page                     *PagesConfig
	Template                 *TemplateConfig
}

Config is the default implementation of `ConfigProvider`.

func (*Config) AllowAutoMergeValue

func (c *Config) AllowAutoMergeValue() *cty.Value

AllowAutoMergeValue returns the provided `github_repository` `allow_auto_merge` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) AllowMergeCommitValue

func (c *Config) AllowMergeCommitValue() *cty.Value

AllowMergeCommitValue returns the provided `github_repository` `allow_merge_commit` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) AllowRebaseMergeValue

func (c *Config) AllowRebaseMergeValue() *cty.Value

AllowRebaseMergeValue returns the provided `github_repository` `allow_rebase_merge` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) AllowSquashMergeValue

func (c *Config) AllowSquashMergeValue() *cty.Value

AllowSquashMergeValue returns the provided `github_repository` `allow_squash_merge` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) ArchiveOnDestroyValue

func (c *Config) ArchiveOnDestroyValue() *cty.Value

ArchiveOnDestroyValue returns the provided `github_repository` `archive_on_destroy` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) ArchivedValue

func (c *Config) ArchivedValue() *cty.Value

ArchivedValue returns the provided `github_repository` `archived` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) AutoInitValue

func (c *Config) AutoInitValue() *cty.Value

AutoInitValue returns the provided `github_repository` `auto_init` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) DeleteBranchOnMergeValue

func (c *Config) DeleteBranchOnMergeValue() *cty.Value

DeleteBranchOnMergeValue returns the provided `github_repository` `delete_branch_on_merge` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) DescriptionValue

func (c *Config) DescriptionValue() *cty.Value

DescriptionValue returns the provided `github_repository` `description` attribute value as `cty.String` or `nil` if not provided.

func (*Config) HasDownloadsValue

func (c *Config) HasDownloadsValue() *cty.Value

HasDownloadsValue returns the provided `github_repository` `has_downloads` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) HasIssuesValue

func (c *Config) HasIssuesValue() *cty.Value

HasIssuesValue returns the provided `github_repository` `has_issues` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) HasProjectsValue

func (c *Config) HasProjectsValue() *cty.Value

HasProjectsValue returns the provided `github_repository` `has_projects` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) HasResource

func (c *Config) HasResource() bool

HasResource returns `true` in case at least `Name` value exists, else `false`.

func (*Config) HasWikiValue

func (c *Config) HasWikiValue() *cty.Value

HasWikiValue returns the provided `github_repository` `has_wiki` attribute value as `cty.Bool` or `nil` if not provided.

func (*Config) HomepageUrlValue

func (c *Config) HomepageUrlValue() *cty.Value

HomepageUrlValue returns the provided `github_repository` `homepage_url` attribute value as `cty.String` or `nil` if not provided.

func (*Config) MergeCommitMessageValue

func (c *Config) MergeCommitMessageValue() *cty.Value

MergeCommitMessageValue returns the provided `github_repository` `merge_commit_message` attribute value as `cty.String` or `nil` if not provided.

func (*Config) MergeCommitTitleValue

func (c *Config) MergeCommitTitleValue() *cty.Value

MergeCommitTitleValue returns the provided `github_repository` `merge_commit_title` attribute value as `cty.String` or `nil` if not provided.

func (*Config) NameValue

func (c *Config) NameValue() *cty.Value

NameValue returns the provided `github_repository` `name` attribute value as `cty.String` or `nil` if not provided.

func (*Config) PagesConfig

func (c *Config) PagesConfig() PagesConfigProvider

PagesConfig returns the provided `PagesConfigProvider`.

func (*Config) ResourceIdentifier

func (c *Config) ResourceIdentifier() string

ResourceIdentifier returns the provided terraform resource identifier.

func (*Config) SquashMergeCommitMessageValue

func (c *Config) SquashMergeCommitMessageValue() *cty.Value

SquashMergeCommitMessageValue returns the provided `github_repository` `squash_merge_commit_message` attribute value as `cty.String` or `nil` if not provided.

func (*Config) SquashMergeCommitTitleValue

func (c *Config) SquashMergeCommitTitleValue() *cty.Value

SquashMergeCommitTitleValue returns the provided `github_repository` `squash_merge_commit_title` attribute value as `cty.String` or `nil` if not provided.

func (*Config) TemplateConfig

func (c *Config) TemplateConfig() TemplateConfigProvider

TemplateConfig returns the provided `TemplateConfigProvider`.

func (*Config) TopicsValue

func (c *Config) TopicsValue() *cty.Value

TopicsValue returns the provided `github_repository` `topics` attribute value as `cty.List` of `cty.String` or `nil` if not provided.

func (*Config) VisibilityValue

func (c *Config) VisibilityValue() *cty.Value

VisibilityValue returns the provided `github_repository` `visibility` attribute value as `cty.String` or `nil` if not provided.

func (*Config) VulnerabilityAlertsValue

func (c *Config) VulnerabilityAlertsValue() *cty.Value

VulnerabilityAlertsValue returns the provided `github_repository` `vulnerabililty_alerts` attribute value as `cty.Bool` or `nil` if not provided.

type ConfigProvider

type ConfigProvider interface {
	// HasResource will indicate if resource has to be created (return `true` for instance to always create the
	// resource even if empty)
	HasResource() bool
	// ResourceIdentifier returns the resource identifier
	ResourceIdentifier() string

	// NameValue return the `github_repository` `name` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	NameValue() *cty.Value
	// VisibilityValue return the `github_repository` `visbility` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	VisibilityValue() *cty.Value
	// ArchivedValue return the `github_repository` `archived` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	ArchivedValue() *cty.Value
	// DescriptionValue return the `github_repository` `description` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	DescriptionValue() *cty.Value
	// AutoInitValue return the `github_repository` `auto_init` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	AutoInitValue() *cty.Value
	// HasIssuesValue return the `github_repository` `has_issues` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	HasIssuesValue() *cty.Value
	// HasProjectsValue return the `github_repository` `has_projects` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	HasProjectsValue() *cty.Value
	// HasWikiValue return the `github_repository` `has_wiki` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	HasWikiValue() *cty.Value
	// HasDownloadsValue return the `github_repository` `has_downloads` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	HasDownloadsValue() *cty.Value
	// HomepageUrlValue return the `github_repository` `homepage_url` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	HomepageUrlValue() *cty.Value
	// TopicsValue return the `github_repository` `topics` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	TopicsValue() *cty.Value
	// VulnerabilityAlertsValue return the `github_repository` `vulnerability` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	VulnerabilityAlertsValue() *cty.Value
	// AllowMergeCommitValue return the `github_repository` `allow_merge_commit` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	AllowMergeCommitValue() *cty.Value
	// AllowRebaseMergeValue return the `github_repository` `allow_rebase_merge` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	AllowRebaseMergeValue() *cty.Value
	// AllowSquashMergeValue return the `github_repository` `allow_squash_merge` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	AllowSquashMergeValue() *cty.Value
	// AllowAutoMergeValue return the `github_repository` `allow_auto_merge` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	AllowAutoMergeValue() *cty.Value
	// MergeCommitTitleValue return the `github_repository` `merge_commit_title` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	MergeCommitTitleValue() *cty.Value
	// MergeCommitMessageValue return the `github_repository` `merge_commit_message` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	MergeCommitMessageValue() *cty.Value
	// SquashMergeCommitTitleValue return the `github_repository` `squash_merge_commit_title` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	SquashMergeCommitTitleValue() *cty.Value
	// SquashMergeCommitMessageValue return the `github_repository` `squash_merge_commit_message` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	SquashMergeCommitMessageValue() *cty.Value
	// DeleteBranchOnMergeValue return the `github_repository` `delete_branch_on_merge` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	DeleteBranchOnMergeValue() *cty.Value
	// ArchiveOnDestroyValue return the `github_repository` `archive_on_destroy` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	ArchiveOnDestroyValue() *cty.Value

	// PagesConfig return the config provider for `github_repository->pages` block
	PagesConfig() PagesConfigProvider
	// TemplateConfig return the config provider for `github_repository->template` block
	TemplateConfig() TemplateConfigProvider
}

ConfigProvider defines required methods to be used when creating `github_repository` terraform resource.

type PagesConfig

type PagesConfig struct {
	Source *PagesSourceConfig
}

PagesConfig is the default implementation of `PagesConfigProvider`.

func (*PagesConfig) HasResource

func (c *PagesConfig) HasResource() bool

HasResource returns `true` in case `Source` config exists and has resource, else `false`.

func (*PagesConfig) SourceConfig

func (c *PagesConfig) SourceConfig() PagesSourceConfigProvider

SourceConfig returns the provided `PagesSourceConfigProvider`.

type PagesConfigProvider

type PagesConfigProvider interface {
	// HasResource will indicate if resource has to be created (return `true` for instance to always create the
	// resource even if empty)
	HasResource() bool

	// SourceConfig return the config provider for `github_repository->pages->source` block
	SourceConfig() PagesSourceConfigProvider
}

PagesConfigProvider defines required methods to be used when creating `github_repository->pages` terraform block.

type PagesSourceConfig

type PagesSourceConfig struct {
	ValueGenerator tfsig.ValueGenerator
	Branch         *string
	Path           *string
}

PagesSourceConfig is the default implementation of `PagesSourceConfigProvider`.

func (*PagesSourceConfig) BranchValue

func (c *PagesSourceConfig) BranchValue() *cty.Value

BranchValue returns the provided `github_repository->pages->source` `branch` attribute value as `cty.String` or `nil` if not provided.

func (*PagesSourceConfig) HasResource

func (c *PagesSourceConfig) HasResource() bool

HasResource returns `true` in case `Branch` value exists, else `false`.

func (*PagesSourceConfig) PathValue

func (c *PagesSourceConfig) PathValue() *cty.Value

PathValue returns the provided `github_repository->pages->source` `path` attribute value as `cty.String` or `nil` if not provided.

type PagesSourceConfigProvider

type PagesSourceConfigProvider interface {
	// HasResource will indicate if resource has to be created (return `true` for instance to always create the
	// resource even if empty)
	HasResource() bool

	// BranchValue return the `github_repository->pages->source` `branch` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	BranchValue() *cty.Value

	// PathValue return the `github_repository->pages->source` `path` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	PathValue() *cty.Value
}

PagesSourceConfigProvider defines required methods to be used when creating `github_repository->pages->source` terraform block.

type TemplateConfig

type TemplateConfig struct {
	ValueGenerator tfsig.ValueGenerator
	Owner          *string
	Repository     *string
}

TemplateConfig is the default implementation of `TemplateConfigProvider`.

func (*TemplateConfig) HasResource

func (c *TemplateConfig) HasResource() bool

HasResource returns `true` in case both `Repository` and `Owner` values exist, else `false`.

func (*TemplateConfig) OwnerValue

func (c *TemplateConfig) OwnerValue() *cty.Value

OwnerValue returns the provided `github_repository->template` `owner` attribute value as `cty.String` or `nil` if not provided.

func (*TemplateConfig) RepositoryValue

func (c *TemplateConfig) RepositoryValue() *cty.Value

RepositoryValue returns the provided `github_repository->template` `repository` attribute value as `cty.String` or `nil` if not provided.

type TemplateConfigProvider

type TemplateConfigProvider interface {
	// HasResource will indicate if resource has to be created (return `true` for instance to always create the
	// resource even if empty)
	HasResource() bool

	// OwnerValue return the `github_repository->template` `owner` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	OwnerValue() *cty.Value

	// RepositoryValue return the `github_repository->template` `repository` attribute value.
	//
	// If `nil` is returned, attribute will be omitted
	RepositoryValue() *cty.Value
}

TemplateConfigProvider defines required methods to be used when creating `github_repository->template` terraform block.

Jump to

Keyboard shortcuts

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