Documentation ¶
Overview ¶
Copyright 2017 The GoStor Authors All rights reserved.
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.
Copyright 2017 The GoStor Authors All rights reserved.
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.
Index ¶
- type Operation
- type RaftServer
- func (s *RaftServer) Do(command raft.Command) (interface{}, error)
- func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (s *RaftServer) Join(peers []string) error
- func (s *RaftServer) Leader() (string, error)
- func (s *RaftServer) Peers() (members []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operation ¶
type Operation struct { Type string `json:"type"` Namespace string `json:"namespace"` Filename string `json:"name"` NewName string `json:"newname"` FileAttr *fs.Attr `json:"attr"` CreatedAt time.Time `json:"createdat"` }
This command writes a value to a key.
func NewOperation ¶
Creates a new operation command.
func (*Operation) CommandName ¶
The name of the command in the log.
type RaftServer ¶
type RaftServer struct {
// contains filtered or unexported fields
}
func NewRaftServer ¶
func (*RaftServer) HandleFunc ¶
func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
This is a hack around Gorilla mux not providing the correct net/http HandleFunc() interface.
func (*RaftServer) Join ¶
func (s *RaftServer) Join(peers []string) error
Join joins an existing cluster.
func (*RaftServer) Leader ¶
func (s *RaftServer) Leader() (string, error)
func (*RaftServer) Peers ¶
func (s *RaftServer) Peers() (members []string)