common

package
v0.0.0-...-b12578f Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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.

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.

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.

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.

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.

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

View Source
const (
	CHARACTER_MAX_LENGTH = 255
	VALID_PATTERN_STR    = "^[%|a-zA-Z0-9_-]+$"
)
View Source
const (
	VIRTUAL_APPGROUP_PREFIX = "%%PROJECT_%s%%"
)

Variables

This section is empty.

Functions

func BuildWithProjectGroup

func BuildWithProjectGroup(origin string, groupPrefix string) string

func CheckGroup

func CheckGroup(group string) error

func CheckMessage

func CheckMessage(msg *message.Message, maxSize int) error

func CheckTopic

func CheckTopic(topic string) error

func ClearProjectGroup

func ClearProjectGroup(origin string, groupPrefix string) string

func Decode

func Decode(data []byte, v interface{}) error

Decode Json Decode Author: rongzhihong Since: 2017/9/19

func Encode

func Encode(v interface{}) ([]byte, error)

Encode Json Encode Author: rongzhihong Since: 2017/9/19

func LocalAddress

func LocalAddress() (laddr string, err error)

Types

type Callback

type Callback func(r *Result, err error)

type CommunicationMode

type CommunicationMode int
const (
	SYNC CommunicationMode = iota
	ASYNC
	ONEWAY
)

func (CommunicationMode) String

func (cm CommunicationMode) String() string

type FindBrokerResult

type FindBrokerResult struct {
	BrokerAddr string
	Slave      bool
}

FindBrokerResult

type PullResult

type PullResult struct {
	Status          PullStatus
	NextBeginOffset int64
	MinOffset       int64
	MaxOffset       int64
	Msgs            []*message.MessageExt
}

type PullStatus

type PullStatus int
const (
	// Founded
	FOUND PullStatus = iota
	// No new message can be pull
	NO_NEW_MSG
	// Filtering results can not match
	NO_MATCHED_MSG
	// Illegal offset,may be too big or too small
	OFFSET_ILLEGAL
)

func (PullStatus) String

func (status PullStatus) String() string

type Result

type Result struct {
	Status      ResultStatus
	MsgId       string
	Queue       *message.MessageQueue
	QueueOffset int64
	TransId     string
}

func NewResult

func NewResult(groupPrefix string, status ResultStatus, msgId string, messageQueue *message.MessageQueue,
	queueOffset int64, transId string) *Result

func (*Result) String

func (r *Result) String() string

type ResultStatus

type ResultStatus int
const (
	SEND_OK ResultStatus = iota
	FLUSH_DISK_TIMEOUT
	FLUSH_SLAVE_TIMEOUT
	SLAVE_NOT_AVAILABLE
	SEND_UNKNOW
)

func (ResultStatus) String

func (status ResultStatus) String() string

type SRVStatus

type SRVStatus int
const (
	CREATE_JUST      SRVStatus = iota // Service just created,not start
	RUNNING                           // Service Running
	SHUTDOWN_ALREADY                  // Service shutdown
	START_FAILED                      // Service Start failure
)

func (SRVStatus) String

func (status SRVStatus) String() string

Jump to

Keyboard shortcuts

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