config

package
v0.0.0-...-bf0b9e6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2025 AlaudaDevops authors

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 2025 AlaudaDevops authors

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyConfig

type CopyConfig struct {
	// List of source configurations
	Sources []CopySource `json:"sources"`
	// Target configuration for copying
	Target *CopyTarget `json:"target,omitempty"`
}

CopyConfig represents the configuration for copying files from multiple sources.

func Load

func Load(ctx context.Context, configPath string) (*CopyConfig, error)

Load loads the configuration from the given path

func (*CopyConfig) Validate

func (c *CopyConfig) Validate(ctx context.Context) error

Validate whole configuration TODO: Refactor separating all validation methods into each separated struct

type CopyLinks struct {
	From   string `json:"from"`   // Source path for linking
	Target string `json:"target"` // Target path for the link
}

CopyLinks defines the linking configuration for files or directories.

func (CopyLinks) Parse

func (t CopyLinks) Parse(source CopySource) ifs.LinkRequest

Parse returns the link request for the given source

type CopySource

type CopySource struct {
	Name string `json:"name"` // Custom name for the source
	// Repository is currently not supported
	Dir *Directory `json:"dir"` // Directory information (mutually exclusive with Repository)
}

CopySource defines the source configuration for copying files.

type CopyTarget

type CopyTarget struct {
	CopyTo string      `json:"copyTo"` // Destination directory for copied files
	LinkTo string      `json:"linkTo"` // Base directory for relative paths
	Links  []CopyLinks `json:"links"`  // List of link configurations
}

CopyTarget defines the target configuration for copying files.

func (CopyTarget) Default

func (CopyTarget) Default() *CopyTarget

Default configuration for CopyTarget

func (CopyTarget) Parse

func (t CopyTarget) Parse(source CopySource) (links []ifs.LinkRequest)

Parse returns the list of link requests for the given source

type Directory

type Directory struct {
	Path string `json:"path"` // Path to the local directory
}

Directory contains information about a local directory.

Jump to

Keyboard shortcuts

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