Documentation ¶
Index ¶
- type StringAtomicSlice
- func (slice *StringAtomicSlice) Append(str string)
- func (slice *StringAtomicSlice) Contain(s string) bool
- func (slice *StringAtomicSlice) Delete(index int) (item string)
- func (slice *StringAtomicSlice) DeleteEnd() (item string)
- func (slice *StringAtomicSlice) Empty() bool
- func (slice *StringAtomicSlice) Index(index int) string
- func (slice *StringAtomicSlice) IndexOfElement(s string) int
- func (slice *StringAtomicSlice) Length() int
- func (slice *StringAtomicSlice) Set(index int64, str string)
- func (slice *StringAtomicSlice) Slice() []string
- func (slice *StringAtomicSlice) String(index int64) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringAtomicSlice ¶
type StringAtomicSlice struct {
// contains filtered or unexported fields
}
StringAtomicSlice is a string slice that can be accessed and modified safely between multiple go-routines.
func NewStringAtomicSlice ¶
func NewStringAtomicSlice(size int64, capacity int64) *StringAtomicSlice
NewStringAtomicSlice creates a string slice that can be safely accessed from multiple go routines.
func (*StringAtomicSlice) Append ¶
func (slice *StringAtomicSlice) Append(str string)
Append a string to the slice. This operation is thread-safe.
func (*StringAtomicSlice) Contain ¶
func (slice *StringAtomicSlice) Contain(s string) bool
Contain obtains a read lock on the StringAtomicSlice while dermining whether the string s is contained in the slice.
func (*StringAtomicSlice) Delete ¶
func (slice *StringAtomicSlice) Delete(index int) (item string)
Delete removed an element of the slice and returns it. This operation is thread-safe.
func (*StringAtomicSlice) DeleteEnd ¶
func (slice *StringAtomicSlice) DeleteEnd() (item string)
DeleteEnd removes the last element of the slice and returns it. This operation is thread-safe.
func (*StringAtomicSlice) Empty ¶
func (slice *StringAtomicSlice) Empty() bool
Empty returns true if the length of the string is greater than zero. This operation is thread-safe.
func (*StringAtomicSlice) Index ¶
func (slice *StringAtomicSlice) Index(index int) string
Index returns a string at a particular index. This operation is thread-safe.
func (*StringAtomicSlice) IndexOfElement ¶
func (slice *StringAtomicSlice) IndexOfElement(s string) int
IndexOfElement obtains a read lock while looking for whether s is contained in the slice, returning its index.
func (*StringAtomicSlice) Length ¶
func (slice *StringAtomicSlice) Length() int
Length returns the length of the slice. This operation is thread-safe.
func (*StringAtomicSlice) Set ¶
func (slice *StringAtomicSlice) Set(index int64, str string)
Set string at a particular index This operation is thread-safe.
func (*StringAtomicSlice) Slice ¶
func (slice *StringAtomicSlice) Slice() []string
Slice returns a copy of a slice. This operation is thread-safe.
func (*StringAtomicSlice) String ¶
func (slice *StringAtomicSlice) String(index int64) string
String returns a string representation for the list. Useful for printing out the contents. This operation is thread-safe.