export

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UsersFileName name of the file with user info
	UsersFileName = "users.json"
	// RolesFileName name of the file with roles info
	RolesFileName = "roles.json"
	// LdapServersFileName name of the file with ldap servers
	LdapServersFileName = "ldap_servers.json"
	// LdapRoleMappingsFileName name of the file with ldap role mapping
	LdapRoleMappingsFileName = "ldap_role_mappings.json"
	// LdapTeamMappingsFileName name of the file with ldap team mappingj
	LdapTeamMappingsFileName = "ldap_team_mappings.json"
	// SamlIdpFileName name of the file about saml idp
	SamlIdpFileName = "saml_identity_providers.json"
	// SamlRoleMappingsFileName saml roles mapping file
	SamlRoleMappingsFileName = "saml_role_mappings.json"
	// SamlTeamMappingsFileName salm teams mapping file
	SamlTeamMappingsFileName = "saml_team_mappings.json"
	// TeamsFileName teams file
	TeamsFileName = "teams.json"

	// DateTimeFormat the formal to use for DT
	DateTimeFormat = "2006-01-02-15-04-05"
)
View Source
const (
	// UsersOption represent users
	UsersOption = "users"
	// TeamsOption represent teams (groups)
	TeamsOption = "teams"
	// ResultsOption represent results (projects & data)
	ResultsOption = "triage"
)

Variables

This section is empty.

Functions

func CreateExportFileName

func CreateExportFileName(prefix string, now time.Time) string

CreateExportFileName creates a file name with the format: {prefix}-yyyy-mm-dd-HH-MM-SS.zip

func GetOptions

func GetOptions() []string

Types

type Export

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

func CreateExport

func CreateExport(prefix string) (Export, error)

CreateExport creates ExportProducer structure and temporary directory The caller is responsible for calling the Export.Clear function when it's done with the ExportProducer

func (*Export) AddFile

func (e *Export) AddFile(fileName string, data []byte) error

AddFile creates a file with the specified name and content in ExportProducer's temporary directory.

func (*Export) AddFileWithDataSource

func (e *Export) AddFileWithDataSource(fileName string, dataSource func() ([]byte, error)) error

AddFileWithDataSource creates the specified file with content provided by dataSource

func (*Export) Clean

func (e *Export) Clean() error

Clean removes ExportProducer's temporary directory and it's contents

func (*Export) CreateExportPackage

func (e *Export) CreateExportPackage(prefix, outputPath string) (string, error)

CreateExportPackage compresses and encrypts all files added so far

func (*Export) GetTmpDir

func (e *Export) GetTmpDir() string

type Exporter

type Exporter interface {
	AddFile(fileName string, data []byte) error
	AddFileWithDataSource(fileName string, dataSource func() ([]byte, error)) error
	CreateExportPackage(prefix, outputPath string) (string, error)
	Clean() error
	GetTmpDir() string
}

Jump to

Keyboard shortcuts

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