meta

package
v0.0.0-...-094c5f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectNotFound  = &notFound{"Object not found"}
	ErrProjectNotFound = errors.New("Project not found")
	ErrUserNotFound    = errors.New("Unable to find user")
)
View Source
var ErrNotAuthenticated = authError{errors.New("Forbidden")}

Functions

func CheckPass

func CheckPass(hashedPassword, password []byte) (bool, error)

func EncryptPass

func EncryptPass(password []byte) (string, error)

func IsAuthError

func IsAuthError(err error) bool

func IsObjectNotFound

func IsObjectNotFound(err error) bool

Types

type BatchVars

type BatchVars struct {
	Objects []*RequestVars `json:"objects"`
}

type GenericMetaStore

type GenericMetaStore interface {
	Put(v *RequestVars) (*Object, error)
	Get(v *RequestVars) (*Object, error)
	GetPending(v *RequestVars) (*Object, error)
	Commit(v *RequestVars) (*Object, error)
	Close()
	DeleteUser(user string) error
	AddUser(user, pass string) error
	AddProject(projectName string) error
	Users() ([]*User, error)
	Objects() ([]*Object, error)
	Projects() ([]*Project, error)
	Authenticate(string, string) (bool, error)
}

Wrapper for MetaStore so we can use different types

type Object

type Object struct {
	Oid          string   `json:"oid" cql:"oid"`
	Size         int64    `json:"size" cql:"size"`
	ProjectNames []string `json:"project_names"`
	Existing     bool
}

MetaObject is object metadata as seen by the object and metadata stores.

type Project

type Project struct {
	Name string   `json:"name" cql:"name"`
	Oids []string `json:"oids" cql:"oids"`
}

MetaProject is project metadata

type RequestVars

type RequestVars struct {
	Oid           string
	Size          int64
	User          string
	Password      string
	Namespace     string
	Repo          string
	Authorization string
}

RequestVars contain variables from the HTTP request. Variables from routing, json body decoding, and some headers are stored.

func (v *RequestVars) ObjectLink(scheme, host string) string
func (v *RequestVars) VerifyLink(scheme, host string) string

type User

type User struct {
	Name     string `cql:"username"`
	Password string ` cql:"password"`
}

MetaUser encapsulates information about a meta store user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL