Documentation ¶
Overview ¶
-------------------------------------------------------------------------
* * cycle_container.go * RingBuffer * * * Copyright (c) 2021, Alibaba Group Holding Limited * 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. * * IDENTIFICATION * common/utils/cycle_container.go *-------------------------------------------------------------------------
-------------------------------------------------------------------------
* * utils.go * Utils functions * * * Copyright (c) 2021, Alibaba Group Holding Limited * 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. * * IDENTIFICATION * common/utils/utils.go *-------------------------------------------------------------------------
-------------------------------------------------------------------------
* * uuid.go * UUID * * * Copyright (c) 2021, Alibaba Group Holding Limited * 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. * * IDENTIFICATION * common/utils/uuid.go *-------------------------------------------------------------------------
Index ¶
- Variables
- func AddNonNegativeValue(out map[string]interface{}, metric string, value int64)
- func Atoi(buf []byte) uint64
- func CreateUUID() string
- func GetBasePath() string
- func GetInsName(insPath string, buf *bytes.Buffer) (string, error)
- func GetMountDev(path string) string
- func GetUserName(insPath string, buf *bytes.Buffer) (string, error)
- func LockFile(filePath string) (bool, error)
- func Minus(current, origin uint64) uint64
- func PortInUse(port int) (bool, error)
- func ReadJsonConf(filename string, conf interface{}) error
- func ShowVersion() string
- func ToUint64(str string) (uint64, error)
- func UnlockFile(filePath string) error
- func Unzip(src, dest string) error
- type CycleContainer
- func (cc *CycleContainer) GetRead() *bytes.Buffer
- func (cc *CycleContainer) GetReadIndex() uint32
- func (cc *CycleContainer) GetWrite() *bytes.Buffer
- func (cc *CycleContainer) GetWriteIndex() uint32
- func (cc *CycleContainer) Info() string
- func (cc *CycleContainer) NextReadSlot()
- func (cc *CycleContainer) NextWriteSlot()
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddNonNegativeValue ¶
func CreateUUID ¶
func CreateUUID() string
func GetBasePath ¶
func GetBasePath() string
func GetInsName ¶
get instance name from the file /home/mysql/dataXXXX/InsName
func GetMountDev ¶
func ReadJsonConf ¶
func ShowVersion ¶
func ShowVersion() string
func UnlockFile ¶
UnlockFile unlock the specified file, return err if unlock failed
Types ¶
type CycleContainer ¶
type CycleContainer struct {
// contains filtered or unexported fields
}
CycleContainer def
func NewCycleContainer ¶
func NewCycleContainer(cap uint32) *CycleContainer
build a new container with specified cap
func (*CycleContainer) GetRead ¶
func (cc *CycleContainer) GetRead() *bytes.Buffer
get current read buff
func (*CycleContainer) GetReadIndex ¶
func (cc *CycleContainer) GetReadIndex() uint32
get current read index
func (*CycleContainer) GetWrite ¶
func (cc *CycleContainer) GetWrite() *bytes.Buffer
get current write buff
func (*CycleContainer) GetWriteIndex ¶
func (cc *CycleContainer) GetWriteIndex() uint32
get current write index
func (*CycleContainer) NextReadSlot ¶
func (cc *CycleContainer) NextReadSlot()
set read buff to next
func (*CycleContainer) NextWriteSlot ¶
func (cc *CycleContainer) NextWriteSlot()
set write buff to next
Click to show internal directories.
Click to hide internal directories.