Documentation ¶
Overview ¶
Copyright 2016 The Transicator Authors
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 2016 The Transicator Authors ¶
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 2016 The Transicator Authors ¶
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 2016 The Transicator Authors ¶
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 2016 The Transicator Authors ¶
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 2016 The Transicator Authors ¶
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 ¶
- Variables
- func Close()
- func DownloadSnapshot(w http.ResponseWriter, r *http.Request, db *sql.DB, p httprouter.Params)
- func GenSnapshot(w http.ResponseWriter, r *http.Request)
- func GetScopeData(cid string, db *sql.DB) (b []byte, err error)
- func GetScopes(w http.ResponseWriter, r *http.Request, db *sql.DB, p httprouter.Params)
- func GetTenantSnapshotData(tenantID []string, mediaType string, db *sql.DB, w io.Writer) error
- func GetTenants(tenantID []string) string
- func Run() (*goscaffold.HTTPScaffold, error)
- func SetConfigDefaults()
- func WriteSqliteSnapshot(scopes []string, db *sql.DB, w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
var ErrUsage = errors.New("Invalid arguments")
ErrUsage is returned when the user passes incorrect command-line arguments.
Functions ¶
func DownloadSnapshot ¶
func DownloadSnapshot( w http.ResponseWriter, r *http.Request, db *sql.DB, p httprouter.Params)
DownloadSnapshot downloads and returns the JSON related to the scope
func GenSnapshot ¶
func GenSnapshot(w http.ResponseWriter, r *http.Request)
GenSnapshot is currently implemented in SYNC mode, where in, it simply returns the scope back the ID redirect URL to query upon, to get the snapshot - which is yet another SYNC operation
func GetScopeData ¶
GetScopeData actually pulls the data for a scope.
func GetScopes ¶
func GetScopes( w http.ResponseWriter, r *http.Request, db *sql.DB, p httprouter.Params)
GetScopes returns the set of scopes for a particular cluster.
func GetTenantSnapshotData ¶
GetTenantSnapshotData pulls the snapshot for a given set of tenants and sends them back to a response writer.
func GetTenants ¶
GetTenants returns a list of tenant IDs turned into a string.
func Run ¶
func Run() (*goscaffold.HTTPScaffold, error)
Run starts the snapshot server. It will listen on an HTTP port as directed by the Viper configuration. This method will block until either there is an error, or the server is stopped, so a goroutine is recommended if running this as part of a unit test.
func SetConfigDefaults ¶
func SetConfigDefaults()
SetConfigDefaults sets up Viper for command-line and other processing.
func WriteSqliteSnapshot ¶
WriteSqliteSnapshot is responsible for generating the SQLite format of the snapshot, and also for streaming the file back to the caller.
Types ¶
This section is empty.