Documentation ¶
Overview ¶
Copyright 2022 Nethermind
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Nethermind ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type DataDir
- type MonitoringStack
- func (m *MonitoringStack) Cleanup(force bool) (err error)
- func (m *MonitoringStack) Create(path string) (f afero.File, err error)
- func (m *MonitoringStack) CreateDir(path string) (err error)
- func (m *MonitoringStack) Init() error
- func (m *MonitoringStack) Installed() (installed bool, err error)
- func (m *MonitoringStack) Path() string
- func (m *MonitoringStack) ReadFile(path string) (data []byte, err error)
- func (m *MonitoringStack) Setup(env map[string]string, monitoringFs fs.FS) (err error)
- func (m *MonitoringStack) WriteFile(path string, data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrMonitoringStackNotFound = errors.New("monitoring stack not found") ErrInitializingMonitoringStack = errors.New("failed monitoring stack initialization") ErrReadingFile = errors.New("failed reading file") ErrWritingFile = errors.New("failed writing file") ErrStackNotInitialized = errors.New("stack not initialized") )
Functions ¶
This section is empty.
Types ¶
type DataDir ¶
type DataDir struct {
// contains filtered or unexported fields
}
DataDir is the directory where all the data is stored.
func NewDataDir ¶
NewDataDir creates a new DataDir instance with the given path as root.
func NewDataDirDefault ¶
NewDataDirDefault creates a new DataDir instance with the default path as root. Default path is $XDG_DATA_HOME/.sedge or $HOME/.local/share/.sedge if $XDG_DATA_HOME is not set as defined in the XDG Base Directory Specification
func (*DataDir) MonitoringStack ¶
func (d *DataDir) MonitoringStack() (*MonitoringStack, error)
MonitoringStack checks if a monitoring stack directory exists in the data directory. If the directory does not exist, it creates it and initializes a new MonitoringStack instance. If the directory exists, it simply returns a new MonitoringStack instance. It returns an error if there is any issue accessing or creating the directory, or initializing the MonitoringStack.
func (*DataDir) RemoveMonitoringStack ¶
RemoveMonitoringStack removes the monitoring stack directory from the data directory. It returns an error if there is any issue accessing or removing the directory.
type MonitoringStack ¶
type MonitoringStack struct {
// contains filtered or unexported fields
}
MonitoringStack represents the data stored about the monitoring stack
func (*MonitoringStack) Cleanup ¶
func (m *MonitoringStack) Cleanup(force bool) (err error)
Cleanup removes the monitoring stack datadir. If force is true, it doesn't lock the monitoring stack.
func (*MonitoringStack) Create ¶
func (m *MonitoringStack) Create(path string) (f afero.File, err error)
Create creates a new file in the monitoring stack at the given path.
func (*MonitoringStack) CreateDir ¶
func (m *MonitoringStack) CreateDir(path string) (err error)
CreateDir creates a new directory in the monitoring stack at the given path. It creates all the parent directories if they don't exist. It does nothing if the directory already exists.
func (*MonitoringStack) Init ¶
func (m *MonitoringStack) Init() error
Init initializes a new monitoring stack with the given path as root.
func (*MonitoringStack) Installed ¶
func (m *MonitoringStack) Installed() (installed bool, err error)
Installed checks if the monitoring stack is installed.
func (*MonitoringStack) Path ¶
func (m *MonitoringStack) Path() string
Path returns the path to the monitoring stack datadir.
func (*MonitoringStack) ReadFile ¶
func (m *MonitoringStack) ReadFile(path string) (data []byte, err error)
ReadFile reads the file at the given path in the monitoring stack.