Exemplo n.º 1
0
// Copyright 2015 realglobe, Inc.
//
// 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.

package coop

import (
	"github.com/realglobe-Inc/go-lib/rglog"
)

const logRoot = "github.com/realglobe-Inc"

var log = rglog.Logger(logRoot + "/edo-auth/api/coop")
Exemplo n.º 2
0
// Copyright 2015 realglobe, Inc.
//
// 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.

package auth

import (
	"github.com/realglobe-Inc/go-lib/rglog"
)

const logRoot = "github.com/realglobe-Inc"

var log = rglog.Logger(logRoot + "/edo-auth/page/auth")
Exemplo n.º 3
0
//
// 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.

package controller

import (
	"github.com/realglobe-Inc/go-lib/rglog"
	"gopkg.in/mgo.v2"
)

var (
	logger = rglog.Logger("xRS/statement")
)

// Controller stores the local configuration of controller.
type Controller struct {
	session *mgo.Session // Mongo DB のセッション
}

// New は新しい Controller のインスタンスを返す。
// 引数の s にはこのコントローラで使用する Mongo DB のセッションが与えられる。
func New(s *mgo.Session) *Controller {
	return &Controller{s}
}
Exemplo n.º 4
0
import (
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"

	"github.com/miyazakijunichi/gojsonschema"
	"github.com/realglobe-Inc/go-lib/rglog"
)

type XAPISchema map[XAPIVersion]map[string]*gojsonschema.Schema

var (
	logger = rglog.Logger("XAPI/validator/validator")
	schema = &XAPISchema{}
)

func (s *XAPISchema) Get(version XAPIVersion, name string) *gojsonschema.Schema {
	return (*s)[version][name]
}

func GetXAPISchemaInstance() *XAPISchema {
	return schema
}

func init() {
	var err error

	var schemaPathV10x string
Exemplo n.º 5
0
	//	_ "net/http/pprof"
	"flag"
	"net/http"
	"os"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/acceptlang"
	"github.com/realglobe-Inc/edo-xrs/app/controller"
	"github.com/realglobe-Inc/edo-xrs/app/miscs"
	"github.com/realglobe-Inc/edo-xrs/app/model"
	"github.com/realglobe-Inc/go-lib/rglog"
	"gopkg.in/mgo.v2"
)

var (
	logger = rglog.Logger("xRS/main")
)

var configFile string

func init() {
	var defaultConfig = "./conf/app.conf"
	if p := os.Getenv("GOPATH"); len(p) != 0 {
		defaultConfig = p + "/src/github.com/realglobe-Inc/edo-xrs/conf/app.conf"
	}
	flag.StringVar(&configFile, "config", defaultConfig, "path of config file")

	if _, err := os.Stat(configFile); os.IsNotExist(err) {
		logger.Err("config file not found: ", err)
		os.Exit(1)
	}