publicaccess

package
v1.0.2-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPublicAccessNotAllowed = errors.New("public access is not allowed")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	// Get returns whether public access is enabled on the resource.
	Get(
		ctx context.Context,
		resourceType enum.PublicResourceType,
		resourcePath string,
	) (bool, error)

	// Sets the public access mode for the resource based on the value of 'enable'.
	Set(
		ctx context.Context,
		resourceType enum.PublicResourceType,
		resourcePath string,
		enable bool,
	) error

	// Deletes any public access data stored for the resource.
	Delete(
		ctx context.Context,
		resourceType enum.PublicResourceType,
		resourcePath string,
	) error

	// IsPublicAccessSupported return true iff public access is supported under the provided space.
	IsPublicAccessSupported(ctx context.Context, parentSpacePath string) (bool, error)
}

Service is an abstraction of an entity responsible for managing public access to resources.

func NewService

func NewService(
	publicResourceCreationEnabled bool,
	publicAccessStore store.PublicAccessStore,
	repoStore store.RepoStore,
	spaceStore store.SpaceStore,
) Service

func ProvidePublicAccess

func ProvidePublicAccess(
	config *types.Config,
	publicAccessStore store.PublicAccessStore,
	repoStore store.RepoStore,
	spaceStore store.SpaceStore,
) Service

Jump to

Keyboard shortcuts

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