Documentation ¶
Index ¶
- Constants
- func BuildNotice(noticeType string) ([]byte, error)
- func BuildRepAuthStageOne(questionIn []byte) ([]byte, error)
- func BuildRepFindInNodesCache(nodesIn []data.NodeAuth) ([]byte, error)
- func BuildRepGetAuthUserData(userIn *data.UserAuth) ([]byte, error)
- func BuildRepGetDirConnSettings(dirConnSettingsIn *data.DirConnSettings) ([]byte, error)
- func BuildRepListAccessReqs(accessReqsIn []data.AccessReqDB) ([]byte, error)
- func BuildRepListNodes(nodesIn []data.NodeDB) ([]byte, error)
- func BuildRepListUsers(usersIn []data.UserDB) ([]byte, error)
- func BuildReqAddAccessReq(accessReqIn *data.AccessReq, secret string) ([]byte, error)
- func BuildReqAddNode(nodeIn *data.NodeDB) ([]byte, error)
- func BuildReqAddUser(userIn *data.UserDB) ([]byte, error)
- func BuildReqAuthStageOne(esamPubKeyIn *data.ESAMPubKey, noticesNotRequired bool) ([]byte, error)
- func BuildReqAuthStageTwo(answerIn []byte) ([]byte, error)
- func BuildReqChangePassword(password string, passwordHash string, passwordHashSign []byte) ([]byte, error)
- func BuildReqDelAccessReq(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
- func BuildReqDelNode(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
- func BuildReqDelUser(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
- func BuildReqFindInNodesCache(nodeFilterIn *data.NodeAuth, fullMatch bool) ([]byte, error)
- func BuildReqListAccessReqs(accessReqFilterIn *data.AccessReqDB) ([]byte, error)
- func BuildReqListNodes(nodeFilterIn *data.Node) ([]byte, error)
- func BuildReqListUsers(userFilterIn *data.User) ([]byte, error)
- func BuildReqPassKeyPassword(password string) ([]byte, error)
- func BuildReqUpdateNode(esamPubKeyIn *data.ESAMPubKey, nodeIn *data.NodeDB) ([]byte, error)
- func BuildReqUpdateUser(esamPubKeyIn *data.ESAMPubKey, userIn *data.UserDB) ([]byte, error)
- func BuildSimpleRep(reqType string, reqResultIn *ReqResult) ([]byte, error)
- func BuildSimpleReq(reqType string) ([]byte, error)
- func BuildUnsupportedMsg() ([]byte, error)
- func ParseMsgHeader(jsonIn []byte, msgHeaderOut *MsgHeader) error
- func ParseRepAuthStageOne(jsonIn []byte) ([]byte, error)
- func ParseRepFindInNodesCache(jsonIn []byte) ([]data.NodeAuth, error)
- func ParseRepGetAuthUserData(jsonIn []byte, userOut *data.UserAuth) error
- func ParseRepGetDirConnSettings(jsonIn []byte, dirConnSettingsOut *data.DirConnSettings) error
- func ParseRepListAccessReqs(jsonIn []byte) ([]data.AccessReqDB, error)
- func ParseRepListNodes(jsonIn []byte) ([]data.NodeDB, error)
- func ParseRepListUsers(jsonIn []byte) ([]data.UserDB, error)
- func ParseReqAddAccessReq(jsonIn []byte, accessReqOut *data.AccessReq, secret *string) error
- func ParseReqAddNode(jsonIn []byte, nodeOut *data.NodeDB) error
- func ParseReqAddUser(jsonIn []byte, userOut *data.UserDB) error
- func ParseReqAuthStageOne(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) (bool, error)
- func ParseReqAuthStageTwo(jsonIn []byte) ([]byte, error)
- func ParseReqChangePassword(jsonIn []byte) (string, string, []byte, error)
- func ParseReqDelAccessReq(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
- func ParseReqDelNode(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
- func ParseReqDelUser(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
- func ParseReqFindInNodesCache(jsonIn []byte, nodeFilterOut *data.NodeAuth, fullMatchOut *bool) error
- func ParseReqListAccessReqs(jsonIn []byte, accessReqFilterOut *data.AccessReqDB) error
- func ParseReqListNodes(jsonIn []byte, nodeFilterOut *data.Node) error
- func ParseReqListUsers(jsonIn []byte, userFilterOut *data.User) error
- func ParseReqPassKeyPassword(jsonIn []byte) (string, error)
- func ParseReqResult(jsonIn []byte, reqResultOut *ReqResult) error
- func ParseReqUpdateNode(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey, nodeOut *data.NodeDB) error
- func ParseReqUpdateUser(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey, userOut *data.UserDB) error
- func TestMsgSubType(subType string) error
- func TestMsgType(msgType string) error
- func TestNoticeType(noticeType string) error
- func TestReqResultStatus(reqResultStatus string) error
- func TestReqType(requestType string) error
- type MsgHeader
- type ReqResult
Constants ¶
View Source
const ( MsgTypeRequest = "request" MsgTypeReply = "reply" MsgTypeNotice = "notice" )
View Source
const ( ReqTypeAddAccessReq = "add_access_req" ReqTypeAuth = "auth" ReqTypeListAccessReqs = "list_access_reqs" ReqTypeDelAccessReq = "del_access_req" ReqTypeAddUser = "add_user" ReqTypeUpdateUser = "update_user" ReqTypeChangePassword = "change_password" ReqTypeListUsers = "list_user" ReqTypeGetAuthUserData = "get_auth_user_data" ReqTypeDelUser = "del_user" ReqTypeAddNode = "add_node" ReqTypeUpdateNode = "update_node" ReqTypeListNodes = "list_nodes" ReqTypeFindInNodesCache = "find_in_nodes_cache" ReqTypeDelNode = "del_node" ReqTypeGetDirConnSettings = "get_dir_conn_settings" ReqTypePassKeyPassword = "pass_key_password" )
View Source
const ( ReqResultStatusFailed = "failed" ReqResultStatusSuccessful = "successful" )
View Source
const ( ReqResultReasonEmpty = "" ReqResultReasonUnsupportedReq = "Unsupported request" ReqResultReasonInvalidInputData = "Invalid input data" ReqResultReasonInternalError = "Internal error" ReqResultReasonAccessDenied = "Access denied" ReqResultReasonInvalidSignature = "Invalid signature" ReqResultReasonAlreadyExist = "Already exist" ReqResultReasonNotFound = "Not found" ReqResultReasonPasswordTooSimple = "Password too simple" ReqResultReasonKeyPasswordRequired = "Key password required" )
View Source
const ( NoticeTypeNoop = "noop" NoticeTypeUpdatedUsers = "updated_users" NoticeTypeUpdatedNodes = "updated_nodes" )
Variables ¶
This section is empty.
Functions ¶
func BuildNotice ¶
For parse notice use ParseMsgHeader
func BuildRepAuthStageOne ¶
func BuildRepGetDirConnSettings ¶
func BuildRepGetDirConnSettings(dirConnSettingsIn *data.DirConnSettings) ([]byte, error)
func BuildRepListAccessReqs ¶
func BuildRepListAccessReqs(accessReqsIn []data.AccessReqDB) ([]byte, error)
func BuildReqAddAccessReq ¶
func BuildReqAuthStageOne ¶
func BuildReqAuthStageOne(esamPubKeyIn *data.ESAMPubKey, noticesNotRequired bool) ([]byte, error)
func BuildReqAuthStageTwo ¶
func BuildReqChangePassword ¶
func BuildReqDelAccessReq ¶
func BuildReqDelAccessReq(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
func BuildReqDelNode ¶
func BuildReqDelNode(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
func BuildReqDelUser ¶
func BuildReqDelUser(esamPubKeyIn *data.ESAMPubKey) ([]byte, error)
func BuildReqListAccessReqs ¶
func BuildReqListAccessReqs(accessReqFilterIn *data.AccessReqDB) ([]byte, error)
func BuildReqPassKeyPassword ¶
func BuildReqUpdateNode ¶
func BuildReqUpdateUser ¶
func BuildSimpleReq ¶
Suitable for:
ReqTypeGetDirConnSettings
ReqTypeGetAuthUserData
For parse request use ParseMsgHeader
func BuildUnsupportedMsg ¶
func ParseMsgHeader ¶
func ParseRepAuthStageOne ¶
func ParseRepGetAuthUserData ¶
func ParseRepGetDirConnSettings ¶
func ParseRepGetDirConnSettings(jsonIn []byte, dirConnSettingsOut *data.DirConnSettings) error
func ParseRepListAccessReqs ¶
func ParseRepListAccessReqs(jsonIn []byte) ([]data.AccessReqDB, error)
func ParseReqAddAccessReq ¶
func ParseReqAuthStageOne ¶
func ParseReqAuthStageOne(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) (bool, error)
func ParseReqAuthStageTwo ¶
func ParseReqChangePassword ¶
func ParseReqDelAccessReq ¶
func ParseReqDelAccessReq(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
func ParseReqDelNode ¶
func ParseReqDelNode(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
func ParseReqDelUser ¶
func ParseReqDelUser(jsonIn []byte, esamPubKeyOut *data.ESAMPubKey) error
func ParseReqListAccessReqs ¶
func ParseReqListAccessReqs(jsonIn []byte, accessReqFilterOut *data.AccessReqDB) error
func ParseReqPassKeyPassword ¶
func ParseReqResult ¶
func ParseReqUpdateNode ¶
func ParseReqUpdateUser ¶
func TestMsgSubType ¶
func TestMsgType ¶
func TestNoticeType ¶
func TestReqResultStatus ¶
func TestReqType ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.