utils

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package utils is a package that contains all the utility functions

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package utils is a package that contains all the utility functions

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package utils is a package that contains all the utility functions

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package utils is a package that contains all the utility functions

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package utils is a package that contains all the utility functions

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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

func FormatValue

func FormatValue(v string, escape bool, lineSeparator string) string

FormatValue formats a string that would be output as markdown

func GetLatestRepositoryTag added in v3.2.0

func GetLatestRepositoryTag(repository, token string, useMajorVersion bool, useTagCommitHash bool) (string, error)

GetLatestRepositoryTag returns the latest tag of a repository

func GetTagCommitHash added in v3.6.0

func GetTagCommitHash(repository, tag, token string) (string, error)

GetTagCommitHash returns the commit hash of a tag

func HasBytesInBetween

func HasBytesInBetween(value, start, end []byte) (found bool, indices [][]int)

HasBytesInBetween checks if a byte array has a start and end byte array and returns true if and all occurrences of start and end

func MarkdownLink(s string, t string) string

MarkdownLink formats input, output and secret name to Markdown link (named anchor) and return the link

func ReplaceBytesInBetween

func ReplaceBytesInBetween(value []byte, indices [][]int, new []byte) []byte

ReplaceBytesInBetween replaces a byte array between an array of start and end indices with a new byte array

func WordWrap

func WordWrap(s string, limit int, lineSeparator string) string

WordWrap wraps text at the specified number of columns and inserts a line separator

Types

type Release added in v3.2.0

type Release struct {
	TagName string `json:"tag_name"`
}

type Tag added in v3.6.0

type Tag struct {
	Object struct {
		SHA string `json:"sha"`
	} `json:"object"`
}

Jump to

Keyboard shortcuts

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