orgcreator

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package orgcreator is responsible for the creation of organizations. This would have been the responsibility of package 'organization' but carving out this particular responsibility into a separate package avoids an import cycle with the 'auth' package.

Index

Constants

View Source
const (
	DefaultSessionTimeout    = 20160
	DefaultSessionExpiration = 20160
)

Variables

This section is empty.

Functions

func NewService

func NewService(opts Options) *service

func NewTestOrganization

func NewTestOrganization(t *testing.T) *organization.Organization

Types

type Client

type Client struct {
	internal.JSONAPIClient
}

func (*Client) CreateOrganization

func (c *Client) CreateOrganization(ctx context.Context, options OrganizationCreateOptions) (*organization.Organization, error)

CreateOrganization creates a new organization with the given options.

type Options

type Options struct {
	*sql.DB
	pubsub.Publisher
	html.Renderer
	logr.Logger

	auth.AuthService

	RestrictOrganizationCreation bool
}

type OrganizationCreateOptions

type OrganizationCreateOptions struct {
	Name *string `schema:"name,required"`

	// TFE fields that OTF does not support but persists merely to pass the
	// go-tfe integration tests
	Email                      *string
	CollaboratorAuthPolicy     *string
	SessionRemember            *int
	SessionTimeout             *int
	AllowForceDeleteWorkspaces *bool
}

OrganizationCreateOptions represents the options for creating an organization. See dto.OrganizationCreateOptions for more details.

func (*OrganizationCreateOptions) Validate

func (opts *OrganizationCreateOptions) Validate() error

type OrganizationCreatorService

type OrganizationCreatorService = Service

type Service

type Service interface {
	CreateOrganization(ctx context.Context, opts OrganizationCreateOptions) (*organization.Organization, error)
}

Jump to

Keyboard shortcuts

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