utils

package
v0.0.0-...-76e645c Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultValue = "N/A"

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(closeReader func() error, err *error)

func CreateSearchBySha1AndRepoAqlQuery

func CreateSearchBySha1AndRepoAqlQuery(repo string, sha1s []string) string

func GroupItems

func GroupItems(sliceToGroup []string, groupSize int) [][]string

AQL requests have a size limit, therefore, we split the requests into small groups. Group large slice into small groups, for example: sliceToGroup = []string{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; groupSize = 3 returns : [['0' '1' '2'] ['3' '4' '5'] ['6' '7' '8'] ['9]]

func Optional

func Optional(optionalValue string) (value string)

func OptionalVcsUrl

func OptionalVcsUrl(vcs *entities.Vcs) (value string)

Types

type StringSet

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

StringSet is a set of unique strings and it's not thread-safe.

func NewStringSet

func NewStringSet(strings ...string) *StringSet

func (*StringSet) Add

func (s *StringSet) Add(str string)

Add adds a string to the set. If string is already in the set, it has no effect.

func (*StringSet) AddAll

func (s *StringSet) AddAll(strings ...string)

func (*StringSet) Delete

func (s *StringSet) Delete(str string)

Delete removes a string from the set.

func (*StringSet) IsEmpty

func (s *StringSet) IsEmpty() bool

func (*StringSet) ToSlice

func (s *StringSet) ToSlice() []string

ToSlice returns strings in the set.

func (*StringSet) TotalStrings

func (s *StringSet) TotalStrings() int

Jump to

Keyboard shortcuts

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