Documentation ¶
Overview ¶
Package smbcc manages sambacc JSON configuration.
Index ¶
Constants ¶
const ( // CTDB feature flag indicates the system should be configured with CTDB. CTDB FeatureFlag = "ctdb" // DefaultSmbPort is the default port which containerized smbd binds to. DefaultSmbPort int = 445 )
const ( // Globals is used for the default globals subsection. Globals = Key("globals") // AllEntriesKey is used for the standard "all_entries" default key for // users and groups. AllEntriesKey = Key("all_entries") // BrowseableParam controls if a share is browseable. BrowseableParam = "browseable" // ReadOnlyParam controls if a share is read only. ReadOnlyParam = "read only" // Yes means yes. Yes = "yes" // No means no. No = "no" )
Variables ¶
This section is empty.
Functions ¶
func NewDefaultUsers ¶
func NewDefaultUsers() map[Key]UserEntries
NewDefaultUsers returns a full subsection for a default (good for testing) set of users.
Types ¶
type ConfigSection ¶
type ConfigSection struct { Globals []Key `json:"globals,omitempty"` InstanceName string `json:"instance_name,omitempty"` InstanceFeatures []FeatureFlag `json:"instance_features,omitempty"` Permissions PermissionsConfig `json:"permissions,omitempty"` }
ConfigSection identifies the shares, globals, and instance name of a single configuration.
func NewConfigSection ¶
func NewConfigSection(name string) ConfigSection
NewConfigSection returns a new ConfigSection.
type FeatureFlag ¶
type FeatureFlag string
FeatureFlag values are used to select top level features that sambacc will apply when setting up a container.
type GlobalConfig ¶
type GlobalConfig struct {
Options SmbOptions `json:"options,omitempty"`
}
GlobalConfig holds configuration values for samba server globals.
func NewGlobals ¶
func NewGlobals(opts GlobalOptions) GlobalConfig
NewGlobals returns a default GlobalConfig.
type GlobalOptions ¶
type GlobalOptions struct { // AddVFSFileid is used to check if we add vfs_fileid to the smb config AddVFSFileid bool // SmbPort is used as value to 'smb ports' config SmbPort int }
GlobalOptions is used to pass options to modify the samba configuration
func NewGlobalOptions ¶
func NewGlobalOptions() GlobalOptions
NewGlobalOptions is the constructor for struct SambaConfigOptions
type GroupEntry ¶
GroupEntry represents a single "local" group for share access.
type PermissionsConfig ¶
type PermissionsConfig struct { Method string `json:"method,omitempty"` StatusXAttr string `json:"status_xattr,omitempty"` Mode string `json:"mode,omitempty"` }
PermissionsConfig indicates the permissions to be set on the share mountpoint
func NewPermissionsConfig ¶
func NewPermissionsConfig() PermissionsConfig
NewPermissionsConfig returns a new PermissionsConfig.
type SambaContainerConfig ¶
type SambaContainerConfig struct { SCCVersion string `json:"samba-container-config"` Configs map[Key]ConfigSection `json:"configs,omitempty"` Globals map[Key]GlobalConfig `json:"globals,omitempty"` Users map[Key]UserEntries `json:"users,omitempty"` Groups map[Key]GroupEntries `json:"groups,omitempty"` }
SambaContainerConfig holds one or more configuration for samba containers.
type ShareConfig ¶
type ShareConfig struct {
}ShareConfig holds configuration values for one share.
func NewSimpleShare ¶
func NewSimpleShare(path string) ShareConfig
NewSimpleShare returns a ShareConfig with a simple configuration.
type SmbOptions ¶
SmbOptions is a common type for storing smb.conf parameters.