Пример #1
0
//NewSession returns Session connected with given Node.
func NewSession(node *Node) (*Session, error) {
	session, err := C.new_elliptics_session(node.node)
	if err != nil {
		return nil, err
	}
	return &Session{
		session: session,
		groups:  make([]uint32, 0, 0),
	}, err
}
Пример #2
0
//NewSession returns Session connected with given Node.
func NewSession(node *Node) (*Session, error) {
	session := C.new_elliptics_session(node.node)
	if session == nil {
		return nil, fmt.Errorf("could not create new elliptics session")
	}
	return &Session{
		session: session,
		groups:  make([]uint32, 0, 0),
	}, nil
}